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

Can txn read future data? #103

Closed
crwen opened this issue Aug 21, 2024 · 3 comments · Fixed by #106
Closed

Can txn read future data? #103

crwen opened this issue Aug 21, 2024 · 3 comments · Fixed by #106
Labels
question Further information is requested

Comments

@crwen
Copy link
Contributor

crwen commented Aug 21, 2024

Question

Before asking a question, make sure you have:

  • Reviewed relevant Rust information: Google your error messages and look at official docs.
  • Searched open and closed GitHub issues

I know txn can not write future data, but can it read future data?

let txn = db.transaction().await;

let mut txn_future = db.transaction().await;
txn_future.insert("1");
txn_future.commit().await.unwrap();

// can txn get "1" ?
txn.get("1").await.unwrap();
@ethe
Copy link
Member

ethe commented Aug 21, 2024

No, it can't.

@crwen
Copy link
Contributor Author

crwen commented Aug 21, 2024

So the MergeStream should add a read_ts field, so that it can skip those data with larger timestamps

if let Some(buf) = this.buf {
if buf.key().value == peeked.entry.key().value {
continue;
}
}

@ethe
Copy link
Member

ethe commented Aug 21, 2024

Yes, I think so.

@ethe ethe added the question Further information is requested label Aug 22, 2024
@KKould KKould linked a pull request Aug 22, 2024 that will close this issue
@ethe ethe closed this as completed in #106 Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants