OpenAtomFoundation / pikiwidb

a high-performance, large-capacity, multi-tenant, data-persistent, strong data consistency based on raft, Redis-compatible elastic KV data storage system based on RocksDB
BSD 3-Clause "New" or "Revised" License
194 stars 63 forks source link

4-16 周计划 #281

Closed dingxiaoshuai123 closed 4 months ago

dingxiaoshuai123 commented 4 months ago

待解决问题 : 1, 一个 Rocksdb 有多个 CF, 每一个 CF 会维护两个变量: Flushed Log Index 和 Applied Log Index. 日志的截断点为当前所有 CF 的 min Flushed Log Index. 当一个 CF 的 Flushed Log Index 一直没有更新, 会导致日志截断点也无法更新. (有更好方法或者有问题请直接指出.) a, 设置步长为 1, 通过对比 Flushed Log Index 和 Applied Log Index 可以判断出该 CF 是否有数据. b, 步长不为 1, 在 Flush completed 时 和 更新 Applied Log Index 时保存精确的 SequenceNumber 判断该 CF 是否有数据. 每次寻找最小 Flushed Log Index 时, 对于有数据的 CF , 找出其中最小的 Flushed Log Index. 对于没有数据的 CF , 更新其 Flushed Log Index 和 Applied Log Index 为找出的最小的 Flushed Log Index.

2,所有 DB 使用同一个 raft 集群, 如何找到回放点 对于多 CF 的情况, 是对所有 CF 回放点进行聚合, 多 RocksDB 的情况也是对多个Rocksdb 回放点进行聚合. 多 DB 暂时可采用相同方法.

3,当 CF 很旧的情况下,保存的 Applied Log Index 明显很小。在互相重启时就会把 Min Applied Log Index 拉得很低,这个值可能就是错的。

Issues-translate-bot commented 4 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 4-16 Weekly Plan