Repository navigation
test(cdc): synchronize cross-CN watermark race fixture - #28542
Merged
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? |
1 task done
XuPeng-SH
commented
Sep 9, 2026
XuPeng-SH
left a comment
Contributor
Author
There was a problem hiding this comment.
Forced deep review; CI and queue gates were intentionally not used.
Range reviewed: base 41667f5bd26abd33a00e8114d7b4b034c7d86e87, head e5e7c1bacfb1ab639e4fe00aa3e4a3c6de5d45d8, merge-base 41667f5bd26abd33a00e8114d7b4b034c7d86e87 (one committed change; no staged, unstaged, or untracked PR content).
No actionable findings.
Attempted disproof and closure evidence:
- Read every changed hunk in both files and traced the test through the production guarded SQL and lock-service wait-list path. The CN1 visibility probe uses an independent autocommit connection, requires
count(*) = 1for the exact newly generated UUID, and therefore cannot be satisfied by residue from an older fixture generation. Once it returns, both race arms start from a task row applied on the writer CN. - Re-derived both orderings.
drop winsholds the CN0 task-row delete before the CN1 guarded insert;writer winsswaps executors, statements, and the queried holder lock service. In both cases readiness is published only after the holder statements succeed, and the oracle accepts only the exact contender transaction ID fromGetWaitingList. - Tried the prior false-pass path where the guarded insert completes with
AffectedRows=0. Completion closesdone; receiving it publishes the transaction ID, last statement, affected rows, and error, and the terminal wrapper stops polling on the first observed completion. Thus early success or failure is now a test failure, not a 30-second empty-waiter timeout or a pass. - Built the ownership and wait graph. Each spawned transaction has one registered cleanup owner that cancels and joins it; LIFO registration makes those joins precede fixture deletion even after
FailNow. The waiter probe runs synchronously, propagates its bounded context intoGetWaitingListand the remote RPC, and leaves no orphan observation goroutine. Tickers, contexts, SQL pools, result batches, and fixture rows all have bounded cleanup paths; no restart/reuse generation is shared because each ordering has a unique task ID. - Checked nearby counterexamples: unrelated waiters remain rejected, terminal probe errors preserve
errors.Is, statement/startup/commit/cancel paths remain covered, and final task plus watermark counts still have to be zero. The added barrier does not weaken the production lock contract or hide a missing lock: after visibility it still requires a real exact-ID wait edge before releasing the holder. - No production, public API, wire/catalog format, hot path, build tag, or generated artifact changed. The existing two-CN embedded fixture is the minimum topology needed for this regression; the extra connection and bounded point-read polling are test-only.
COMMENT
This was referenced Sep 9, 2026
1 task done
1 of 7 tasks
XuPeng-SH
added a commit
that referenced
this pull request
Sep 9, 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 #28487 ## What this PR does / why we need it: Remove the unused `execInternalTxnSQL` test helper. After #28542 switched its caller to `execInternalTxnSQLWithAffectedRows`, the wrapper had no callers and caused golangci-lint's `unused` check to fail, including on unrelated PRs. The existing affected-row helper and all test assertions remain unchanged. This PR deletes only five lines from one test file. Validation: repository-wide exact-symbol search confirms the removed function had no callers; formatting and `git diff --check` pass. The reported failure is recorded in [the SCA job](https://github.com/matrixorigin/matrixone/actions/runs/34404948785/job/102645619965). A prior local package lint attempt was blocked by missing native `jemalloc.h`; full SCA is pending CI, not claimed as locally passing.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…28542) ## Summary Fixes matrixorigin#28282. The CDC watermark race regression test could fail before exercising the lock contract. The fixture task was committed through CN0, while CN1 had not necessarily consumed the corresponding logtail. In `drop_wins`, the guarded watermark INSERT on CN1 could therefore complete with `AffectedRows=0` without requesting the task-row lock; an empty holder wait graph was then reported as a 30-second flaky timeout. This change: - establishes a real CN1 visibility barrier with an independent autocommit read before starting either race ordering; - uses a unique UUID task ID for each ordering so an older fixture generation cannot satisfy that barrier; - reports contender completion before lock admission immediately, including transaction ID, last statement, affected rows, and error; - preserves both lock orderings, exact waiter transaction-ID validation, transaction cleanup/join, and final zero task/watermark assertions. No production CDC or lock-service code is changed. ## Validation - focused two-CN regression: pass; - focused regression with `-race`: pass; - `TestCDCRaceTxn` and `TestCDCWaiterProbe` with `-race -count=3`: pass; - full `pkg/tests/issues` with the known unrelated `TestIssue28313EmptyRemoteDispatch` flaky skipped: pass; - `go vet ./pkg/tests/issues` with repository CGo headers/libs: pass; - `git diff --check`: pass. An unfiltered owning-package run still reproduced the pre-existing `TestIssue28313EmptyRemoteDispatch` / shuffle receiver lifecycle flaky tracked by matrixorigin#28447; it does not touch this change.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 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 matrixorigin#28487 ## What this PR does / why we need it: Remove the unused `execInternalTxnSQL` test helper. After matrixorigin#28542 switched its caller to `execInternalTxnSQLWithAffectedRows`, the wrapper had no callers and caused golangci-lint's `unused` check to fail, including on unrelated PRs. The existing affected-row helper and all test assertions remain unchanged. This PR deletes only five lines from one test file. Validation: repository-wide exact-symbol search confirms the removed function had no callers; formatting and `git diff --check` pass. The reported failure is recorded in [the SCA job](https://github.com/matrixorigin/matrixone/actions/runs/34404948785/job/102645619965). A prior local package lint attempt was blocked by missing native `jemalloc.h`; full SCA is pending CI, not claimed as locally passing.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…28542) ## Summary Fixes matrixorigin#28282. The CDC watermark race regression test could fail before exercising the lock contract. The fixture task was committed through CN0, while CN1 had not necessarily consumed the corresponding logtail. In `drop_wins`, the guarded watermark INSERT on CN1 could therefore complete with `AffectedRows=0` without requesting the task-row lock; an empty holder wait graph was then reported as a 30-second flaky timeout. This change: - establishes a real CN1 visibility barrier with an independent autocommit read before starting either race ordering; - uses a unique UUID task ID for each ordering so an older fixture generation cannot satisfy that barrier; - reports contender completion before lock admission immediately, including transaction ID, last statement, affected rows, and error; - preserves both lock orderings, exact waiter transaction-ID validation, transaction cleanup/join, and final zero task/watermark assertions. No production CDC or lock-service code is changed. ## Validation - focused two-CN regression: pass; - focused regression with `-race`: pass; - `TestCDCRaceTxn` and `TestCDCWaiterProbe` with `-race -count=3`: pass; - full `pkg/tests/issues` with the known unrelated `TestIssue28313EmptyRemoteDispatch` flaky skipped: pass; - `go vet ./pkg/tests/issues` with repository CGo headers/libs: pass; - `git diff --check`: pass. An unfiltered owning-package run still reproduced the pre-existing `TestIssue28313EmptyRemoteDispatch` / shuffle receiver lifecycle flaky tracked by matrixorigin#28447; it does not touch this change.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 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 matrixorigin#28487 ## What this PR does / why we need it: Remove the unused `execInternalTxnSQL` test helper. After matrixorigin#28542 switched its caller to `execInternalTxnSQLWithAffectedRows`, the wrapper had no callers and caused golangci-lint's `unused` check to fail, including on unrelated PRs. The existing affected-row helper and all test assertions remain unchanged. This PR deletes only five lines from one test file. Validation: repository-wide exact-symbol search confirms the removed function had no callers; formatting and `git diff --check` pass. The reported failure is recorded in [the SCA job](https://github.com/matrixorigin/matrixone/actions/runs/34404948785/job/102645619965). A prior local package lint attempt was blocked by missing native `jemalloc.h`; full SCA is pending CI, not claimed as locally passing.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
…28542) ## Summary Fixes matrixorigin#28282. The CDC watermark race regression test could fail before exercising the lock contract. The fixture task was committed through CN0, while CN1 had not necessarily consumed the corresponding logtail. In `drop_wins`, the guarded watermark INSERT on CN1 could therefore complete with `AffectedRows=0` without requesting the task-row lock; an empty holder wait graph was then reported as a 30-second flaky timeout. This change: - establishes a real CN1 visibility barrier with an independent autocommit read before starting either race ordering; - uses a unique UUID task ID for each ordering so an older fixture generation cannot satisfy that barrier; - reports contender completion before lock admission immediately, including transaction ID, last statement, affected rows, and error; - preserves both lock orderings, exact waiter transaction-ID validation, transaction cleanup/join, and final zero task/watermark assertions. No production CDC or lock-service code is changed. ## Validation - focused two-CN regression: pass; - focused regression with `-race`: pass; - `TestCDCRaceTxn` and `TestCDCWaiterProbe` with `-race -count=3`: pass; - full `pkg/tests/issues` with the known unrelated `TestIssue28313EmptyRemoteDispatch` flaky skipped: pass; - `go vet ./pkg/tests/issues` with repository CGo headers/libs: pass; - `git diff --check`: pass. An unfiltered owning-package run still reproduced the pre-existing `TestIssue28313EmptyRemoteDispatch` / shuffle receiver lifecycle flaky tracked by matrixorigin#28447; it does not touch this change.
VioletQwQ-0
pushed a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 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 matrixorigin#28487 ## What this PR does / why we need it: Remove the unused `execInternalTxnSQL` test helper. After matrixorigin#28542 switched its caller to `execInternalTxnSQLWithAffectedRows`, the wrapper had no callers and caused golangci-lint's `unused` check to fail, including on unrelated PRs. The existing affected-row helper and all test assertions remain unchanged. This PR deletes only five lines from one test file. Validation: repository-wide exact-symbol search confirms the removed function had no callers; formatting and `git diff --check` pass. The reported failure is recorded in [the SCA job](https://github.com/matrixorigin/matrixone/actions/runs/34404948785/job/102645619965). A prior local package lint attempt was blocked by missing native `jemalloc.h`; full SCA is pending CI, not claimed as locally passing.
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.
Summary
Fixes #28282.
The CDC watermark race regression test could fail before exercising the lock contract. The fixture task was committed through CN0, while CN1 had not necessarily consumed the corresponding logtail. In
drop_wins, the guarded watermark INSERT on CN1 could therefore complete withAffectedRows=0without requesting the task-row lock; an empty holder wait graph was then reported as a 30-second flaky timeout.This change:
No production CDC or lock-service code is changed.
Validation
-race: pass;TestCDCRaceTxnandTestCDCWaiterProbewith-race -count=3: pass;pkg/tests/issueswith the known unrelatedTestIssue28313EmptyRemoteDispatchflaky skipped: pass;go vet ./pkg/tests/issueswith repository CGo headers/libs: pass;git diff --check: pass.An unfiltered owning-package run still reproduced the pre-existing
TestIssue28313EmptyRemoteDispatch/ shuffle receiver lifecycle flaky tracked by #28447; it does not touch this change.