Shutdown QQ peer members on force-shrink-to-single-member execution to allow restoring QQ clusters on healthy nodes #12427
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Hi
This is a follow up to #12344 (bouncing off part of our approach to some DR scenarios in case of any unforeseen issues).
We rely on force-shrink commands to rescue QQ nodes in extreme disaster scenarios. Current behavior, when QQs are shrunk to a single node, connected peers keep their local FSMs running, which prevents re-growing the shrunk queues back onto connected nodes which would/could be in a healthy state. We expect peers to update their log to that of the leader on
grow
and/or the next received#append_entries_rpc{}
.Example, doing
force_all_queues_shrink_member_to_current_member/0
.At this point, the cluster can't be restored. i.e. queues cant regrow back to the rest of the cluster (even if they're healthy).
With this patch, if after disaster scenario, part of the cluster nodes are reachable and healthy, we are able to proceed with the re-growing the QQs back to healthy nodes without undergoing major recovery procedures, as follows:
This allows us to avoid unnecessarily doing major recovery procedures like complete wipe out of peers node and/or migrations and queue deletions/re-creation, etc, to restore the cluster. At this point of the cluster, the only other option is a complete re-deploy.
As part of this PR/proposal, we also introduce
force_vhost_queues_shrink_member_to_current_member/1
which allows us to force-shink all QQs on a per-vhost basis (which we need/use for some our shared cluster environments).Please take a look 😬
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.