Xline
Xline copied to clipboard
[Bug]: requests in a single txn do not execute in sequence
The operations in a single txn should be executed sequentially. However in Xline, we don't check for conflicts inside a single txn, all commands result are based on the storage state before the txn is exected. This behaviour is inconsistent with etcd.
Background
We have two stage execute
and after_sync
, however during a multi-request txn execution of these two stage, one executing child request does not see the effect of a previous executed child request.
Solution
To resolve this issue, an extra state during these stages is required. Let's call it TxnState
. We create this temporary state every time when execting a txn request. For a put and delete_range request, we update the TxnState, and for a range or compare, we read from both the TxnState and current storage, and use the merged result for the request.