Skip to content

feat(txnkv): batch lock resolution and cache resolved transaction statuses (#428) - #766

Merged
s2x merged 5 commits into
masterfrom
feat/428-batch-lock-resolution
Oct 24, 2026
Merged

s2x merged 5 commits into
masterfrom
feat/428-batch-lock-resolution

Conversation

@s2x

@s2x s2x commented Oct 24, 2026

Copy link
Copy Markdown
Member

Closes #428.

Summary

  • New 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 per TxnKvClient, shared by its transactions. The next lock of a known transaction skips KvCheckTxnStatus. A live, pessimistic or undetermined status is never cached.
  • New LockResolver::resolveLocks(): groups locks by transaction and region and sends one KvResolveLock per (region, transaction) with all its keys.
  • TxnReader uses batch resolution for batchGet() and scan() responses that carry several locks.
  • Tests: cache unit tests, batch resolution tests for batchGet() and scan(), and an async-commit cache-hit test.
  • CHANGELOG ### Added and 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 lint
  • composer test:unit (1999 tests)
  • composer test:grpc (321 tests; the 1 warning also occurs on master)
  • E2E in CI (local Docker is not available)

@s2x s2x self-assigned this Oct 24, 2026
@s2x
s2x merged commit 7caaa56 into master Oct 24, 2026
11 checks passed
@s2x
s2x deleted the feat/428-batch-lock-resolution branch October 24, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GAP-14] Batch lock resolution and cache resolved transaction statuses

1 participant