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

compaction TTL sync #1

Open
dongdongwcpp opened this issue Mar 9, 2023 · 0 comments
Open

compaction TTL sync #1

dongdongwcpp opened this issue Mar 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dongdongwcpp
Copy link
Contributor

dongdongwcpp commented Mar 9, 2023

问题描述:

在基于raft 同步的rocksdb存储中,由于compaction调度时机不一致,导致leader/follower间数据不一致,但人们使用raft一致性算法普遍认为各个副本间数据是一致的,这与我们的直觉相悖。
下图展示了这种不一致发生的时机:
image
1.leader接受客户端写入x+=10,并将ttl续到20,leader很正常地完成了工作,此时x=11
2.在follower上,由于网络延迟,重启回放,commit->apply的时延,导致x在compaction时因TTL expired删掉了
3.而后apply oplog时,follower中x=10,leader/follower永久不一致了。

在基于主备binlog同步的机制中,也有类似问题,在kvrocks中:
image

解决方案:

image

@dongdongwcpp dongdongwcpp added the enhancement New feature or request label Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant