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

[Bug]: Read different values in execute during read state #501

Closed
bsbds opened this issue Nov 2, 2023 · 1 comment
Closed

[Bug]: Read different values in execute during read state #501

bsbds opened this issue Nov 2, 2023 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@bsbds
Copy link
Collaborator

bsbds commented Nov 2, 2023

Description

In read state, after the wait for cmd ids or log index are completed, we directly read from the current storage. However, I find that if there's multiple reads for a same key in a txn request, it might read different values.

The root cause of this is that duing serializable read there might be other commands being executed on the same server. And one txn may read the storage multiple times. Thus will lead to inconsistency in a single txn.

Solution

When we do read operations in a txn request, we specify a read_revision for reads. When we execute a range request, we use the same read_revision to read the result. Thus this can gaurentee that we can read the same value for the same key.

Details

To obtain the read_revision. We need let the barriers return the revision of that command we waited, and pass it to execute in do_serializable.

@Phoenix500526 Phoenix500526 added the bug Something isn't working label Nov 10, 2023
@bsbds bsbds added this to the v0.7.0 milestone Nov 22, 2023
@Phoenix500526
Copy link
Collaborator

Closed in #857

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants