Skip to content

test(lockservice): bound concurrent duplicate bind regression - #29171

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-29165
Sep 20, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-29165

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Test and CI

Which issue(s) this PR fixes:

Fixes #29165

What this PR does / why we need it:

Replace the 20,000-operation timing-dependent workload in TestHandleBindChangedConcurrently with a bounded concurrent regression scenario. Two transactions hold shared locks while two workers dispatch duplicate bind notifications. Preserve the table identity and zero create/close/fence assertions, then verify both transactions can acquire another row and are removed after unlock.

Workers report errors to the test coordinator and always unlock. Cancellation and barrier release happen before joining workers and tearing down the fixture, including assertion failures.

Production behavior is unchanged. The existing duplicate-bind guard is retained; this does not claim a newly proven production deadlock or exact historical CI scheduling cause.

Validation (Go1.26.4, macOS arm64, verified native inputs, -p 2):

  • Focused test and three actual-bind fencing controls passed.
  • Full pkg/lockservice suite passed (101.415s).
  • 100 focused race iterations passed (12.614s; measured single test0.11s).
  • Mutation check: disabling the duplicate-bind guard fails the create/close/fence assertions; production source restored.
  • gofmt/diff checks, owning-package vet, and incremental lint checked before publication.
  • Independent GPT-6 medium design and final review passed.

No SQL or wire/storage behavior changed. CI results are pending; no CI wait was performed.

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

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

PASS — reviewed exact head 07368ee against base bc523de.

Read all changed hunks and traced held transactions, concurrent duplicate callbacks, the same-bind early return, subsequent transaction usability, and final unlock/holder cleanup. The bounded scenario preserves identity, create/close and fence oracles. Failure unwinding releases barriers and joins workers before fixture teardown.

Completed focused controls, race-100 and owning-package evidence are available. The guard-removal mutation fails the side-effect assertions, demonstrating regression sensitivity. Exact-head CI is successful.

No P0/P1/P2 blockers found. Coverage was not used as a gate.

@XuPeng-SH
XuPeng-SH merged commit e5d7afd into matrixorigin:main Sep 20, 2026
18 of 20 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/issue-29165 branch September 20, 2026 20:34
XuPeng-SH added a commit that referenced this pull request Dec 2, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Fixes #33657

Related to #29165 and the [x86 race UT
failures](https://github.com/matrixorigin/matrixone/actions/runs/46850647337/job/143403324427).

## What this PR does / why we need it:

- Backport the deterministic duplicate-bind regression from #29171. Two
transactions hold shared locks while competing callbacks deliver
duplicate binds. The test still verifies table identity, no replacement
or fencing, and successful subsequent locking and cleanup.
- Run the mutable-tail restart case on two CNs with a test-owned data
directory. Retain the cross-CN writes, restart, persisted data and
transaction rollback assertions. The post-restart phase has its own
deadline and refreshes the restarted CN's TN routing snapshot before
beginning the write transaction. A deferred rollback covers assertion
failures. Closing the private cluster and removing its directory
replaces SQL teardown.
- Run the system-catalog clone scenario through the connection pool with
a separate cleanup deadline for each database. Cancelling one DROP can
no longer close the connection used by subsequent view scenarios.

Local validation uses Go 1.26.4 on Linux x86_64 with the CI race flags.
The three formerly failing tests and the affected fixture checks passed
on the final revision. The full lockservice race suite passed. The
duplicate-bind case passed 100 race iterations, and the mutable-tail
restart passed two additional race iterations. Incremental SCA passed
for `pkg/embed` and `pkg/lockservice`.

This branch was previously deployed

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

Labels

kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: TestHandleBindChangedConcurrently timeout recurs in race UT

2 participants