-1

I just wondering this context.

In Redis Cluster, redis-cli(start cluster mode, like redis-cli -c ) request key to slave that redis-cli connection with redis in READONLY mode.

If the slave have not key of master key (this means not yet sync), Then Can redis-cli cluster mode redirect to master that have key? Or redis cluster response "(nil)"?

b_dobee
  • 19
  • 1
  • 9

1 Answers1

1

If the connection to slave is in READONLY mode, any read-only command will be served by the slave, and won't be redirect to master.

In your case, i.e. getting a key which belongs to a slot owned by its master, but the key hasn't been synced to slave, the slave will return nil response directly.

for_stack
  • 21,012
  • 4
  • 35
  • 48
  • thanks, but your answer is missing about `redis-cli cluster mode and READONLY`. In cluster mode, redis cluster some nodes can redirect to master node that user request key. but, In Cluster mode and READONLY mode, If slave have no key (not synced from master), what happened? – b_dobee Mar 29 '18 at 01:30
  • I didn't miss anything you mentioned. Please read the answer again :) Short answer: the slave won't redirect the request. – for_stack Mar 29 '18 at 02:24
  • Thank you, I was misunderstanding. – b_dobee Mar 29 '18 at 06:03