Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: introduce IndeterminateCommitError and RecoverTxnRequest
This PR polishes off the recovery mechanism from #35165 and gets it into a reviewable state. The mechanism comes in three main parts. The first is the addition of a new STAGING transaction status. This status is not reachable yet through standard KV requests, but it triggers parallel commit recovery and is injected in tests. The next part is related to `PushTxn`, which is used both in concurrency control and garbage collection. Pushing a STAGING transaction acts as expected if the push fails. However, if the push succeeds, it is not allowed to directly modify the STAGING transaction record. Instead, it now returns a new `IndeterminateCommitError`. This error is captured by a store and triggers a new transaction recovery mechanism, which is the third part of this change. The transaction recovery mechanism queries all of the STAGING transaction's in-flight writes using QueryIntent(IfMissing=PREVENT) requests. The process then passes whether or not it found all declared writes to a new RecoverTxnRequest that takes care of recovering the transaction record from the STAGING state to either a COMMITTED or ABORTED state. Take a look at `txn_recovery_integration_test.go` for a end-to-end integration test of this recovery mechanism. Release note: None
- Loading branch information