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

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

Open
gcxfd opened this issue Jul 7, 2022 · 3 comments

Comments

@gcxfd
Copy link
Contributor

gcxfd commented Jul 7, 2022

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 gcxfd changed the title managed Transaction 的 set(key,value) 不会增加版本号,当前进程读取是新数据,关闭进程后重新读取就会读取旧数据 Transaction 的 set(key,value) 不会增加版本号,当前进程读取是新数据,关闭进程后重新读取就会读取旧数据 Jul 7, 2022
@gcxfd
Copy link
Contributor Author

gcxfd commented Jul 7, 2022

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

@GanZiheng
Copy link
Contributor

经过研究发现,是因为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.

@zhangjinpeng87
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants