Skip to content

Conversation

@XComp
Copy link
Contributor

@XComp XComp commented Feb 1, 2023

LeaderElectionEventHandler.onLeaderInformationChange should only be called if the handler (i.e. DefaultLeaderElectionService) is actually the leader. This check is already implemented in the corresponding calling methods of the MultipleComponentLeaderElectionDriver implementations. But these methods only schedule the logic rather than executing it right away. The execution is handled in a separate thread (i.e. DefaultMultipleComponentLeaderElectionService#leadershipOperationExecutor). That might create a race condition if a leader change is queued up already but not performed, yet, before the leader information change event gets queued up as well.

1.16 backport PR of parent PR #21537

…he leadership is still acquired

LeaderElectionEventHandler.onLeaderInformationChange should only be called
if the handler (i.e. DefaultLeaderElectionService) is actually the leader.
This check is already implemented in the corresponding calling methods of the
MultipleComponentLeaderElectionDriver implementations. But these methods only
schedule the logic rather than executing it right away. The execution is handled
in a separate thread (i.e. DefaultMultipleComponentLeaderElectionService#leadershipOperationExecutor).
That might create a race condition if a leader change is queued up already
but not performed, yet, before the leader information change event gets queued
up as well.

Signed-off-by: Matthias Pohl <matthias.pohl@aiven.io>
@XComp XComp changed the title [FLINK-30474][runtime] Propagates leader information change only if the leadership is still acquired [BP-1.16][FLINK-30474][runtime] Propagates leader information change only if the leadership is still acquired Feb 1, 2023
@flinkbot
Copy link
Collaborator

flinkbot commented Feb 1, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants