XComp opened a new pull request, #22422:
URL: https://github.com/apache/flink/pull/22422
## What is the purpose of the change
We need to handle the leader event calls in a separate thread in
`DefaultLeaderElectionService` to ensure that they are not called in the main
thread when registering the `LeaderContender` in the `LeaderElectionService`.
The legacy implementations of `LeaderElectionDriver` already do this implicitly
because their leader election implementations run in a dedicated thread.
The MultipleComponentLeaderElection framework had to deal with this already.
I was implemented in `DefaultMultipleComponentLeaderElectionService` where a
singleThread executor service was utilized to ensure the order of grant and
revoke calls.
## Brief change log
* Renames `LeaderElectionEventHandler` methods to reflect the async nature
* Introduced additional asynchronous methods in `LeaderElectionEventHandler`
that enable the legacy `LeaderElectionDriver` implementations to not run
asynchronously. As mentioned before: These implementations have their event
calls already being executed in the implementations' dedicated event threads.
* Moved `leadershipOperationExecutor` from
`DefaultMultipleComponentLeaderElectionService` into
`DefaultLeaderElectionService`
## Verifying this change
* Added tests for non-blocking operations to `DefaultLeaderElectionTest`
* Existing tests were refactored and should still pass
## 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: yes
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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]