Check target node is a primary during cluster setslot.#10277
Check target node is a primary during cluster setslot.#10277madolson merged 1 commit intoredis:unstablefrom
Conversation
|
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
left a comment
There was a problem hiding this comment.
https://github.com/redis/redis/actions/runs/1827809694 <- Merging after this succeeds.
|
Also apparently this is a duplicate of #7424. |
|
Since this as administration command, don't think we need to backport, but we can callout that it's safer now in 7. |
|
For reference, this was also done already in #3450 (though it was mixed with other changes). |
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