Skip to content

test(logservice): cover WAL failure ordering - #28721

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/luna-qa-wal-20260911
Sep 11, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
VioletQwQ-0:codex/luna-qa-wal-20260911

Conversation

@VioletQwQ-0

@VioletQwQ-0 VioletQwQ-0 commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

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

Which issue(s) this PR fixes:

issue #28013

What this PR does / why we need it:

Adds deterministic WAL driver acceptance coverage for the failure-ordering and lifecycle gaps identified after merged PR #28014.

  • Covers worker handoff and committer completion ordering with bounded release/join cleanup.
  • Verifies a shared absolute close deadline across intake and worker drain, without granting an in-flight append a synthetic success.
  • Exercises a real two-entry group pre-callback failure through LogEntryWriter.Finish and the production wait path; both waiters must receive the same sentinel before fail-stop release, Append must not run, and the committed watermark must not advance.
  • Includes a controlled negative mutation that removes worker NotifyError; the new barrier assertion fails before the normal implementation is restored.
  • No production code, SQL, protocol, or runtime behavior is changed. This follow-up depends on merged PR fix(tae): complete WAL waiters before append fail-stop #28014 and does not modify its owner worktree.

Validation bound to the current PR head 705046072e9e15e00ff60233611d73bf8903bcc6 (base main@b349fea56f1c16e3c947ac730cc114fca3c3f241):

  • Test file SHA256: 981c947cfe70564241f2a27f1bf03e204b72eec76c8670aab6d012ae64b2ba86.

  • Focused and owning CGo normal/race tests for the four lifecycle/failure cases: PASS; the pre-callback ordering race stress also passes 100 iterations. The committed change preserves the exact tested file content; logs and the final delta are indexed in /Users/violet/Documents/Codex/2026-09-11/matrixone-qa-followup/outputs/wal/REPORT.md and final-state.txt.

  • git diff --check: PASS before commit; the final commit contains only pkg/vm/engine/tae/logstore/driver/logservicedriver/driver_test.go (90 insertions, 20 deletions relative to the published head).

  • Base behavior: PASS — the merged fix(tae): complete WAL waiters before append fail-stop #28014 production implementation remains unchanged; the test gap was the missing pre-callback and lifecycle assertions.

  • Negative controls: PASS — removing committer.NotifyError fails the new waiter-order assertion; the production file was restored and is absent from the final diff.

  • BVT: N/A — the covered WAL driver failure ordering is package-internal and has no meaningful stable SQL/BVT entry point. The regression asserts waiter terminal errors, fail-stop ordering, append count, watermark, pending-wait drain, bounded close, and repeated WaitDone stability.

QA required: yes — issue #28013 is marked phase/testing and covers failure, fail-stop, deadline, and cleanup behavior that requires lifecycle acceptance beyond package tests. Local QA evidence is preserved, but machine preflight, exact-head CI, maintainer review, remote multi-node/recovery validation, and formal QA remain pending.

Remaining validation

  • Exact-head CI and maintainer review are pending.
  • Remote multi-node/recovery validation and formal QA are not run in this local test-only patch.
  • Machine preflight/Python 3.8 execution for the follow-up evidence is pending; environment failures remain separate from product-test failures.
  • Serializer WriteTo failure injection remains intentionally out of scope because no reachable production failure seam exists without a fake serializer.

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

@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

Choose a reason for hiding this comment

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

Reviewed 7050460 against main b349fea. No concrete blocker found.

The complete diff is confined to driver_test.go: strengthened cleanup for the two existing worker-handoff cases, a shared intake/worker-close deadline oracle, and a new grouped pre-callback failure case. This is focused acceptance-test maintenance over the already merged production protocol, not a new lifecycle design or wire/storage change.

I traced the tests through onCommitIntents -> asyncCommit -> groupCommitter.Commit -> LogEntryWriter.Finish/NotifyDone and the production wait/Close paths. The new two-entry test exercises real pre-callback failure after the first entry was serialized, observes both original sentinel errors while fail-stop is still blocked, forbids backend Append, checks pending drain and unchanged committed watermark, and rechecks stable terminal errors after Close. The wait loop cannot accidentally supply the required pre-release notification because finishCommit is still behind that barrier. The completionObservedEntry hook observes DoneWithErr itself before its waitgroup completion, avoiding a false negative based only on whether a waiter goroutine happened to run.

The close test now spends part of one absolute budget stopping intake and keeps the append blocked past the remaining budget; it also distinguishes rejected submission from the still-owned in-flight append. Cleanup releases injected blockers before closing/joining and avoids freeing entries when accepted work has not drained. Shared sync.Once across factory-created clients removes duplicate channel-close risk. No production paths or old test assertions are removed; fixture/data scale is small and there is no added external service fixture.

Non-blocking limit: the close-bound oracle still uses real time with 100 ms scheduler slack, so it is not a virtual-time proof under arbitrary runner starvation. This does not undermine the deterministic failure-ordering barriers. Remote recovery/formal QA for the broader issue is explicitly separate from this package-level coverage.

Evidence: complete source/diff review and author-reported exact-content normal/race checks, 100 race iterations and a negative mutation removing worker NotifyError. I did not independently run those tests or inspect the author's private local evidence files. No native suite or CI wait was performed, and no source files were changed. Live head/base were rechecked before submission.

@mergify mergify Bot added the queued label Sep 11, 2026
@mergify

mergify Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-09-11 12:57 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🚫 Left the queue — 2026-09-11 12:58 UTC · at 705046072e9e15e00ff60233611d73bf8903bcc6

This pull request spent 12 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

For security reasons, Mergify can't update this pull request. Try updating locally.
GitHub response: refusing to allow a GitHub App to create or update workflow .github/workflows/ci-cancellation.yml without workflows permission

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

@mergify mergify Bot added dequeued and removed queued labels Sep 11, 2026
@mergify mergify Bot removed the dequeued label Sep 11, 2026
@XuPeng-SH
XuPeng-SH merged commit 174cfc0 into matrixorigin:main Sep 11, 2026
20 of 21 checks passed
VioletQwQ-0 added 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:

issue matrixorigin#28013

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

Adds deterministic WAL driver acceptance coverage for the
failure-ordering and lifecycle gaps identified after merged PR matrixorigin#28014.

- Covers worker handoff and committer completion ordering with bounded
release/join cleanup.
- Verifies a shared absolute close deadline across intake and worker
drain, without granting an in-flight append a synthetic success.
- Exercises a real two-entry group pre-callback failure through
`LogEntryWriter.Finish` and the production wait path; both waiters must
receive the same sentinel before fail-stop release, `Append` must not
run, and the committed watermark must not advance.
- Includes a controlled negative mutation that removes worker
`NotifyError`; the new barrier assertion fails before the normal
implementation is restored.
- No production code, SQL, protocol, or runtime behavior is changed.
This follow-up depends on merged PR matrixorigin#28014 and does not modify its owner
worktree.

Validation bound to the current PR head
`705046072e9e15e00ff60233611d73bf8903bcc6` (base
`main@b349fea`):

- Test file SHA256:
`981c947cfe70564241f2a27f1bf03e204b72eec76c8670aab6d012ae64b2ba86`.
- Focused and owning CGo normal/race tests for the four
lifecycle/failure cases: PASS; the pre-callback ordering race stress
also passes 100 iterations. The committed change preserves the exact
tested file content; logs and the final delta are indexed in
`/Users/violet/Documents/Codex/2026-09-11/matrixone-qa-followup/outputs/wal/REPORT.md`
and `final-state.txt`.
- `git diff --check`: PASS before commit; the final commit contains only
`pkg/vm/engine/tae/logstore/driver/logservicedriver/driver_test.go` (90
insertions, 20 deletions relative to the published head).
- Base behavior: PASS — the merged matrixorigin#28014 production implementation
remains unchanged; the test gap was the missing pre-callback and
lifecycle assertions.
- Negative controls: PASS — removing `committer.NotifyError` fails the
new waiter-order assertion; the production file was restored and is
absent from the final diff.

- BVT: N/A — the covered WAL driver failure ordering is package-internal
and has no meaningful stable SQL/BVT entry point. The regression asserts
waiter terminal errors, fail-stop ordering, append count, watermark,
pending-wait drain, bounded close, and repeated `WaitDone` stability.

QA required: yes — issue matrixorigin#28013 is marked `phase/testing` and covers
failure, fail-stop, deadline, and cleanup behavior that requires
lifecycle acceptance beyond package tests. Local QA evidence is
preserved, but machine preflight, exact-head CI, maintainer review,
remote multi-node/recovery validation, and formal QA remain pending.

## Remaining validation

- Exact-head CI and maintainer review are pending.
- Remote multi-node/recovery validation and formal QA are not run in
this local test-only patch.
- Machine preflight/Python 3.8 execution for the follow-up evidence is
pending; environment failures remain separate from product-test
failures.
- Serializer `WriteTo` failure injection remains intentionally out of
scope because no reachable production failure seam exists without a fake
serializer.

---------

Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 added 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:

issue matrixorigin#28013

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

Adds deterministic WAL driver acceptance coverage for the
failure-ordering and lifecycle gaps identified after merged PR matrixorigin#28014.

- Covers worker handoff and committer completion ordering with bounded
release/join cleanup.
- Verifies a shared absolute close deadline across intake and worker
drain, without granting an in-flight append a synthetic success.
- Exercises a real two-entry group pre-callback failure through
`LogEntryWriter.Finish` and the production wait path; both waiters must
receive the same sentinel before fail-stop release, `Append` must not
run, and the committed watermark must not advance.
- Includes a controlled negative mutation that removes worker
`NotifyError`; the new barrier assertion fails before the normal
implementation is restored.
- No production code, SQL, protocol, or runtime behavior is changed.
This follow-up depends on merged PR matrixorigin#28014 and does not modify its owner
worktree.

Validation bound to the current PR head
`705046072e9e15e00ff60233611d73bf8903bcc6` (base
`main@b349fea`):

- Test file SHA256:
`981c947cfe70564241f2a27f1bf03e204b72eec76c8670aab6d012ae64b2ba86`.
- Focused and owning CGo normal/race tests for the four
lifecycle/failure cases: PASS; the pre-callback ordering race stress
also passes 100 iterations. The committed change preserves the exact
tested file content; logs and the final delta are indexed in
`/Users/violet/Documents/Codex/2026-09-11/matrixone-qa-followup/outputs/wal/REPORT.md`
and `final-state.txt`.
- `git diff --check`: PASS before commit; the final commit contains only
`pkg/vm/engine/tae/logstore/driver/logservicedriver/driver_test.go` (90
insertions, 20 deletions relative to the published head).
- Base behavior: PASS — the merged matrixorigin#28014 production implementation
remains unchanged; the test gap was the missing pre-callback and
lifecycle assertions.
- Negative controls: PASS — removing `committer.NotifyError` fails the
new waiter-order assertion; the production file was restored and is
absent from the final diff.

- BVT: N/A — the covered WAL driver failure ordering is package-internal
and has no meaningful stable SQL/BVT entry point. The regression asserts
waiter terminal errors, fail-stop ordering, append count, watermark,
pending-wait drain, bounded close, and repeated `WaitDone` stability.

QA required: yes — issue matrixorigin#28013 is marked `phase/testing` and covers
failure, fail-stop, deadline, and cleanup behavior that requires
lifecycle acceptance beyond package tests. Local QA evidence is
preserved, but machine preflight, exact-head CI, maintainer review,
remote multi-node/recovery validation, and formal QA remain pending.

## Remaining validation

- Exact-head CI and maintainer review are pending.
- Remote multi-node/recovery validation and formal QA are not run in
this local test-only patch.
- Machine preflight/Python 3.8 execution for the follow-up evidence is
pending; environment failures remain separate from product-test
failures.
- Serializer `WriteTo` failure injection remains intentionally out of
scope because no reachable production failure seam exists without a fake
serializer.

---------

Co-authored-by: XuPeng-SH <[email protected]>
VioletQwQ-0 added 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:

issue matrixorigin#28013

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

Adds deterministic WAL driver acceptance coverage for the
failure-ordering and lifecycle gaps identified after merged PR matrixorigin#28014.

- Covers worker handoff and committer completion ordering with bounded
release/join cleanup.
- Verifies a shared absolute close deadline across intake and worker
drain, without granting an in-flight append a synthetic success.
- Exercises a real two-entry group pre-callback failure through
`LogEntryWriter.Finish` and the production wait path; both waiters must
receive the same sentinel before fail-stop release, `Append` must not
run, and the committed watermark must not advance.
- Includes a controlled negative mutation that removes worker
`NotifyError`; the new barrier assertion fails before the normal
implementation is restored.
- No production code, SQL, protocol, or runtime behavior is changed.
This follow-up depends on merged PR matrixorigin#28014 and does not modify its owner
worktree.

Validation bound to the current PR head
`705046072e9e15e00ff60233611d73bf8903bcc6` (base
`main@b349fea`):

- Test file SHA256:
`981c947cfe70564241f2a27f1bf03e204b72eec76c8670aab6d012ae64b2ba86`.
- Focused and owning CGo normal/race tests for the four
lifecycle/failure cases: PASS; the pre-callback ordering race stress
also passes 100 iterations. The committed change preserves the exact
tested file content; logs and the final delta are indexed in
`/Users/violet/Documents/Codex/2026-09-11/matrixone-qa-followup/outputs/wal/REPORT.md`
and `final-state.txt`.
- `git diff --check`: PASS before commit; the final commit contains only
`pkg/vm/engine/tae/logstore/driver/logservicedriver/driver_test.go` (90
insertions, 20 deletions relative to the published head).
- Base behavior: PASS — the merged matrixorigin#28014 production implementation
remains unchanged; the test gap was the missing pre-callback and
lifecycle assertions.
- Negative controls: PASS — removing `committer.NotifyError` fails the
new waiter-order assertion; the production file was restored and is
absent from the final diff.

- BVT: N/A — the covered WAL driver failure ordering is package-internal
and has no meaningful stable SQL/BVT entry point. The regression asserts
waiter terminal errors, fail-stop ordering, append count, watermark,
pending-wait drain, bounded close, and repeated `WaitDone` stability.

QA required: yes — issue matrixorigin#28013 is marked `phase/testing` and covers
failure, fail-stop, deadline, and cleanup behavior that requires
lifecycle acceptance beyond package tests. Local QA evidence is
preserved, but machine preflight, exact-head CI, maintainer review,
remote multi-node/recovery validation, and formal QA remain pending.

## Remaining validation

- Exact-head CI and maintainer review are pending.
- Remote multi-node/recovery validation and formal QA are not run in
this local test-only patch.
- Machine preflight/Python 3.8 execution for the follow-up evidence is
pending; environment failures remain separate from product-test
failures.
- Serializer `WriteTo` failure injection remains intentionally out of
scope because no reachable production failure seam exists without a fake
serializer.

---------

Co-authored-by: XuPeng-SH <[email protected]>
@VioletQwQ-0
VioletQwQ-0 deleted the codex/luna-qa-wal-20260911 branch December 1, 2026 03:47

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.

3 participants