Skip to content

fix lockservice orphan remote txn validation#25154

Open
LeftHandCold wants to merge 1 commit into
matrixorigin:4.0-devfrom
LeftHandCold:codex/fix-lockservice-orphan-unlock-4.0
Open

fix lockservice orphan remote txn validation#25154
LeftHandCold wants to merge 1 commit into
matrixorigin:4.0-devfrom
LeftHandCold:codex/fix-lockservice-orphan-unlock-4.0

Conversation

@LeftHandCold

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #25126
issue #22791

What this PR does / why we need it:

Backport of #25150 to 4.0-dev.

Remote lock orphan cleanup used to treat a missing remote CN active transaction as enough proof that the holder could be unlocked. That is unsafe when the commit response is lost after TN has already accepted or is processing the commit: the waiter can release the holder lock with an empty commit timestamp and continue on an old snapshot.

This PR makes the remote orphan check ask the allocator before releasing such a holder. If the allocator reports the txn is still committing, lockservice keeps the holder valid and does not unlock it as an orphan. Only txns confirmed as not committing continue down the orphan unlock path.

A unit test covers the inactive-remote-txn plus committing-in-allocator case so the waiter orphan cleanup path does not regress.

Test

GOCACHE=/private/tmp/mo-gocache-issue25126-4dev go test ./pkg/lockservice -run 'TestValidTxnWith|TestCanUnlockRemoteTxn' -count=1

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants