You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 toexecute
indo_serializable
.The text was updated successfully, but these errors were encountered: