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

getEpochToPropose should check if lastAcceptedEpoch is greater or equal than epoch

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.4.0
    • 3.4.3, 3.5.0
    • None
    • None
    • 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.patch
          5 kB
          Flavio Paiva Junqueira
        2. ZOOKEEPER-1343.patch
          6 kB
          Flavio Paiva Junqueira
        3. ZOOKEEPER-1343.patch
          7 kB
          Flavio Paiva Junqueira
        4. ZOOKEEPER-1343-3.4.patch
          7 kB
          Flavio Paiva Junqueira

        Activity

          People

            fpj Flavio Paiva Junqueira
            fpj Flavio Paiva Junqueira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: