mustafaAlmonayer opened a new pull request, #25529:
URL: https://github.com/apache/camel/pull/25529

   ZooKeeperClusterView did not release leadership when the ZooKeeper
   connection entered an error state, and never re-entered the election
   afterwards.
   
   Two separate problems:
   
   * CuratorLocalMember#isLeader delegated to LeaderSelector#hasLeadership.
     Curator clears that flag only after takeLeadership() has returned, so
     a listener querying getLocalMember().isLeader() from inside the
     leadership-changed event - which is what ClusteredRoutePolicy does -
     still observed true and kept its routes running on a node that had
     already lost leadership.
   
   * LeaderSelector was started without autoRequeue(), so once
     takeLeadership() returned the member left the election permanently.
     The only re-entry path was the requeue() call in doStart(), which
     requires the view to be restarted. After a connection error the
     cluster could be left with no leader at all until the affected
     processes were restarted manually.
   
   The view now tracks leadership in its own volatile flag, cleared before
   the leadership-lost event is fired, and enables autoRequeue() so the
   member rejoins the election. The leadership-lost event reports no leader
   explicitly instead of re-reading it from ZooKeeper, where the not yet
   released lock node could still name the local member.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to