Skip to content

fix(ci): stabilize main regression test phases - #33179

Merged
XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/main-ci-ut-replay-fences
Nov 25, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/main-ci-ut-replay-fences

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 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:

issue #32975, #33157, #33105, #33161, #33143

What this PR does / why we need it:

This PR fixes test synchronization and deadline-ownership defects in the affected main-branch CI cases without changing production code or weakening assertions.

  • [Bug]: TestIssue28931 queries a new index before the cross-CN commit fence #32975: after asynchronous CREATE INDEX returns on the ddl CN, fence the writer CN to the ddl CN's latest commit timestamp before running IGNORE/FORCE INDEX queries. This prevents a valid writer from executing before the index logtail arrives.
  • [Bug]: post-cancellation multi-CN percentile replay times out in race UT #33157: separate KILL/cancellation cleanup from same-connection replay budgets and capture two pre-deadline snapshots at 45s and 50s. Each stalled-replay snapshot includes all embedded-CN goroutine stacks, sender/lifecycle gauges, DB pool statistics, goroutine count, memory/GC state, GOMAXPROCS, protocol mode, connection ID and elapsed time. The same physical connection, prepared statement and original assertions are retained. The original one-off stall's root cause remains unproven; these snapshots preserve the evidence needed to distinguish receiver backpressure, ACK/drain paths and resource contention if it recurs.
  • [Bug]: Historical publication authorization race UT times out at DROP PUBLICATION #33105: separate historical publication authorization from source-remapping phases while retaining the same connection and prepared statement. The late semantic DROP/CREATE PUBLICATION no longer inherits the authorization phase's residual deadline.
  • [Bug]: TestIntegerArithmeticWidth times out dropping its database in x86 race UT #33161: drop the 51 transient grouping tables immediately after their assertions and require zero grouped_* tables before parent database teardown. This reduces teardown cardinality; it is a resource-contention mitigation, not a claimed engine-side root-cause fix.
  • [Bug]: Linux race UT hits case deadlines in signal harness and embedded SQL tests #33143:
    • derive the real-Go-driver signal harness budget from its two nested 60-second driver attempts plus cleanup instead of using an outer 40-second deadline, and retain foreground JSON on failure;
    • give each Issue30084 partition case and the terminal lifecycle phase independent budgets;
    • give each LoadRejectsDuplicatePrimaryKeys scenario an independent budget while preserving the same session and nested procedure semantics, and keep shared setup outside selectable sibling subtests with its own active context;
    • validate the current-main DropAccount and Iceberg paths without adding unsupported retry/timeout changes.

All existing arithmetic, metadata, cancellation, rollback, and protocol assertions remain in place. The changes are limited to test synchronization, phase ownership, cleanup cardinality, and failure diagnostics.

Tests

All MatrixOne integration runs used Go 1.27.1 and mo-cgo-test -race -short -tags matrixone_test:

  • TestIssue28931StaleUpdatePlanCannotBypassNewIndex: 10/10 PASS
  • TestIntegerArithmeticWidth: 20/20 PASS, including the zero-transient-table assertion
  • TestViewDescriptionSubscription/historical_publication_authorization_and_source: 20/20 PASS
  • TestIssue29492ReplayDiagnostics: 20/20 PASS, covering actual goroutine capture, watchdog firing and stopped-timer control
  • TestIssue29492MultiCNCancellationCleanup: 3/3 PASS, including text/binary replay and connection-ID assertions
  • TestIssue30084ODKUPartitionSnapshotValidation full parent: 3/3 PASS
  • TestLoadRejectsDuplicatePrimaryKeys full parent: 3/3 PASS; existing_row_collision_and_rollback and composite_tuple_identity also pass when selected independently
  • TestDropAccountConcurrentPublicationGrant, TestIcebergSQLEngineEmbeddedHarness, and TestCreateEmbeddedIcebergTenantAccount: PASS
  • TestExecutionPhysicalMemoryHeadroomUsesPrivateLimit: PASS
  • Linux/arm64 Docker: go test -race ./optools -count=1 -timeout=600s: PASS (80.540s), including the modified real-driver case and cancellation/fallback cases
  • go vet -tags matrixone_test for all changed MatrixOne test packages: PASS
  • Linux Docker go vet ./optools: PASS
  • Independent read-only code review of the final diff: no correctness findings

Repository-wide CI is left to the PR checks; the runs above are the focused acceptance matrix, not a claim that every original one-off timeout was independently reproduced before the change.

@XuPeng-SH
XuPeng-SH requested a review from fengttt as a code owner November 24, 2026 17:47
@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 24, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH

XuPeng-SH commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 23bee24058e9887fb3f08e00464bfc600151fd14

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: 23bee24058e9887fb3f08e00464bfc600151fd14

Assessment: request_changes

The cross-CN fence uses the existing timestamp waiter appropriately, but two test-lifecycle issues remain: the partition test retains an expired parent deadline for its final phase, and the LOAD test places shared setup inside a selectable sibling subtest.

Model: gpt-6.1-terra / max

Session: 01a1ee80-0d82-7030-a965-b51f496c3054 · slot 2 · generation 1

  • P2 pkg/tests/issues/issue_30084_test.go:74: The partition cases collectively take more than 120 seconds, while each completes within its new independent deadline.
    Impact: The final barrier-lifecycle setup still uses the original context created before the loop. It is already expired, so the parent test fails with a deadline error after the partition cases pass.
    Evidence: The new case context shadows the outer context; lines 128–144 use the outer context again. An isolated orchestration model passed with a fresh parent and failed with an expired parent. Give the terminal lifecycle phase its own bounded context after the loop.

  • P2 pkg/tests/issues/issue_30411_test.go:228: A developer or test runner selects only the existing-row-collision subtest, or another later policy-dependent scenario.
    Impact: Go skips the input-duplicate sibling that now enables mo_pk_check_by_cn and creates table t. The selected collision case fails because the table is absent, and other selected cases run without their intended session policy.
    Evidence: The baseline performed this setup before the sibling subtests; it is now inside the input-duplicate subtest. A focused orchestration model fails with both table and policy unset, while the full-selection control passes. Initialize the shared state outside the selectable sibling with an active context, or initialize it in each dependent scenario.

Validation:

  • Reviewed the complete diff, linked issues, repository guidance, and all three discussion entries. The source and whitespace check passed; output is retained in source-check.stdout.

  • Private-runtime preflight passed at the assigned clean head. Isolated Go orchestration models confirmed the fresh-parent and full-selection controls and the two expected failure cases; they are not MatrixOne SQL integration tests.

  • The author reports repeated race and integration runs in the PR description. The captured CI unit-coverage job was still in progress.

Limitations:

  • No local MatrixOne SQL, multi-CN, or full optools integration run was performed.

  • The source-fingerprint step timed out in later check receipts. The initial preflight recorded the clean assigned head, and the source check independently verified HEAD; the checkout was read-only.

@XuPeng-SH

Copy link
Copy Markdown
Contributor Author

Addressed both P2 findings in d958e7c:

  • Issue30084 terminal barrier-lifecycle coverage now uses a fresh 120s context after the independently budgeted partition cases.
  • LoadRejectsDuplicatePrimaryKeys shared session/table setup now runs outside selectable sibling subtests with its own active 2m context.

Validation: both full parent tests passed 3/3 under race; existing_row_collision_and_rollback and composite_tuple_identity each passed when selected alone; go vet and git diff --check passed. Independent review of the final diff found no concrete issues.

@XuPeng-SH

XuPeng-SH commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: d958e7cbcafb4cd09a354fff28b44c793efcfd82

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

Assessment: request_changes

The prior review’s expired-context and selectable-subtest findings are resolved. The changes reuse existing fixtures and the logtail waiter, but the replay change leaves an explicit diagnostic requirement from linked issue #33157 unmet.

Model: gpt-6.1-terra / max

Session: 01a20ecc-8141-7401-9883-b0fb69bfef30 · slot 0 · generation 10

  • P2 pkg/tests/issues/isolated/issue_29492_test.go:194: The post-cancellation query stalls during the new three-minute replay phase.
    Impact: The test returns a context-deadline error after the query is canceled without retaining the concurrent sender, receiver, and goroutine state needed to distinguish a pipeline liveness problem from resource contention. The original issue reports a replay that had already stalled for about 138 seconds, so granting a fresh budget alone does not establish its cause.
    Evidence: Linked issue #33157 explicitly requires useful in-flight diagnostics for a stalled replay. The changed path performs QueryRowContext followed by require.NoError and has no pre-deadline capture; the author’s reported successful repetitions do not reproduce or diagnose the reported stall. Capture the relevant state while replay is still blocked, or scope this PR to the deadline-ownership mitigation and leave #33157 unresolved. This is an issue-closure and diagnostic gap, not a demonstrated production deadlock.

Validation:

  • Isolation preflight passed; see preflight.log and checks/1795546688736200569-5.json.

  • The selected Linux race test TestBatchedFallbackRealGoDriverSignals passed; see optools-test.log and checks/1795546736421325886-5.json.

  • git diff --check passed; see diff-check.log and checks/1795546886206282032-5.json.

  • Source review confirmed that the timestamp waiter orders the subsequent autocommit snapshot after the DDL commit and that the two previous review findings are resolved.

Limitations:

  • The author reports repeated race SQL integration runs, but their underlying logs were unavailable and no local integration cluster was run.

  • The frozen CI snapshot had the Ubuntu unit and multi-CN BVT jobs in progress.

@XuPeng-SH

XuPeng-SH commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Commit: 6c1fb0212f560abdc1a0030858b739bda1c47b63

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: 6c1fb0212f560abdc1a0030858b739bda1c47b63

Assessment: approve

The test-only changes reuse the existing fixtures, transaction timestamp waiter and SQL sessions while separating phase deadlines and preserving their assertions. The bounded watchdogs add work only when replay is delayed. The previous context, selectable-subtest and diagnostic concerns are addressed; no actionable defect was found in the assigned scope.

Model: gpt-6.1-terra / max

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

Validation:

  • Private /tmp and loopback preflight passed (checks/1795578990295152644-3.json); the frozen diff passed git diff --check (checks/1795579095822614749-3.json).

  • TestBatchedFallbackRealGoDriverSignals passed with the race detector using the real nested Go driver (optools-test.log; checks/1795579033914030141-3.json).

  • Five race repetitions of an extracted watchdog helper and loop-capture probe passed stopped-callback, running-callback join, and distinct iteration-delay cases (watchdog-probe.log; checks/1795579091426739026-3.json). This is a component probe, not a multi-CN SQL test.

  • Source tracing confirmed that the target CN timestamp waiter advances subsequent ordinary autocommit snapshots beyond the DDL commit. The module uses Go 1.27, for which range iterations have distinct variables.

Limitations:

  • The multi-CN, SQL integration, and complete optools suites were not rerun locally. The author reports focused race repetitions, but their underlying logs are not supplied in local_validation.

  • The original replay stall's root cause remains unproven; the change captures diagnostic evidence if it recurs.

@XuPeng-SH
XuPeng-SH merged commit 110efbf into matrixorigin:main Nov 25, 2026
@XuPeng-SH
XuPeng-SH deleted the fix/main-ci-ut-replay-fences branch November 25, 2026 07:02
mergify Bot pushed a commit that referenced this pull request Nov 25, 2026
## What type of PR is this?

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

## Which issue(s) this PR fixes:

- #30542

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

