After CLUSTER SETSLOT <slot> NODE <destination-node-id> command at dest node, src node is becoming replica of dest node #12202
Unanswered
SreedharReddyKallu
asked this question in
Q&A
Replies: 1 comment
-
redis_version:6.2.6 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When resharding all slots of a srcNode, once last slot is assigned to destNode using setslot NODE , src node becoming replica of destNode.
To make it simple tried to replicate the scenario using 2 nodes.
I have cluster with 2 nodes
127.0.0.1:7003> cluster nodes
b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac 127.0.0.1:7002@17002 master - 0 1684489466284 3 connected 0-16383
535c4c60b656843cd28553f1cce65bc96882fb29 127.0.0.1:7003@17003 myself,master - 0 0 2 connected
Using CLUSTER SETSLOT slot <IMPORTING node-id | MIGRATING node-id | NODE node-id | STABLE> commands assigned slot 0 to redis node running on port 7003.
127.0.0.1:7003> cluster nodes
b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac 127.0.0.1:7002@17002 master - 0 1684489618012 3 connected 1-16383
535c4c60b656843cd28553f1cce65bc96882fb29 127.0.0.1:7003@17003 myself,master - 0 0 4 connected 0
post that ran below commands sequentially
./redis-cli -c -p 7002 cluster setslot 0 importing 535c4c60b656843cd28553f1cce65bc96882fb29
./redis-cli -c -p 7003 cluster setslot 0 migrating b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac
./redis-cli -c -p 7002 cluster setslot 0 node b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac
And when I ran ./redis-cli -c -p 7003 cluster setslot 0 node b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac command got the
(error) ERR Please use SETSLOT only with masters. error
below is the cluster nodes command response
./redis-cli -c -p 7003 cluster nodes
b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac 127.0.0.1:7002@17002 master - 0 1684490262416 5 connected 0-16383
535c4c60b656843cd28553f1cce65bc96882fb29 127.0.0.1:7003@17003 myself,slave b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac 0 0 5 connected
Configuration change detected. Reconfiguring myself as a replica of b6db249f95ea6c4e8e2d9e1aa1d888fbb49434ac
Before turning into a replica, using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
Connecting to MASTER 127.0.0.1:7002
MASTER <-> REPLICA sync started
Non blocking connect for SYNC fired the event.
Master replied to PING, replication can continue...
Trying a partial resynchronization (request bdf33b03051d81d681b87c9adc4ef91e7adaca4a:281).
Full resync from master: b53ebe093c8ff4ad1a3449488484c934ff122707:280
Discarding previously cached master state.
MASTER <-> REPLICA sync: receiving 176 bytes from master to disk
MASTER <-> REPLICA sync: Flushing old data
MASTER <-> REPLICA sync: Loading DB in memory
Loading RDB produced by version 6.2.6
RDB age 0 seconds
RDB memory usage when created 2.61 Mb
Done loading RDB, keys loaded: 0, keys expired: 0.
MASTER <-> REPLICA sync: Finished with success
Background append only file rewriting started by pid 83722
AOF rewrite child asks to stop sending diffs.
Parent agreed to stop sending diffs. Finalizing AOF...
Concatenating 0.00 MB of AOF diff received from parent.
SYNC append only file rewrite performed
Background AOF rewrite terminated with success
Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
Background AOF rewrite finished successfully
How can I avoid this and leave dest node as master without any slots?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions