Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-653

Double leader for LeaderLatch

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.4.0
    • Recipes
    • None

    Description

      Reported by @woaishixiaoxiao:

      When I use the LeaderLatch to select leader, there is a double-leader phenomenon.
      The timeline is as follows:
      1. The zk cluster switch leader node bescause of zxid overflow. The cluster is unavailable to the outside world
      2. A client(not leader befor zxid overflow) and B client(is leader before zxid overflow) enter the suspend state, B client set its leader status to false
      3. The zk cluster complete the leader node election and the cluster back to normal
      4. A client enter the reconnect state and call the reset function, set its leader status to false.
      5. B client enter the reconnect state, call the reset function. set its leader status to false. Delete its old path.
      6. A client receive preNodeDeleteEvent. Then getChildren from zkServer. Find itself is the smallest number and set itself as a leader.
      7. B client create a new temporary node and then getChildren from zkServer. Find itself not the node with the smallest serial number and listen to the previous node delete event.
      8. A client delete its old path.
      9. B client receive the preNodeDeleteEvent. then getchildren from zkServer. Find itself is the smallest sequence number and then set itself as a leader
      10. A client create a new temporary node and then getChildren from zkServer. Find itself not the node with the smallest serial number and listen to the previous node delete event. but it doesn't set itself as a non-leader state. because of the sixth step operation, A still is leader state now.
      11. now A client and B client are the leader at the same time

      Attachments

        Issue Links

          Activity

            People

              tison Zili Chen
              tison Zili Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 2h 40m
                  2h 40m