An ascending temporal `RANGE` window can include the partition prefix when an `INTERVAL ... PRECEDING` start bound underflows. For `DATE`, `DATETIME`, and `TIMESTAMP` keys, the frame is now empty when the start arithmetic produces `NULL` and the end bound is valid. `COUNT(*)` returns 0, while `SUM` and `AVG` return `NULL`.

The window executor checks the temporal domain before classifying a failed subtraction as underflow. It still validates the end bound and propagates any error before returning the empty frame. The empty-frame marker also prevents a `TIMESTAMP` frame from being populated during daylight-saving fold evaluation.

- Local tests passed for the window operator package and the full `TestWindowTemporalIntervals` SQL integration test. Incremental formatting, vet, and lint checks passed in both affected packages.
- An independently built local MatrixOne server matched the empty-frame results from MySQL 8.0.46 for all three reported types. It also preserved the in-domain, descending, and `FOLLOWING` controls, the existing temporal window fixture results, and error 20203 for an invalid end bound.
- Underflow classification uses constant-time arithmetic per affected row and adds no scans or frame buffers. No throughput benchmark was run.
- Window arithmetic still omits the optional warning 1441. In a separate mixed-year `DATE` probe, MySQL 8.0.46 returned zero counts throughout a partition after the earliest row underflowed. MatrixOne evaluates underflow per row and preserves its existing results for subsequent in-range rows.

CI repair in `20fabd462e9f89e33988037611facc0988b4a279`

- The RANGE search helper moved an existing float32/float64 switch to a new function name. An explicit partial-family annotation records the supported types, and the obsolete baseline entry was removed. The UT gate failure also blocked coverage aggregation. [Coverage UT job](https://github.com/matrixorigin/matrixone/actions/runs/45542968520/job/138966328939), [coverage aggregation job](https://github.com/matrixorigin/matrixone/actions/runs/45542968520/job/138985053599)
- New local validation on Darwin/arm64 with Go 1.27.1 passed for `pkg/container/types` (including `TestTypeSwitchFamilies`) and `pkg/sql/colexec/window` using `mo-cgo-test -short -tags matrixone_test -covermode=set -count=1`. Formatting, incremental vet and lint, and the PR artifact check passed.
- The prior Linux/x64 run passed the SQL integration package. That result applies to the unchanged window behavior and SQL tests. Linux/x64 UT Coverage and coverage aggregation subsequently passed on `20fabd462e9f89e33988037611facc0988b4a279`. [UT Coverage](https://github.com/matrixorigin/matrixone/actions/runs/45551293202/job/138993415555), [coverage aggregation](https://github.com/matrixorigin/matrixone/actions/runs/45551293202/job/139011696744) [Prior coverage UT job](https://github.com/matrixorigin/matrixone/actions/runs/45542968520/job/138966328939)

Race UT refresh in `e31ff0d60a0016f15cf5b72c55b2fad2dbb3ce74`

- The previous Ubuntu/x86 race job reached the shared three-minute subtest deadline at the post-KILL prepared replay in `TestIssue29492MultiCNCancellationCleanup/binary`. The runner later reached its two-hour UT limit. The rebase includes the upstream split between the cancellation and replay budgets and the new pre-deadline replay diagnostics. All four PR patches are unchanged by range-diff. [Race UT job](https://github.com/matrixorigin/matrixone/actions/runs/45551293202/job/138993308393), [upstream test update](#33179)
- New Go 1.27.1 Darwin/arm64 validation passed on this rebased commit. `mo-cgo-test -race -short -tags matrixone_test -count=1` passed the cancellation test in text and binary modes and the replay diagnostics test. The type and window packages passed with coverage, and `TestWindowTemporalIntervals` passed through SQL. Formatting, incremental vet and lint, and the artifact check passed.
- The focused tests validated both protocols locally. The complete Ubuntu/x86 race run remains to be verified for this commit.


Approved-by: XuPeng-SH <[email protected]>
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/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants