-
Notifications
You must be signed in to change notification settings - Fork 725
是否可以过滤掉由于过期产生的DEL命令? #943
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
Comments
在切换前停掉 shake 即可,业务都已经在读写集群 B 了,集群 A 也没有写流量不应该继续保持同步连接。 |
感谢你的方案,我们会着重考虑;还想请问下用scan同步模式可能规避掉这个情况吗? |
没有了,我也只想到这一种方案。 |
如果你说的这个key1是分布式锁,问题就大了吧。 |
@hgaong 是的,需要立马停止同步或者采用其他方式阻断同步过来的删除 |
@suxb201 针对这个场景,如果我们可以区分开由于过期导致的DEL命令和业务实际使用的DEl命令(使用不同的大小写),再加上我们redisShake的部分改造好像可以完成这个需求 |
因为看Shake的代码,把cmd执行了一下改大写的操作,无法从大小写上区分 |
请描述你的功能性建议。清晰地说明你希望添加或改进的功能,并尽可能提供详细的信息。
Please describe your feature request. Clearly state the functionality you would like to add or improve and provide as much detail as possible.
源集群:集群A
目标集群:集群B
场景:集群A里面有一个key1,过期时间是10秒,10秒后,主节点会生成一个DEL命令发送到从库,删除这个key1,这个删除动作也会记录在从库的AOF文件中,如果此时我们完成了切换,业务应用由集群A切换到了集群B,并在集群B里面更新了这个key1的TTL时间,增加了10秒,RedisShake还在同步的时候,获取到这个DEL命令,就会把这个集群B里面的key删除掉,这个可以通过我们的RedisShake规避掉这个问题吗?
The text was updated successfully, but these errors were encountered: