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

ZooKeeper not starting because acceptedEpoch is less than the currentEpoch

    XMLWordPrintableJSON

    Details

      Description

      This issue occurred in one of our test environment where disk was being changed to read only very frequently.
      The the scenario is as follows:

      1. Configure three node ZooKeeper cluster, lets say nodes are A, B and C
      2. Start A and B. Both A and B start successfully, quorum is running.
      3. Start C, because of IO error C fails to update acceptedEpoch file. But C also starts successfully, joins the quorum as follower
      4. Stop C
      5. Start C, bellow exception with message "The accepted epoch, 0 is less than the current epoch, 1" is thrown
        2015-10-29 16:52:32,942 [myid:3] - ERROR [main:QuorumPeer@784] - Unable to load database on disk
        java.io.IOException: The accepted epoch, 0 is less than the current epoch, 1
        	at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:781)
        	at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:720)
        	at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:202)
        	at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:139)
        	at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:88)
        2015-10-29 16:52:32,946 [myid:3] - ERROR [main:QuorumPeerMain@111] - Unexpected exception, exiting abnormally
        java.lang.RuntimeException: Unable to run quorum server 
        	at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:785)
        	at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:720)
        	at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:202)
        	at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:139)
        	at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:88)
        Caused by: java.io.IOException: The accepted epoch, 0 is less than the current epoch, 1
        	at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:781)
        

        Attachments

        1. ZOOKEEPER-2307-01.patch
          7 kB
          Mohammad Arshad
        2. ZOOKEEPER-2307-02.patch
          7 kB
          Mohammad Arshad
        3. ZOOKEEPER-2307-03.patch
          12 kB
          Mohammad Arshad
        4. ZOOKEEPER-2307-04.patch
          11 kB
          Mohammad Arshad

          Issue Links

            Activity

              People

              • Assignee:
                arshad.mohammad Mohammad Arshad
                Reporter:
                arshad.mohammad Mohammad Arshad
              • Votes:
                1 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h