agatedb icon indicating copy to clipboard operation
agatedb copied to clipboard

Transaction 的 set(key,value) 不会增加版本号,当前进程读取是新数据,关闭进程后重新读取就会读取旧数据

Open gcxfd opened this issue 1 year ago • 3 comments

Transaction 的 set(key,value) 不会增加版本号,当前进程读取是新数据,关闭进程后重新读取就会读取旧数据

读取都是用的

pub fn get(&self, key: impl Into<BytesMut>) -> Result<Value> {
    let key = key_with_ts(key.into(), std::u64::MAX);
    self.core.get(&key)
}

gcxfd avatar Jul 07 '22 07:07 gcxfd

经过研究发现,是因为CommitInfo default的时候 next_txn_ts 总是为0导致的 每次启动进程都是从version 0开始设置

gcxfd avatar Jul 07 '22 08:07 gcxfd

经过研究发现,是因为CommitInfo default的时候 next_txn_ts 总是为0导致的 每次启动进程都是从version 0开始设置

next_txn_ts should be updated when opening the DB, but the logic has not been added yet.

GanZiheng avatar Jul 07 '22 08:07 GanZiheng

Please use english since this is a global community. Thanks.

zhangjinpeng87 avatar Jul 11 '22 13:07 zhangjinpeng87