list 改进 #128
dingxiaoshuai123
started this conversation in
Ideas
list 改进
#128
Replies: 2 comments
-
进行 mset/hmset 导致数据不一致的问题:OpenAtomFoundation/pikiwidb#1658 |
Beta Was this translation helpful? Give feedback.
0 replies
-
解决方法: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
1月15日 , 对话如下:

@denghao :现有的list实现 是用meta key给list val派发一个index 且在后续的逻辑中 所有的list val按index排序 中间不允许出现空洞 假设我们允许出现空洞 将rpush命令改造成 pkrpush key val index 从库收到这个命令后更新自己的meta key并set val 主库在重放的时候校验当前meta key中的index和命令中的index 是否可以解决幂等的问题
@denghao :这样改造 list 的核心命令如 push pop 不会有变化。将 list 当成 zset 玩。
@KKorpse : list 在什么场景下会出现不一致?
@denghao : 重放 binlog 会出现不幂等的问题。
@denghao :insert和rem这两个操作中间元素的命令都干掉 似乎还可以让index保持没有空洞
@denghao :只要同key的命令是严格的串行执行的 那就可以用index的单调性来搞幂等
@denghao : 重放binlog还需要暂时忽略key的过期时间 说不定后面有一个命令是给这个key续命的
Beta Was this translation helpful? Give feedback.
All reactions