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

Leader.waitForEpochAck() checks waitingForNewEpoch instead of checking electionFinished

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.0, 3.5.0
    • Component/s: server
    • Labels:
      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
        There are no Sub-Tasks for this issue.

          Activity

            People

            • Assignee:
              shralex Alexander Shraer
              Reporter:
              shralex Alexander Shraer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: