Check target node is a primary during cluster setslot.#10277
Merged
Conversation
Contributor
|
I realized that this came up in the past, #9360, and I thought that we shouldn't add any check here because during slot migration a single node might not "know" the state of another node so it should be okay to force its state. I was probably wrong, if we get an error here it just means that the node will learn about the state more slowly. |
madolson
approved these changes
Feb 11, 2022
madolson
left a comment
Contributor
There was a problem hiding this comment.
https://github.com/redis/redis/actions/runs/1827809694 <- Merging after this succeeds.
Contributor
|
Also apparently this is a duplicate of #7424. |
Contributor
|
Since this as administration command, don't think we need to backport, but we can callout that it's safer now in 7. |
Contributor
|
For reference, this was also done already in #3450 (though it was mixed with other changes). |
Merged
This file contains hidden or 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
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.
A replica can't own a slot, only primaries can own the slot. Hence, we need to disable the slot transfer from a primary to a replica.
Verify if the target node is a primary during
cluster setslot <slot> NODE <id>Before the change
After the change