-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Reinit consensus #5265
Merged
Merged
Reinit consensus #5265
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generall
commented
Oct 20, 2024
Comment on lines
+796
to
+797
// ToDo: it seems like a mistake, need to check if it's correct | ||
// debug_assert!(first_unapplied_index <= first_entry.index); |
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.
This part need extra review
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.
I agree. I think this is only valid if we always compact all entries.
Doesn't it need to be like this?
Suggested change
// ToDo: it seems like a mistake, need to check if it's correct | |
// debug_assert!(first_unapplied_index <= first_entry.index); | |
debug_assert!(first_unapplied_index >= first_entry.index); |
timvisee
reviewed
Oct 29, 2024
timvisee
reviewed
Oct 29, 2024
timvisee
approved these changes
Oct 29, 2024
timvisee
pushed a commit
that referenced
this pull request
Nov 8, 2024
* option to clear consensus state while preserving peer id * compact or clear consensus WAL on re-init * Add test on reinit * minor changes * more points check suggestion --------- Co-authored-by: tellet-q <elena.dubrovina@qdrant.com>
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds an ability to re-initialize consensus for existing cluster, while keeping the data intact.
This might be useful in cases, when we need to make a copy of the existing cluster, but this new cluster should have all URLs different. It is impossible to do with existing consensus, as the URL change is consensus operation, which requires quorum to be applied.
How to use
reinit
This PR adds a new
--reinit
flag to the CLI arguments, which changes the logic on consensus loading.Correct usage of the
--reinit
flag is the following:--reinit --uri <NEW-URI>
.--reinit --bootstrap <FIRST-PEER-NEW-URL> --uri <NEW-URI>
Use
--reinit
only once per peer, don't use it for further launches.How this change works
There are 2 logic paths for reinit, one for the first peer, and the second for the bootstrapped peer.
For the first peer:
For bootstrapped peers:
peer_id
. Peer ID is needed to preserve shards topology.Test scenario used:
63{3,4}5
)6435
and--reinit
param6445
and--reinit
param and bootstrap param pointed to6435