Skip to content

Conversation

@pingyu
Copy link
Collaborator

@pingyu pingyu commented Jan 21, 2026

Changes

  • Add public TransactionClient::scan_locks and TransactionClient::resolve_locks for externally-driven lock cleanup (src/transaction/client.rs:300, src/transaction/client.rs:322).
  • Add keyspace encoding for Vec<LockInfo> so locks returned/truncated by scan_locks can be re-encoded before resolving (src/request/keyspace.rs:185).
  • Reuse plan-layer gRPC classification (src/request/plan.rs:91) and harden ResolveLock retries with backoff + cache invalidation (src/transaction/lock.rs:145).
  • Add coverage for retry + “resolve committed even if TTL not expired” (src/transaction/lock.rs:626, src/transaction/lock.rs:674) and an integration failpoint test for the new API (tests/failpoint_tests.rs:287).

Compare with Go implementation by LLM:

  • Rust resolve_locks (src/transaction/lock.rs:51) follows the same non-async, non-pessimistic flow: CheckTxnStatus per txn, then ResolveLock per txn+region with per-txn commit-version + cleaned-region caching
    (mirrors Go’s cleanTxns).
  • ResolveLock retry behavior (src/transaction/lock.rs:145) now matches Go’s resolveLock loop more closely: backoff-based retries, region-error handling via handle_region_error, plus region/store cache invalidation on leader/grpc issues.
  • Expected deltas (out of scope per request): pessimistic-lock + async-commit resolving, resolve-lock-lite, and Rust returning “live locks + caller backoff” instead of Go’s TTL return.

@ti-chi-bot ti-chi-bot bot added dco-signoff: yes Indicates the PR's author has signed the dco. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 21, 2026
pingyu added 10 commits January 21, 2026 12:06
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
 

Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
@pingyu pingyu force-pushed the txn-resolve-lock-m branch from ea57fdd to 9b9e80a Compare January 21, 2026 04:07
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jan 21, 2026
@ti-chi-bot ti-chi-bot bot added the lgtm label Jan 21, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 21, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: coocood, iosmanthus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jan 21, 2026
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jan 21, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-01-21 05:53:33.306366025 +0000 UTC m=+559640.920322871: ☑️ agreed by coocood.
  • 2026-01-21 09:55:54.507534085 +0000 UTC m=+574182.121490941: ☑️ agreed by iosmanthus.

@ti-chi-bot ti-chi-bot bot merged commit c2e2216 into tikv:master Jan 21, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants