-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop auto-followers when resetting metadata #81290
Conversation
Pinging @elastic/es-distributed (Team:Distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
return; | ||
} | ||
final AutoFollowMetadata autoFollowMetadata = followerClusterState.getMetadata() | ||
.custom(AutoFollowMetadata.TYPE, AutoFollowMetadata.EMPTY); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we bail out early here if autoFollowMetadata.getPatterns().isEmpty() && this.autoFollowers.isEmpty()
? Since this runs on every cluster change it would be nice to have a bail out.
|
||
// then auto-followers are removed | ||
assertThat(newAutoFollowers.entrySet(), empty()); | ||
// and remotes are stopped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// and remotes are stopped | |
// and auto-followers are stopped |
ClusterState clusterState = ClusterState.builder(new ClusterName("remote")).build(); | ||
autoFollowCoordinator.updateAutoFollowers(clusterState); | ||
var autoFollowCoordinator = createAutoFollowCoordinator(); | ||
autoFollowCoordinator.updateAutoFollowers(createClusterStateWith(null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps randomly choose null
or Map.of()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already another test case that checks transition from non empty to empty map.
@elasticmachine run elasticsearch-ci/bwc |
💔 Backport failed
You can use sqren/backport to manually backport by running |
(cherry picked from commit bdc1b73)
This change ensures auto-followers are stopped if auto-follow metadata is reverted back to null after some non-empty state.
Fixes #81242 (though will not happen until #81247 is fixed)