XComp opened a new pull request, #21742:
URL: https://github.com/apache/flink/pull/21742

   ## What is the purpose of the change
   
   This PR is about hardening the `LeaderElectionService.stop()` contract.
   
   The current implementations of LeaderElectionService do not implement the 
stop() call consistently. Some (e.g. 
[StandaloneLeaderElectionService](https://github.com/apache/flink/blob/c6997c97c575d334679915c328792b8a3067cfb5/flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/StandaloneLeaderElectionService.java#L53)
 call revoke on the LeaderContender) whereas others don't (e.g. 
[DefaultLeaderElectionService](https://github.com/apache/flink/blob/6e1caa390882996bf2d602951b54e4bb2d9c90dc/flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/DefaultLeaderElectionService.java#L96)).
 The 
[MultipleComponentLeaderElectionService](https://github.com/apache/flink/blob/0290715a57b8d243586ab747b0cd2416c8081012/flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/DefaultMultipleComponentLeaderElectionService.java#L166)
 does call revoke on the LeaderContender instances, though.
   
   We should align this behavior and specify it in the LeaderElectionService 
contract before going ahead with refactoring the interfaces 
([FLIP-285](https://cwiki.apache.org/confluence/display/FLINK/FLIP-285%3A+Refactoring+LeaderElection+to+make+Flink+support+multi-component+leader+election+out-of-the-box)).
   
   ## Brief change log
   
   * Updated the JavaDoc in `LeaderElectionService.stop()` to specify the 
contract
   * Added `LeaderContender.revokeLeadership()` call to implementations that 
missed that call before
   
   ## Verifying this change
   
   The `LeaderContender.revokeLeadership()` call was also added to 
`TestingLeaderElectionService` to make each test rely on this contract.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? JavaDocs
   


-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to