XComp commented on code in PR #21742:
URL: https://github.com/apache/flink/pull/21742#discussion_r1099989601


##########
flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionService.java:
##########
@@ -100,6 +100,7 @@ public final void stop() throws Exception {
             if (!running) {
                 return;
             }
+            leaderContender.revokeLeadership();

Review Comment:
   Thanks for clarifying things in this matter.
   > However, I strongly have a mind that the leader information stored in the 
ZNode and ConfigMap needs to be cleaned up if a leader contender is revoked 
leadership. Before this change, this is true since the revokeLeadership happens 
along with clearConfirmedLeaderInformation.
   
   This could be fixed by adding to the contract of 
`DefaultLeaderElectionService` that it calls `onRevokeLeadership()` when before 
stopping the service. Essentially, leadership can be revoked by the HA backend 
or by itself when calling `stop`. The leader elector still having leadership 
shouldn't be a problem because only the contender deregisters himself from the 
leadership process. 



-- 
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