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
195 stars 62 forks source link

snapshot bug #385

Closed dingxiaoshuai123 closed 1 month ago

dingxiaoshuai123 commented 1 month ago

1、如果当前 log index 为 5,config {a, b, c} 按照当前逻辑,当产生 snapshot 的时候只会产生 meta data :last_log_index = 5 (先忽略 term ), config {a, b, c} 。 2、进行了成员变更 {a, b, c} -> {b, c, d} 3、继续写入数据 log index 变为了 10 。 4、此时又进入一个节点(或者其他原因导致)要使用快照进行全量复制,那么此时才会真正产生 snaoshot,并更新 meta data 。将 meta data 更新为了 10 ,config , {a, b, c}。并且从 logindex 为 10 开始继续复制,那么就将跳过成员变更的日志,新节点的 config 是错误。

// 不确定之后是否能够随着日志复制纠正过来。