Skip to content

[4.2-dev] fix(lockservice): release blocked waiters once - #33192

Merged
XuPeng-SH merged 1 commit into
matrixorigin:4.2-devfrom
XuPeng-SH:codex/33178-waiter-ci
Nov 25, 2026
Merged

XuPeng-SH merged 1 commit into
matrixorigin:4.2-devfrom
XuPeng-SH:codex/33178-waiter-ci

Conversation

@XuPeng-SH

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:

Related to #32744

What this PR does / why we need it:

A retryable transaction close cancels blocked waiters and releases the transaction's references, but leaves those waiters in the transaction's list. A subsequent close or waiter cleanup can release the same references again. Detach the list before notification and release, so every transaction-owned waiter reference is released once. Add a regression that checks notification and repeated close.

This defect was reproduced on the clean 4.2-dev base while investigating the waiter refcount panic in CI run 45447474016. The earlier reference drop in that CI failure was not established, so the reproduction does not prove that this change alone fixes that failure.

Validation on Linux amd64, Go 1.26.6:

  • pkg/lockservice once under -race with identical production code; the final changed test passed 10 times under -race.
  • Incremental gofmt, go vet, and golangci-lint --new-from-rev for pkg/lockservice.
  • The named CI SQL cancellation subtest passed once with coverage on the related PR checkout after this change; this is a smoke check, not proof of the original timing-dependent failure.

@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 →

@mergify

mergify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

mo-bot review · mo-bot-local · done

Commit: 974e8e2a2095f4809eb0bebb99a0955a90d89849

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 974e8e2a2095f4809eb0bebb99a0955a90d89849

Assessment: approve

The change detaches the transaction-owned blocked waiter list before notifying and releasing its references. Retryable close and subsequent waiter cleanup therefore cannot release the same list entries twice. Production close and lock cleanup use the transaction mutex, and the change reuses the existing waiter ownership and notification lifecycle without adding state. The linked CI panic has not been established as the same failure.

Model: gpt-6.1-terra / max

Session: 01a20ed3-c62c-76c0-ab72-cd3b54900431 · slot 2 · generation 2

Validation:

  • Private temporary-directory and loopback preflight passed (preflight.log; checks/1795573903680050650-3.json).

  • At the clean frozen head, the new waiter regression and the existing retryable-unlock and canceled-lookup tests each passed three times under the race detector with the assigned test executor (focused-race-fingerprinted.log; checks/1795574214249660380-3.json).

  • A Go overlay replacing only txn.go with the verified base blob caused the head regression to fail at its stale-list assertion, as expected (baseline-proof.log, baseline-control.log; checks/1795574150748547425-3.json and checks/1795574183026613123-3.json).

  • The base-to-head whitespace check passed (diff-check.log; checks/1795573903651390621-3.json). An independent blob comparison matched all 51 tracked lockservice and module files to the frozen head and found no additional Go files in lockservice (source-proof.log; checks/1795574096295628085-3.json).

Limitations:

  • The captured shared build, Ubuntu unit tests and coverage jobs were still in progress.

  • The author reported a full lockservice race run with identical production code and ten runs of the final regression, but raw logs were not supplied. The earlier timing-dependent CI panic remains unproven as the same defect.

This branch was previously deployed

1 inactive deployment
ci — 974e8e2a Deployed Nov 25, 2026 by XuPeng-SH
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 size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants