Review Board 1.7.22


Send FLE notifications only to voters in current config, reverting a change made in zk-107

Review Request #15317 - Created Nov. 7, 2013 and updated

Alexander Shraer
3.5.0
ZOOKEEPER-1807
Reviewers
zookeeper
zookeeper
ZOOKEEPER-1807
two tests added to ReconfigRecoveryTest
./src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java
Revision 1539709 New Change
[20] 576 lines
[+20] [+] public void shutdown(){
577
        LOG.debug("FLE is down");
577
        LOG.debug("FLE is down");
578
    }
578
    }
579
    
579
    
580

    
   
580

   
581
    /**
581
    /**
582
     * Send notifications to all peers upon a change in our vote
582
     * Send notifications to voters in current config upon a change in our vote.

    
   
583
     * Notifications contain the current config itself.

    
   
584
     * If a server receives the message and has an older config

    
   
585
     * it will adopt the newly received one and restart FLE.

    
   
586
     * For an example of why this is necessary see

    
   
587
     * ReconfigRecoveryTest.testObserverConvertedToParticipantDuringFLE.

    
   
588
     * Besides the current config there may be a pending config change,

    
   
589
     * and its important to have new servers connect to the leader

    
   
590
     * chosen by FLE (leader of current config). This is achieved by starting any new servers with

    
   
591
     * a config containing the old servers, so new servers will initiate

    
   
592
     * connections to old servers and will learn about the chosen leader

    
   
593
     * from old server responses.
583
     */
594
     */
584
    private void sendNotifications() {
595
    private void sendNotifications() {
585
        for (long sid : self.getAllKnownServerIds()) {
596
        for (long sid : self.getVotingView().keySet()) {
586
            QuorumVerifier qv = self.getQuorumVerifier();
597
            QuorumVerifier qv = self.getQuorumVerifier();
587
            ToSend notmsg = new ToSend(ToSend.mType.notification,
598
            ToSend notmsg = new ToSend(ToSend.mType.notification,
588
                    proposedLeader,
599
                    proposedLeader,
589
                    proposedZxid,
600
                    proposedZxid,
590
                    logicalclock,
601
                    logicalclock,
[+20] [20] 394 lines
./src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java
Revision 1539709 New Change
 
./src/java/test/org/apache/zookeeper/server/quorum/ReconfigRecoveryTest.java
Revision 1539709 New Change
 
  1. ./src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java: Loading...
  2. ./src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java: Loading...
  3. ./src/java/test/org/apache/zookeeper/server/quorum/ReconfigRecoveryTest.java: Loading...