Skip to content

test: synchronize index rebuild assertions across CNs - #31059

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/assigned-ut-flaky-20261024
Oct 25, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/assigned-ut-flaky-20261024

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Oct 24, 2026 •

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:

Fixes #31042.

What this PR does / why we need it:

The index-rebuild test immediately queried CN0 after CN1 committed COPY ALTER. A successful commit on one CN does not establish another CN's catalog snapshot, so the reader could reject the newly added note column.

Wait for the reader's applied logtail timestamp to advance past the writer's committed timestamp at the fixture's committed handoffs: initial setup, replacement source generations, COPY ALTER source setup, and the final peer read. Reuse the existing transaction-client waiter with a child of the test context. Preserve unflushed inputs, transaction-local index assertions, remote-owner execution, rollback, and commit checks.

Cancellation fixture hardening

The UT job at https://github.com/matrixorigin/matrixone/actions/runs/40135373630/job/120995705912 failed in TestHeavyPlanCancellationStopsWritersBeforeMerge: its injected completion handshake returned 96, and fixture cleanup found a live plan mock. The original log uses the same status for three handshake phases, so it does not identify which phase failed. The original CI trigger has not been reproduced locally; this update does not claim a demonstrated causal repair.

Harden both consumers of the delayed-completion fixture (plan cancellation and engine launch-registration cancellation): TERM now only records cancellation and writes one durable wake token to a fixture-owned FIFO. The mock performs stopped/report updates and the held/release/published handshake in ordinary execution, avoiding a blocking completion read inside the interrupted read's TERM trap. Identify handshake failures by phase, PID, tick, read status, and token using the existing diagnostic file.

Keep the default 60-tick grace, actual liveness probes and KILL escalation, delayed helper-owned acknowledgment, join-before-report-consumption ordering, exactly-once report assertions, and status 125/artifact retention on failed drainage. No production code, timeout values, test skips, or SQL/storage formats change.

Validation

Linux/amd64, Go 1.27.1:

  • Complete rebased TestIssue29566IndexRebuildCoordinator under race: pass (16.619s), preserving FULLTEXT2/HNSW and all four COPY ALTER combinations. Its prior normal execution also passed; the index test source is unchanged by this update.

  • Both affected cancellation tests: normal and race pass; each exact test passes 21 adaptive race repetitions.

  • Full optools: normal pass (26.089s), race with parallelism 8 pass (27.082s), including existing cancellation/drainage failure controls.

  • Diagnostic overlays, excluded from the commit: both consumers pass controlled TERM-before-read and TERM-during-read cases. A deliberately wrong held token is diagnosed correctly, and the existing harness detects and reclaims the surviving owned mock. These are protocol/diagnostic checks, not reproductions of the original CI failure.

  • Incremental SCA for both changed packages: gofmt, go vet, custom molint, and repository-configured golangci-lint v2.14.0 pass (0 lint issues).

  • Design and final source review: actual gpt-6.1-sol / xhigh, reviewed head b2f233df82. No material findings for publication of this hardening; the final review's static-validation condition is satisfied by the completed SCA run.

The changes are test-only. Fresh CI remains to be verified; no CI wall-time improvement or incident closure is claimed.

@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 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 0bd710eb26db1855ada3fb0dd38dff98efb96fd6

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: 0bd710eb26db1855ada3fb0dd38dff98efb96fd6

Assessment: approve

Reviewed the complete delta and transaction/logtail ownership chain. The bounded waits reuse the authoritative snapshot waiter at committed handoffs, preserving unflushed, transaction-local, rollback and remote-scan coverage. No actionable defects found; production paths are unchanged.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • Complete TestIssue29566IndexRebuildCoordinator passed with -vet=all in 9.00s, covering FULLTEXT2, HNSW and all four COPY ALTER coordinator/flush combinations.

  • Race run passed in 12.05s; adaptive -race -count=2 also passed, with test durations of 14.90s and 15.36s.

  • Isolation preflight, native provenance verification with 192 matching inputs, gofmt, diff whitespace and clean frozen-source checks passed.

  • Commands, source fingerprints, exit receipts and complete subtest results were reconciled in /home/xupeng/.local/state/mo-bot/jobs/46573c542ce476b342cca7ba/attempt-1/check-audit.json; matching logs and checks/*.json receipts are retained alongside it.

Limitations:

  • Relevant frozen CI checks were pending; uncorroborated author validation claims were not counted as executed evidence.

  • The linked issue body was absent; review used the behavioral contract in the frozen PR description. Validation covered the complete affected test, not the full repository suite.

@XuPeng-SH

XuPeng-SH commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: b2f233df82a71d940bad9346c2c97d17b4c29ec7

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: b2f233df82a71d940bad9346c2c97d17b4c29ec7

Assessment: approve

Reviewed the complete two-file delta and affected ownership chains. The existing logtail waiter correctly orders committed cross-CN reads, while the one-shot cancellation FIFO removes blocking handshake work from TERM traps. Transaction-local assertions, drainage checks and exactly-once reporting remain intact. The design is bounded, test-only and adds no production SQL overhead. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Verified frozen head, clean source, patch correspondence, formatting, isolation preflight and native provenance against 192 matching inputs.

  • Index integration test passed normally (9.27s), under race (15.08s), and in the adaptive additional race run (13.35s), including FULLTEXT2, HNSW and all four COPY ALTER combinations.

  • Full optools passed normally (24.424s) and under race (24.725s). Each affected cancellation test also passed 22 race repetitions.

  • Controlled overlays passed TERM-before-read and TERM-during-read cases. A deliberately incorrect held token produced phase-specific diagnostics and verified survivor detection and cleanup.

  • go vet, molint and configured golangci-lint v2.14.0 passed; lint reported zero issues.

  • Commands, source fingerprints, exit receipts, test selections and retained logs reconciled in /home/xupeng/.local/state/mo-bot/jobs/8febe3f467166ab98f8d3993/attempt-1/check-audit.json.

Limitations:

  • The original cancellation CI failure was not reproduced; protocol validation does not establish its causal resolution.

  • Validation used Linux/amd64 CPU execution and the focused multi-CN test, not the entire multi-CN suite.

  • Frozen CI remained pending. The linked issue body was absent; its behavioral contract was assessed from the supplied PR description and source.

@XuPeng-SH
XuPeng-SH merged commit 1c9518b into matrixorigin:main Oct 25, 2026
17 of 19 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/assigned-ut-flaky-20261024 branch October 25, 2026 10:24

This branch had an error being deployed

1 failed deployment
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.

[Bug]: [flaky] multi-CN index rebuild UT: copy-alter (flush=false) loses column note on cn1 (TestIssue29566IndexRebuildCoordinator)

2 participants