Repository navigation
feat(txnkv): batch lock resolution and cache resolved transaction statuses (#428) - #766
Merged
Merged
Conversation
…-resolution # Conflicts: # CHANGELOG.md # docs/helpers/decisions.md # tests/Unit/TxnKv/TxnKvClientTest.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #428.
Summary
ResolvedTxnStatusCache: a bounded FIFO cache (2048 entries, as in client-go) of final transaction outcomes (committed with a commit ts, or rolled back), keyed by lock start ts. One cache perTxnKvClient, shared by its transactions. The next lock of a known transaction skipsKvCheckTxnStatus. A live, pessimistic or undetermined status is never cached.LockResolver::resolveLocks(): groups locks by transaction and region and sends oneKvResolveLockper (region, transaction) with all its keys.TxnReaderuses batch resolution forbatchGet()andscan()responses that carry several locks.batchGet()andscan(), and an async-commit cache-hit test.### Addedand docs.Follow-up candidate (not in this PR): client-go also caches a NoAction status with ttl=0 and commit=0; this PR does not.
Test plan
composer lintcomposer test:unit(1999 tests)composer test:grpc(321 tests; the 1 warning also occurs on master)