You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2020/02/14 09:29:33 UTC

[GitHub] [zookeeper] yfxhust commented on a change in pull request #1247: ZOOKEEPER-3713: ReadOnlyZooKeeperServer should not expose the uniniti…

yfxhust commented on a change in pull request #1247: ZOOKEEPER-3713: ReadOnlyZooKeeperServer should not expose the uniniti…
URL: https://github.com/apache/zookeeper/pull/1247#discussion_r379328043
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeer.java
 ##########
 @@ -1350,6 +1350,15 @@ public void run() {
                     ServerMetrics.getMetrics().LOOKING_COUNT.add(1);
 
                     if (Boolean.getBoolean("readonlymode.enabled")) {
+                        if (!zkDb.isInitialized()) {
 
 Review comment:
   Thank you for comments.
   Let's take Follower as example.
   In my understanding, FollowerZooKeeperServer is shutdown and clear QuorumPeer's `follower` as null when there is issue during syncing with leader. This is as same as what you described. But the corresponding QuorumPeer is still alive and it will fall into ServerState.LOOKING. In the LOOKING state, it will start a temporary ReadOnlyZooKeeperServer if `readonlymode.enabled` is set. That's the point that this PR want to resolve.
   If `readonlymode.enabled` is not set, I think it wont't move forward and look for leader.
   So I missed anything ? Thank you!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services