Skip to content

Added additional validation for cluster SETSLOT#9360

Merged
madolson merged 1 commit intoredis:unstablefrom
madolson:cluster-setslot-validation
Aug 12, 2021
Merged

Added additional validation for cluster SETSLOT#9360
madolson merged 1 commit intoredis:unstablefrom
madolson:cluster-setslot-validation

Conversation

@madolson
Copy link
Contributor

Redis cluster SETSLOT [importing|migrating] is intended to migrate data from one primary to another. In this case these two nodes should agree that each other are primaries before continuing. This just adds another layer of validation so that end users get the error sooner that they may have copied the wrong node ID.

Follow up from #3450 (comment).

Note the other PR also had a FIX for SETSLOT node which you may call by default across the entire cluster to force acknowledging ownership of a slot, and someone might not know the state.

@madolson madolson merged commit 0cf2df8 into redis:unstable Aug 12, 2021
JackieXie168 pushed a commit to JackieXie168/redis that referenced this pull request Sep 8, 2021
@enjoy-binbin
Copy link
Contributor

enjoy-binbin commented Sep 11, 2023

This just adds another layer of validation so that end users get the error sooner that they may have copied the wrong node ID.

Do we need to make the same changes to ADDSLOTS / DELSLOTS? These commands should only work on the primary.
in replica, the final slot ownership will be gossip from the master, so it seems to be no effect in using it in a replica
and FLUSHSLOTS?

edit: oops, sorry, i just realize this is what #12282 does

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.

3 participants