Skip to content

rabbit_db_cluster: Check rabbit is stopped in forget_node() #8829

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

Merged

Conversation

dumbbell
Copy link
Collaborator

@dumbbell dumbbell commented Jul 11, 2023

Why

rabbit_mnesia indirectly checks that rabbit is stopped on the remote node because mnesia:del_table_copy() requires that Mnesia is stopped to delete the schema. However, this is not specific to Mnesia and we want rabbit to be stopped when we use Khepri in the future.

How

We use rabbit:is_running(Node) to query the status of RabbitMQ on the remote node to forget. This is not atomic so there is a small chance that RabbitMQ is restarted between the check and the actual forget.

Note: rabbit_mnesia also removes some queues and emit a "left cluster" event after a successful forget. However, this part was not moved because other parts of the module rely on this in RPC calls. To keep nodes compatibles, the calls are left in place. They will be duplicated for Khepri.

@dumbbell dumbbell added this to the 3.13.0 milestone Jul 11, 2023
@dumbbell dumbbell self-assigned this Jul 11, 2023
@dumbbell dumbbell force-pushed the move-forget_cluster_node-generic-steps-to-rabbit_db_cluster branch from 2f7474d to 0b03f95 Compare July 11, 2023 13:37
[Why]
`rabbit_mnesia` indirectly checks that `rabbit` is stopped on the remote
node because `mnesia:del_table_copy()` requires that Mnesia is stopped
to delete the schema. However, this is not specific to Mnesia and we
want `rabbit` to be stopped when we use Khepri in the future.

[How]
We use `rabbit:is_running(Node)` to query the status of RabbitMQ on the
remote node to forget. This is not atomic so there is a small chance
that RabbitMQ is restarted between the check and the actual forget.

Note: `rabbit_mnesia` also removes some queues and emit a "left cluster"
event after a successful forget. However, this part was not moved
because other parts of the module rely on this in RPC calls. To keep
nodes compatibles, the calls are left in place. They will be duplicated
for Khepri.
@dumbbell dumbbell force-pushed the move-forget_cluster_node-generic-steps-to-rabbit_db_cluster branch from 0b03f95 to 95449bd Compare July 11, 2023 14:50
@dumbbell dumbbell changed the title rabbit_db_cluster: Move forget_node() generic steps from rabbit_mnesia rabbit_db_cluster: Check rabbit is stopped in forget_node() Jul 11, 2023
@dumbbell dumbbell marked this pull request as ready for review July 11, 2023 15:13
@dumbbell dumbbell merged commit 7037c88 into main Jul 11, 2023
@dumbbell dumbbell deleted the move-forget_cluster_node-generic-steps-to-rabbit_db_cluster branch July 11, 2023 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant