-
Notifications
You must be signed in to change notification settings - Fork 717
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
多次使用redisk-shake进行同步时,list类型的值会被append而不是rewrite #921
Comments
你要区分 list 类型的 key 是在 rdb 中还是 aof 中。在 aof 中的话只能是 append。 |
当使用sync_reader和redis_writer的时候,有一个list结构 |
@lvxiaorun 不合预期,可能操作出问题了。 |
|
不合预期,期望结果 1,默认配置下会报错才对。 |
你说这个参数吗 |
都会用到 RDBRestoreCommandBehavior |
我是基于这个提交的代码看的 |
你全局搜下 redis_standalone_writer.go 中也用到了 |
额,被这个 PR 改掉了:9527b04#diff-72fe41df5b33ac373ada8ec95dd77a10763f67cdad644c8e4f07be47c225edd5L160 |
是的 这个我之前就看到了
|
嗯 明白了 感谢 |
看了一下这个PR,结合当前代码,针对类似于list、hash、zset等类型,我想在Rewrite之前,在Entry管道里面放入删除整个key的命令,以保证跟这个PR之前的行为一致,请教你一下这个的合理性以及可行性 @suxb201 |
@lvxiaorun 其实可以直接 restore 命令带上 rewrite 参数,也就是回滚那个 PR 的内容。我不记得当时为啥去掉 restore 逻辑了。 |
嗯 我前面的想法就是想保留这个PR的内容,因为这个看起来针对对一些大对象,还是可以节省不少内存占用的 |
那 del 也合理的,受 RDBRestoreCommandBehavior 参数控制好了,如果是 rewrite 就额外发一个 del |
嗯 感谢 我尝试写一个PR |
我在list的Rewrite方法里面加上了这一行
基于我之前的场景测试了一下结果符合预期 然后我打算在types下面的除了string类型的其他类型(包括hash、list、mobbloom、set、stream、tairhash、tairzset、zset)都这么操作,会带来其他问题吗? |
@lvxiaorun 应该没问题 |
有空看下我的RP,感谢 @suxb201 |
如题,这个rewrite https://github.com/tair-opensource/RedisShake/blob/v4/internal/rdb/rdb.go#L205 方法,刚redis的类型为list时,会不是rewrite的行为,而是append
The text was updated successfully, but these errors were encountered: