RedisShake icon indicating copy to clipboard operation
RedisShake copied to clipboard

Skip Selects when Destination is cluster Redis

Open AbhishekRana23 opened this issue 11 months ago • 2 comments

When Syncing from Standalone Redis to Cluster Redis. if there is a select and set on the source redis, Redis-shake copies it to the destination irrespective of destination being cluster redis or not. Currently if such a situation arise syncing is stopped with this error:

2024-02-26 06:25:57 INF not set status port 2024-02-26 06:25:57 INF start syncing... 2024-02-26 06:25:57 ERR [writer_10.60.45.25_6379] receive reply failed. cmd=[select 2], error=[ERR SELECT is not allowed in cluster mode] RedisShake/internal/writer/redis_standalone_writer.go:111 -> (*redisStandaloneWriter).processReply()runtime/asm_amd64.s:1598 -> goexit()

After these changes if destination is cluster, we won't change the dbId, instead directly run the respective command if destinaiton is a cluster.

AbhishekRana23 avatar Feb 26 '24 06:02 AbhishekRana23

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Feb 26 '24 06:02 CLAassistant

RedisShake should panic instead of directly writing data from the other databses to db0, as this could lead to data corruption. The lua function feature can meet your needs.

suxb201 avatar Mar 05 '24 11:03 suxb201