Skip to content

compaction TTL sync #1

@dongdongwcpp

Description

@dongdongwcpp

问题描述:

在基于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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions