ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1264 FollowerResyncConcurrencyTest failing intermittently
  3. ZOOKEEPER-1282

Learner.java not following Zab 1.0 protocol - setCurrentEpoch should be done upon receipt of NEWLEADER (before acking it) and not upon receipt of UPTODATE

    Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.0, 3.5.0
    • Component/s: server
    • Labels:
      None
    • Release Note:
      Revision 1198053

      Description

      according to https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab1.0
      phase 2 part 2, "Once it receives NEWLEADER(e) it atomically applies
      the new state and sets f.currentEpoch =e. "

      In Learner.java self.setCurrentEpoch(newEpoch) is done after receiving
      UPTODATE and not before acking the NEWLEADER message as should be.

      case Leader.UPTODATE:
      if (!snapshotTaken)

      { zk.takeSnapshot(); }

      self.cnxnFactory.setZooKeeperServer(zk);
      break outerLoop;
      case Leader.NEWLEADER: // it will be NEWLEADER in v1.0
      zk.takeSnapshot();
      snapshotTaken = true;
      writePacket(new QuorumPacket(Leader.ACK,
      newLeaderZxid, null, null), true);
      break;
      }
      }
      }
      long newEpoch = ZxidUtils.getEpochFromZxid(newLeaderZxid);
      self.setCurrentEpoch(newEpoch);

        Issue Links

          Activity

            People

            • Assignee:
              Benjamin Reed
              Reporter:
              Alexander Shraer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development