Repository navigation
perf(lockservice): avoid txn overview builds for active txn checks - #25509
Merged
XuPeng-SH merged 4 commits intoJul 7, 2026
Merged
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
approved these changes
Jul 7, 2026
XuPeng-SH
left a comment
Contributor
There was a problem hiding this comment.
LGTM. The new CheckActiveTxn point-check path, old-peer fallback to GetActiveTxn, and the IterTxnIDs lock-avoidance path all look sound to me, and the targeted tests cover the important compatibility path.
1 task done
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…atrixorigin#25509) ## What type of PR is this? - [x] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#25279 ## What this PR does / why we need it: This PR reduces the cost of lockservice active transaction validation paths involved in remote `validTxn` checks. - Add a `CheckActiveTxn` lockservice RPC for point lookup by `ServiceID` and `TxnID`. - Keep `GetActiveTxn` as the full active txn ID listing API for existing list consumers. - Use `CheckActiveTxn` in remote `validTxn`, with fallback to `GetActiveTxn` when the peer does not support the new method. - Add `TxnClient.IterTxnIDs` so lockservice `TxnIterFunc` can enumerate txn IDs without building `TxnOverview` or copying wait-lock state. - Keep callback execution outside internal txn-client locks. - Add focused coverage for `IterTxnIDs` and `CheckActiveTxn` handler behavior. Validation: ```sh go test -race -count=1 -timeout 180s ./pkg/txn/client go test -count=1 -timeout 120s ./pkg/cnservice go test -count=1 -timeout 120s -run 'TestHandleCheckActiveTxn|TestGetActiveTxnWithRemote|TestCannotCommit|TestValidTxn|TestCheckTxnTimeout' ./pkg/lockservice ``` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…atrixorigin#25509) ## What type of PR is this? - [x] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#25279 ## What this PR does / why we need it: This PR reduces the cost of lockservice active transaction validation paths involved in remote `validTxn` checks. - Add a `CheckActiveTxn` lockservice RPC for point lookup by `ServiceID` and `TxnID`. - Keep `GetActiveTxn` as the full active txn ID listing API for existing list consumers. - Use `CheckActiveTxn` in remote `validTxn`, with fallback to `GetActiveTxn` when the peer does not support the new method. - Add `TxnClient.IterTxnIDs` so lockservice `TxnIterFunc` can enumerate txn IDs without building `TxnOverview` or copying wait-lock state. - Keep callback execution outside internal txn-client locks. - Add focused coverage for `IterTxnIDs` and `CheckActiveTxn` handler behavior. Validation: ```sh go test -race -count=1 -timeout 180s ./pkg/txn/client go test -count=1 -timeout 120s ./pkg/cnservice go test -count=1 -timeout 120s -run 'TestHandleCheckActiveTxn|TestGetActiveTxnWithRemote|TestCannotCommit|TestValidTxn|TestCheckTxnTimeout' ./pkg/lockservice ``` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…atrixorigin#25509) ## What type of PR is this? - [x] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to matrixorigin#25279 ## What this PR does / why we need it: This PR reduces the cost of lockservice active transaction validation paths involved in remote `validTxn` checks. - Add a `CheckActiveTxn` lockservice RPC for point lookup by `ServiceID` and `TxnID`. - Keep `GetActiveTxn` as the full active txn ID listing API for existing list consumers. - Use `CheckActiveTxn` in remote `validTxn`, with fallback to `GetActiveTxn` when the peer does not support the new method. - Add `TxnClient.IterTxnIDs` so lockservice `TxnIterFunc` can enumerate txn IDs without building `TxnOverview` or copying wait-lock state. - Keep callback execution outside internal txn-client locks. - Add focused coverage for `IterTxnIDs` and `CheckActiveTxn` handler behavior. Validation: ```sh go test -race -count=1 -timeout 180s ./pkg/txn/client go test -count=1 -timeout 120s ./pkg/cnservice go test -count=1 -timeout 120s -run 'TestHandleCheckActiveTxn|TestGetActiveTxnWithRemote|TestCannotCommit|TestValidTxn|TestCheckTxnTimeout' ./pkg/lockservice ``` --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
This branch was previously deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #25279
What this PR does / why we need it:
This PR reduces the cost of lockservice active transaction validation paths involved in remote
validTxnchecks.CheckActiveTxnlockservice RPC for point lookup byServiceIDandTxnID.GetActiveTxnas the full active txn ID listing API for existing list consumers.CheckActiveTxnin remotevalidTxn, with fallback toGetActiveTxnwhen the peer does not support the new method.TxnClient.IterTxnIDsso lockserviceTxnIterFunccan enumerate txn IDs without buildingTxnOverviewor copying wait-lock state.IterTxnIDsandCheckActiveTxnhandler behavior.Validation: