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

getEpochToPropose should check if lastAcceptedEpoch is greater or equal than epoch

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: 3.4.3, 3.5.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The following block in Leader.getEpochToPropose:

      if (lastAcceptedEpoch > epoch) {
      	epoch = lastAcceptedEpoch+1;
      }
      

      needs to be fixed, since it doesn't increment the epoch variable in the case epoch != -1 (initial value) and lastAcceptedEpoch is equal. The fix trivial and corresponds to changing > with >=.

        Attachments

        1. ZOOKEEPER-1343-3.4.patch
          7 kB
          Flavio Junqueira
        2. ZOOKEEPER-1343.patch
          7 kB
          Flavio Junqueira
        3. ZOOKEEPER-1343.patch
          6 kB
          Flavio Junqueira
        4. ZOOKEEPER-1343.patch
          5 kB
          Flavio Junqueira

          Activity

            People

            • Assignee:
              fpj Flavio Junqueira
              Reporter:
              fpj Flavio Junqueira
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: