Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1192

Leader.waitForEpochAck() checks waitingForNewEpoch instead of checking electionFinished

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 3.4.0, 3.5.0
    • server
    • None

    Description

      A follower/leader should block in Leader.waitForEpochAck() until either electingFollowers contains a quorum and electionFinished=true or until a timeout occurs. A timeout means that a quorum of followers didn't ack the epoch on time, which is an error.

      But the check in Leader.waitForEpochAck() is "if (waitingForNewEpoch) throw..." and this will never be triggered, even if the wait statement just timed out, because Leader.getEpochToPropose() completes and sets waitingForNewEpoch to false before Leader.waitForEpochAck() is invoked.

      Instead of "if (waitingForNewEpoch) throw" the condition in Leader.waitForEpochAck() should be "if (!electionFinished) throw".
      The guarded block introduced in ZK-1191 should be checking !electionFinished.

      Attachments

        1. zookeeper-1192.patch
          2 kB
          Alexander Shraer
        2. ZOOKEEPER-1192.patch
          6 kB
          Benjamin Reed
        3. zookeeper-1192-ver1.patch
          6 kB
          Alexander Shraer

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shralex Alexander Shraer
            shralex Alexander Shraer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment