Skip to content
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

rabbit_feature_flags: Use cluster members hint for cluster sync #8477

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

dumbbell
Copy link
Member

@dumbbell dumbbell commented Jun 5, 2023

Why

During peer discovery, when the feature flags state is synchronized on a starting node that joins a cluster thanks to peer discovery, the list of nodes returned by rabbit_nodes:list_running() is incorrect because Mnesia is not initiliazed yet.

Because of that, the synchronization works on the wrong inventory of feature flags. In the end, the states of feature flags is incorrect across the cluster.

How

rabbit_mnesia passes a list of nodes to rabbit_feature_flags:sync_feature_flags_with_cluster/2. We can use this list, as we did in feature flags V1. This makes sure that the synchronization works with a valid list of cluster members, in case the cluster state is not ready yet.

@dumbbell dumbbell added this to the 3.13.0 milestone Jun 5, 2023
@dumbbell dumbbell requested a review from dcorbacho June 5, 2023 10:10
@dumbbell dumbbell self-assigned this Jun 5, 2023
@dumbbell dumbbell force-pushed the use-cluster-members-hint-in-ff-cluster-sync branch from 4670182 to 909a46f Compare June 5, 2023 10:47
[Why]
During peer discovery, when the feature flags state is synchronized on a
starting node that joins a cluster thanks to peer discovery, the list of
nodes returned by `rabbit_nodes:list_running()` is incorrect because
Mnesia is not initiliazed yet.

Because of that, the synchronization works on the wrong inventory of
feature flags. In the end, the states of feature flags is incorrect
across the cluster.

[How]
`rabbit_mnesia` passes a list of nodes to
`rabbit_feature_flags:sync_feature_flags_with_cluster/2`. We can use
this list, as we did in feature flags V1. This makes sure that the
synchronization works with a valid list of cluster members, in case the
cluster state is not ready yet.

V2: Filter the given list of nodes to only keep those where `rabbit` is
    running. This avoids trying to collect inventory from nodes which
    are stopped.
@dumbbell dumbbell force-pushed the use-cluster-members-hint-in-ff-cluster-sync branch from 9949205 to 7c53958 Compare June 5, 2023 11:46
@dumbbell dumbbell marked this pull request as ready for review June 5, 2023 14:35
@dumbbell dumbbell merged commit ee8bd62 into main Jun 5, 2023
@dumbbell dumbbell deleted the use-cluster-members-hint-in-ff-cluster-sync branch June 5, 2023 14:36
dumbbell added a commit that referenced this pull request Jun 6, 2023
rabbit_feature_flags: Use cluster members hint for cluster sync (backport #8477)
dumbbell added a commit that referenced this pull request Jun 6, 2023
rabbit_feature_flags: Use cluster members hint for cluster sync (backport #8477) (backport #8479)
michaelklishin added a commit that referenced this pull request Jun 20, 2023
michaelklishin added a commit that referenced this pull request Jun 20, 2023
(cherry picked from commit c76eaaa)
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