RedisShake
RedisShake copied to clipboard
Skip Selects when Destination is cluster Redis
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.
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.