Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据迁移异常场景处理 #833

Closed
strongworker opened this issue Jun 18, 2024 · 4 comments
Closed

数据迁移异常场景处理 #833

strongworker opened this issue Jun 18, 2024 · 4 comments
Assignees
Labels
type: feature request New feature or request

Comments

@strongworker
Copy link

【说明】
RedisShake版本:v4.1.0

【迁移场景】
源Redis:任意部署架构
目标Redis:Redis Cluster 主备集群架构
操作:源Redis向目标Redis同步

【发生的问题】
目标Redis Cluster主备集群发生主从切换时,RedisShake会报错中断;
报错信息如下:
error=[MOVED xxx ip:port]\n\t\t\tRedisShake/internal/writer/redis_standalone_writer.go:116 -> (*redisStandaloneWriter).processReply()\n\t\t\truntime/asm_amd64.s:1598 -> goexit()"

【原因】(仅猜测)
RedisShake维护了slot与node的路由关系,当目标Redis发生主从切换时,写入操作可能连接从库操作,导致MOVED问题。

【希望兼容的点】
当发生MOVED问题时,希望RedisShake兼容,刷新路由信息,重试写入操作,而不是中断迁移,感谢!

@strongworker strongworker added the type: feature request New feature or request label Jun 18, 2024
@suxb201
Copy link
Member

suxb201 commented Jun 18, 2024

不建议长期运行 RedisShake,各种断连机制都不具备,短期运行的话这不是问题。

@strongworker
Copy link
Author

不建议长期运行 RedisShake,各种断连机制都不具备,短期运行的话这不是问题。

现在的场景是:大数据量迁移,快完成了,出现了这样的场景,要重新执行一遍,耗时太长了。

@suxb201
Copy link
Member

suxb201 commented Jun 25, 2024

@strongworker 后面会优化下集群的迁移性能,一次迁移应该几十分钟就可以搞定。或者可以提交 PR 优化下这种场景下 Shake 的逻辑。

或许也可以看看 @ikenchina 维护的 https://github.com/mgtv-tech/redis-GunYu 能不能解决问题,我看他们处理了集群拓扑变化的场景。

@ikenchina
Copy link

https://github.com/mgtv-tech/redis-GunYu
支持能够处理这种情况

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants