Skip to content

fix: report SELECT division-by-zero warnings - #30314

Merged
mergify[bot] merged 4 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/d2a7b2a161d20be3792bd03c40489a5a531a4c16ee7ca8c4367919f0c3bd7fec
Oct 16, 2026
Merged

mergify[bot] merged 4 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/loom/develop/d2a7b2a161d20be3792bd03c40489a5a531a4c16ee7ca8c4367919f0c3bd7fec

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Oct 15, 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:

What this PR does / why we need it:

Successful scalar numeric SELECT expressions using /, DIV, or MOD/% now return NULL with MySQL warning 1365 (Division by 0) when ERROR_FOR_DIVISION_BY_ZERO is enabled, including through TRADITIONAL. Disabled mode, NULL operands, and inactive branches produce no division warning.

Collect diagnostics after successful arithmetic evaluation through the existing bounded warning sink. Preserve diagnostic-bearing subtrees through constant folding so prepared executions follow the current session mode. Carry positive SELECT classification to remote processes and require MORPC v116 only for enabled SELECT division diagnostics; incompatible workers trigger local execution fallback.

Initial implementation validation on macOS arm64 / Go 1.27.1:

  • Confirmed the original failure over the MySQL protocol before the fix.
  • Focused numeric, mode-source, folding, codec, and mixed-version placement/send/receive tests passed.
  • Full tests passed for pkg/sql/plan/function, pkg/vm/process, pkg/sql/plan/rule, pkg/sql/plan, pkg/sql/compile, pkg/pb/plan, pkg/pb/pipeline, and pkg/defines.
  • MySQL-protocol regression passed, including prepared mode changes and a two-CN scan; existing CTAS regression passed.
  • Extended func_div_by_zero_traditional.sql passed mo-tester normal comparison twice on the same instance: 247/247 statements each time, with teardown checked before repetition.
  • Changed-package vet=all passed; incremental golangci-lint reported 0 issues.

Batches without NULL arithmetic results use a constant-time diagnostic fast path. Candidate batches add one bounded row scan; retained diagnostics respect max_error_count and the existing statement memory budget. Scope is scalar numeric arithmetic that already returns NULL for zero divisors.

Rebased on official main b6789851cacee769023c8f9bf45367878ea35f3f. Calendar interval semantics retain MORPC v115; SELECT division diagnostics use v116, with immediate-predecessor placement, send, receive, and downgrade coverage. After rebase, focused compatibility/folding tests, all eight owning packages (-short, matrixone_test, vet=all), and the MySQL-protocol regression passed; incremental golangci-lint reported 0 issues. The rebased head passed its required CI checks. Follow-up fixes preserve division diagnostics inside IN/NOT IN lists and prevent runtime scalar caching from collapsing per-row warning counts. Safe nonzero and NULL constants retain folding, while evaluated rows (including IF/CASE selections) own diagnostic multiplicity.

Validation for the folding fixes on macOS arm64 / Go 1.27.1:

  • Before the fix, all six zero-divisor IN/NOT IN folding cells erased division, and all three arithmetic operators under direct/COALESCE parents emitted 1 warning for 3 rows instead of 3.
  • Normal tests with matrixone_test, -count=1, and -vet=all passed for pkg/sql/colexec, pkg/sql/plan/rule, pkg/sql/plan, and pkg/sql/plan/function. Coverage includes selected rows, subsequent batches, mode changes after reset, zero rows, NULL/nonzero folding, and strict DML errors.
  • The expanded MySQL-protocol regression passed: disabled-mode prepare for IN/NOT IN followed by enabled execution; three-row constant arithmetic; IF/CASE/COALESCE warning counts; existing two-CN execution.

Incremental golangci-lint reported 0 issues, including a final check of the updated executor tests. CI for the updated head is pending. Please leave #30211 open for the reporter to verify after merge.

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

@matrix-meow matrix-meow added the size/XL Denotes a PR that changes [1000, 1999] lines label Oct 15, 2026
@XuPeng-SH

XuPeng-SH commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: a771fa96f4648cf1ca9488038908e3dbc94c1cd1

Review completed. Read the assessment.

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

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

Commit: a771fa96f4648cf1ca9488038908e3dbc94c1cd1

Assessment: approve

Reviewed the complete 26-file delta and relevant callers. Both previously reported folding defects are resolved. The design preserves arithmetic kernels as value/error owners, reuses bounded warning collection, and protects remote execution through SELECT classification and MORPC v116 checks. Targeted folding exemptions preserve per-row diagnostics without disabling safe constant folding. No actionable findings remain.

Model: gpt-6-astra / xhigh

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

Validation:

  • Evidence retained under /home/xupeng/.local/state/mo-bot/jobs/f031a7237b81f56907d431a7/attempt-1. review-record.json records design and ownership analysis; review-audit.json reconciles commands, source fingerprints, exits and logs. Final audit passed: checks/1792112956446938145-2.json. Source remains unchanged.

  • Isolation preflight passed. Native reuse independently verified 192 matching inputs and 46 artifact hashes before compilation.

  • Focused tests passed for arithmetic boundaries, warning retention, mode resolution, planner/runtime folding, reset/reuse, process codec and placement/send/receive/downgrade behavior. Evidence: focused-tests.log and checks/1792112433576797807-2.json. The rule package selected no package-local tests; its folding behavior was exercised through the plan tests.

  • MySQL-protocol SELECT regression and existing CTAS regression passed, including prepared IN/NOT IN mode changes, per-row direct/IF/CASE/COALESCE diagnostics and two-CN aggregation. Evidence: public-tests.log and checks/1792112435695389973-2.json.

  • Generated protobuf descriptor comparison confirmed only the new field and enclosing length change. Changed Go files passed formatting checks; git diff --check passed.

  • Reused benchmarks after verifying unchanged measured code, fixtures, receipts and logs: 8,192-row non-NULL batches remained approximately 37 µs; one-input-NULL batches increased from 52 to 83 µs, with unchanged allocations. This bounded scan cost is accepted for centralized diagnostic collection; disabled-mode and DML controls avoid comparable overhead.

  • The frozen current-head CI snapshot reports successful build, Ubuntu UT, Linux arm64 static analysis, coverage and multi-CN BVT checks.

Limitations:

  • local_validation is empty and detailed CI logs were not supplied; targeted execution is established by local receipts rather than broader author assertions.

  • Issue #30211's body was unavailable. Its behavioral contract was assessed from the frozen PR description and regression tests.

  • Mixed-version tests simulate capability responses rather than deploying an older service. Performance measurements cover arithmetic components, not end-to-end SQL latency.

@mergify mergify Bot added the queued label Oct 16, 2026
@mergify

mergify Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-16 01:11 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-16 02:21 UTC · at 76deafc8062f9a7e33a31a4df858ebcdb9477cb5 · squash

This pull request spent 1 hour 10 minutes 4 seconds in the queue, including 58 minutes 5 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit 76deafc into matrixorigin:main Oct 16, 2026
@mergify mergify Bot removed the queued label Oct 16, 2026
mergify Bot pushed a commit that referenced this pull request Oct 18, 2026
### Design record

- Added versioned design: `docs/design/20261010-alter-copy-pre-publication.md`.
- The design records the speculative-preparation/publication split, authoritative after-copy source-frontier revalidation, persisted-delete coverage, actual nested lock state, terminal retry and whole-transaction rollback ownership, transaction-local relation and workspace-write handling, alternatives, compatibility, source-state cost model, and validation map.
- Independent design approval of that exact revision is still required before implementation approval.

### Root cause

`ALTER TABLE ... COPY` acquired the transaction-scoped global SNAPSHOT lineage-owner gate before temporary-table creation, physical row copy, auto-increment reconciliation, and unaffected-index cloning. Every independent branch ALTER therefore held the stable `mo_catalog.mo_feature_registry` row for `SNAPSHOT` until commit. Under the reported 500-worker workload, unrelated ALTERs serialized behind each other and eventually returned MySQL 1205 lock-wait timeouts or MySQL 2013 connection losses.

Moving physical work before that gate also exposed correctness obligations:

- ALTER must not hold source locks while waiting for the lineage gate.
- Unlocked preflight must not take authoritative owner-row locks.
- Publication must reject source replacement, same-ID schema changes, row changes, and lineage-state changes that happened during physical preparation.
- If a concurrent same-table ALTER removes an index table between preparation and resolution, missing metadata must become a controlled definition-change retry rather than a nil-pointer panic.

### Exact changes

- Split unlocked lineage inspection and timestamp selection from authoritative, gate-protected lineage preparation in `pkg/sql/compile/alter.go`.
- Run lock-free temporary-table creation, physical row copy, auto-increment reconciliation, and unaffected-index cloning before acquiring the global lineage-owner gate. The temporary CREATE passes `WithDisableLock`, so it does not retain the source database shared lock or temporary target table exclusive lock.
- Acquire the lineage gate before source database, catalog-table, and physical-table locks. Existing upstream TRUNCATE behavior already uses compatible ordering; the existing TRUNCATE interleaving test is updated to observe physical work before the gate and gate acquisition before source locks.
- Preserve late broad admission after rebase onto `4022729da2`, while adopting upstream's `admitBroadTableLifecycleRC` API and logical-ID-aware historical-source probes.
- After gate acquisition, advance the RC snapshot, re-resolve the source, and reject source-ID replacement, same-ID table-definition-version changes, source data changes since copy, foreign-key state changes, stale lineage, late historical ownership, and same-statement lineage column replacement before publication.
- Preserve the physical-copy timestamp when lineage becomes relevant only during late publication.
- Replace the post-copy CDC handle probe with `SourceCommitTSAfterCopy(copyTS)`. It uses the authoritative partition-state frontier, excludes only current-transaction workspace writes, includes in-memory rows, data objects, and persisted tombstone objects, fails closed for unavailable providers, and short-circuits once a source frontier exceeds the copy timestamp.
- Aggregate `SourceCommitTSAfterCopy` across every combined partition member, short-circuiting after any member exceeds the copy timestamp and failing closed for missing member providers; a local write on one member no longer suppresses checks for other rows or partitions.
- Convert post-physical source replacement, definition-version, source-data, lifecycle-admission-retry, and source-lock-refresh races to terminal `ErrTxnWriteConflict`; RC statement retry therefore cannot repeat physical preparation while retaining locks. The frontend classifies this conflict as a whole-transaction rollback in both autocommit and explicit-transaction mode.
- Convert a nil source-index object or definition returned by unlocked `Resolve` into `ErrTxnNeedRetryWithDefChanged`, preventing the CI-observed stale-index-generation panic.
- Add the optional `RelationCreatedInCurrentTxn` and after-copy source-frontier relation capabilities with disttae primary, combined-table, and delegate implementations. Relation-created sources skip the committed probe; existing relations with local writes still check committed mutations from other transactions.
- Add deterministic source-lock retry coverage for optimistic ALTER, catalog-table contention, and physical-table contention.
- Update the concurrent stale-index integration test to require terminal error 20601 for a post-copy source-admission race, explicitly retry that statement in a new transaction, and retain the final schema/index/default assertions.

### Issue-to-test proof

- Independent ALTERs no longer serialize: `TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate` proves both independent physical inserts start while the lineage gate is held elsewhere.
- Lifecycle lock order is acyclic: `TestAlterCopyAndDropUseGateBeforeSourceLocks`, `TestAlterCopyAndTruncateUseGateBeforeSourceLocks`, and `TestAlterCopyAndTruncateSerializeBeforeTableLocks` prove ALTER physical work starts before the gate and both ALTER and TRUNCATE record gate acquisition before source locks.
- Source-lock retry contracts are explicit: `TestLockAlterCopySourceRetryContracts` proves optimistic transactions take no source locks, while catalog-table and physical-table retry errors are converted to `ErrTxnNeedRetryWithDefChanged`.
- Unlocked preflight is read-only and race-safe: `TestInspectAlterDataBranchLineageSeesBranchCreatedAfterPreflight` and `TestAlterTableHasLatestHistoricalBranchSourceUsesFreshUnlockedProbe` prove a late branch is rediscovered by authoritative postgate preparation.
- Stale-copy protection is terminal: `TestAlterCopyRejectsSourceReplacementAfterGate`, `TestAlterCopyRejectsSourceDataChangeAfterCopy`, and `TestAlterCopyRejectsSameIDSourceDefChangeAfterGate` reject replacement, row changes, and same-ID definition changes before publication.
- Missing index metadata is controlled: `TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears` proves the definition-change retry path instead of a nil dereference.
- Publication and rollback remain correct: `TestAlterCopyLateLineagePublicationUsesCopyTimestamp`, `TestAlterCopyFailsAfterPhysicalWorkWithoutReleasingGate`, and same-statement replacement coverage verify the original timestamp, injected failure, and no publication after stale-copy discovery.
- Transaction-local state is handled explicitly: `TestAlterCopySkipsSourceChangesForRelationCreatedInCurrentTxn` skips the probe only for relation-created sources, while `TestAlterCopyChecksCommittedChangesDespiteTransactionLocalWrites` proves local writes do not suppress another transaction's committed change. `SourceCommitTS` itself still fails closed for async-index callers.
- Nested CREATE does not retain catalog locks: `TestAlterCopyCreateOptionsDisablesNestedCreateLock` proves `WithDisableLock`.
- The source frontier is bounded and authoritative: `TestAlterCopySourceChangedSinceCopyUsesSourceCommitTS` and `TestAlterCopySourceChangedSinceCopyFailsClosedWithoutProvider` cover unchanged, changed, and unavailable states; `TestSourceCommitTSAtIncludesPersistedTombstone` proves a persisted DELETE advances the frontier.
- Partition aggregation is correct: `TestCombinedTxnTableSourceCommitTSReturnsMax`, `TestCombinedTxnTableSourceCommitTSShortCircuits`, `TestCombinedTxnTableSourceCommitTSFailsClosedForMissingProvider`, and `TestCombinedTxnTableSourceCommitTSPropagatesMemberError` cover member maxima, short-circuiting, and fail-closed behavior.
- Terminal conflicts do not enter RC statement retry: `TestAlterCopyPostPublicationConflictIsNotStatementRetryable` checks both `isRetryErr` and `canRetry`.
- The reported concurrency shape passes: 500 independent branch tables and 500 concurrent ALTER sessions complete with zero lock-wait and zero connection-loss failures.

### Reproduction

- Issue baseline at `77dbf5464466b1d5ae784e7d17d92cd1c1c8d17d`: 301/500 workers completed, 199/500 failed, 172 failures were MySQL 1205, and 27 failures were MySQL 2013.
- Deterministic pre-fix ALTER ablation: replacing only `pkg/sql/compile/alter.go` with its base-compatible version causes `TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate` to time out while both independent physical inserts wait behind the global lineage gate.
- CI regression: old run `37943988958` panicked in `constructTableClone` from `cloneUnaffectedIndexes` during `TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation`. The missing-index retry guard and exact integration test now pass.
- Definition-guard ablation: removing only the postgate definition-version comparison causes `TestAlterCopyRejectsSameIDSourceDefChangeAfterGate` to lose the expected retry error.
- Real workload: 500 workers, 500 independent branch tables, a one-row base, and a 120-second command timeout completed in 71.995 seconds with 500/500 successful ALTERs, 500/500 observed columns, 0 failed ALTERs, 0 MySQL 1205 errors, 0 MySQL 2013 errors, and successful database cleanup (`/tmp/mo-29208-concurrency-500-revision-r6.out`).
- Source-frontier cost: `BenchmarkSourceCommitTSAtUnchanged250KObject` modeled one unchanged 250,000-row non-appendable object with a threshold after every row commit and measured `44075 ns/op`, `1125 B/op`, and `4 allocs/op` on Apple M5 (`darwin/arm64`, 10 GOMAXPROCS).

### Tests

- Previous review-response, CI-regression, and rebase validation on head `104cac3d12`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=1200s ./pkg/sql/compile ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
— passed after the rebase onto `42d42546fd2c2b2449cb81cea47f81d300139753`: compile in 18.925s, disttae in 11.943s, and logtailreplay in 8.386s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^TestIssue27055DatabaseCloneReadsExplicitTransactionSource$' ./pkg/tests/issues`
— passed in 13.087s after the transaction-local workspace-write fix.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestTxnTableHasTransactionLocalWrites|TestCombinedTxnTableHasTransactionLocalWritesShortCircuits|TestAlterCopySkipsSourceChangesForTransactionLocalWrites)$' ./pkg/vm/engine/disttae ./pkg/sql/compile`
— passed in 1.370s and 1.403s.
- Rebase integration on `433a8dc26c`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
— passed in 15.293s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae ./pkg/vm/engine`
— passed in 9.901s and 1.537s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^(TestIssue277xxDDLConsistency|TestIssue29400CopyAlterRetainedGatePromotionFastFails)$' ./pkg/tests/issues`
— passed in 18.517s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/frontend ./pkg/sql/plan`
— passed in 37.126s and 36.724s.
`gofmt -l`, `git diff --check`, and `git status --porcelain=v1 -uall` — clean.
- Exact CI regression:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation$' -v ./pkg/tests/issues`
— passed in 11.668s on the latest rebased head.
- Exact-head focused closure:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears|TestAlterCopyAndTruncateSerializeBeforeTableLocks|TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation)$' ./pkg/sql/compile ./pkg/tests/issues`
— compile tests passed; the exact integration subtest was rerun explicitly as above.
- Coverage-closing lock contracts on `e3de6b6204`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestLockAlterCopySourceRetryContracts$' ./pkg/sql/compile`
— passed.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate|TestAlterCopyAndDropUseGateBeforeSourceLocks|TestAlterCopyAndTruncateUseGateBeforeSourceLocks|TestAlterCopyFailsAfterPhysicalWorkWithoutReleasingGate|TestAlterCopyLateLineagePublicationUsesCopyTimestamp|TestAlterCopyRejectsSourceReplacementAfterGate|TestAlterCopyRejectsSourceDataChangeAfterCopy|TestAlterCopySkipsSourceChangesForRelationCreatedInCurrentTxn|TestAlterCopyRejectsSameIDSourceDefChangeAfterGate|TestAlterCopyRejectsSameStatementReplacementDiscoveredAfterGate)$' ./pkg/sql/compile`
— passed.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -coverprofile=<profile> -run '^TestLockAlterCopySourceRetryContracts$' ./pkg/sql/compile`
— passed; the profile records executions of `alter.go` blocks `1187`, `1199`, and `1210`, the three previously uncovered changed blocks that caused the 73.61% PR coverage result.
- Full owning package:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
— passed in 14.577s on the rebased head `e3de6b6204`.
- Adjacent engine packages:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae`
— passed in 7.745s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine`
— passed in 0.827s.
- Race stress:
`.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=300s -run '^(TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate|TestAlterCopyAndDropUseGateBeforeSourceLocks|TestAlterCopyAndTruncateSerializeBeforeTableLocks|TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears)$' ./pkg/sql/compile`
— passed in 4.688s.
- Static validation:
`GOWORK=off CGO_CFLAGS="-I<cgo> -I<thirdparties>/include" go vet -mod=readonly ./pkg/sql/compile ./pkg/vm/engine ./pkg/vm/engine/disttae`
— passed.
- Build:
`make build` — passed; only the existing duplicate-library linker warning was emitted.
- BVT:
`cd /tmp/mo-29208-bvt-r3 && bash /Users/ghs-mo/MOWorkSpace/mo-tester/run.sh -n -p <worktree>/test/distributed/cases/ -i diff_schema_evolve,merge_schema_evolve,alter_table_historical_lineage`
— 492/492 passed: `diff_schema_evolve` 278/278, `merge_schema_evolve` 139/139, and `alter_table_historical_lineage` 75/75.
- Real concurrency:
`ulimit -n 2048 && python3 /tmp/mo-29208-concurrency-500.py`
— 500/500 successful ALTERs, 500/500 columns verified, 0 failures, 0 MySQL 1205, 0 MySQL 2013; database dropped.
- Final hygiene:
`gofmt -l` on the seven changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean and limited to the focused seven-file scope.

The BVT and real-workload runs passed on this implementation before the latest rebase. The latest semantic rebase onto `f09d4788fd` applied cleanly; upstream changed unique-index duplicate precheck code in `pkg/sql/compile` and did not alter this PR's ALTER COPY production files. Latest exact-head validation on `79e45f24b5`:

- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/sql/compile` — passed in 16.208s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^TestIssue277xxDDLConsistency/27725_concurrent_alter_terminal_conflict_supports_external_retry$' ./pkg/tests/issues` — passed in 11.308s.
- `gofmt -l` on all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean and limited to the focused PR scope.

### Residual risk

- The global lineage gate remains intentionally serialized for atomic publication and genuinely conflicting owner operations; this PR narrows and orders the held section rather than removing the ordering guarantee.
- Future lifecycle owners that take both source locks and the lineage gate must preserve gate-before-source-lock ordering.
- Future lineage invariants must be added to the postgate revalidation path.
- The 500-session proof uses a one-row base to isolate the failing ALTER concurrency path; deterministic barriers and race tests provide the row-count-independent ordering proof. The full reported 250,000-row throughput workload was not rerun; the committed 250,000-row unchanged-object benchmark measures the new serialized source-frontier cost, and broader multi-object storage layouts remain a performance envelope to monitor.
- The old run's two Compose failures were infrastructure failures while pulling the `createbuckets` image (`unauthorized: access to the requested resource is not authorized`); no matching issue was found. The old `pr-size-label` failure was an unrelated runner-proxy TLS failure tracked by #27127.

### Current exact head: `cf9a1735b7`

Rebased onto current `main` `02a2823c20` and resolved both semantic rebase boundaries:

- kept pre-publication, unlocked ALTER COPY preparation;
- integrated upstream forward-FK admission by computing `replacementAdmission.createNames` before physical CREATE and passing that admission into nested `withDropLifecycle`;
- kept upstream frontend rollback classification and added `ErrTxnWriteConflict` to the whole-transaction rollback set.

The source mutation proof now closes both DELETE lifecycle counterexamples:

- retained tombstone entries, including soft-deleted objects, remain source-change proof; actual retention truncation is represented by the partition state-start floor;
- appendable tombstones read non-aborted per-row commit timestamps with the same snapshot semantics as the delete reader;
- non-appendable tombstones read per-block commit-ts zonemaps;
- unavailable tombstone files or commit-ts metadata fail closed;
- the unused public `RelationHasTransactionLocalWrites` chain was removed while preserving the private async-index local-write guard.

The concurrent ALTER integration test now distinguishes the newly upstream pre-copy FK name-pin fast-fail (`ErrLockConflict`) from terminal post-copy `ErrTxnWriteConflict`; both are externally retryable, and final schema/index assertions remain unchanged.

Latest exact-head local validation:

- `CGO_CFLAGS=... go test ./pkg/vm/engine/disttae/logtailreplay -run 'TestSourceCommitTSAt|TestMaxCommitTS' -count=1` — passed.
- `CGO_CFLAGS=... go test ./pkg/vm/engine/disttae ./pkg/sql/compile ./pkg/frontend ./pkg/common/moerr -run 'TestSourceCommitTS|TestCombinedTxnTableSourceCommitTS|TestTxnTableDelegateSourceCommitTS|TestAlterCopy|Test_isErrorRollbackWholeTxn|TestStaticRollbackSetIsInfrastructureOnly|Test.*Rollback.*Txn' -count=1` — passed before the final one-commit rebase; the production delta is unchanged by that test-only upstream commit.
- `CGO_CFLAGS=... go test ./pkg/tests/issues -run 'TestIssue277xxDDLConsistency/27725_concurrent_alter_conflict_supports_external_retry' -count=1` — passed on the exact final head.
- `git diff --check` — passed; the working tree is clean.

Freshness update: rebased exact head `cba088b792` onto `main` `02a2823c20`. The only new upstream commit changes join-expression ownership and has no file overlap with this PR. Revalidated on the exact head: focused logtail source-frontier tests, focused ALTER COPY compile tests, the concurrent ALTER integration test, and `git diff --check`; all passed.

### Coverage CI follow-up and rebase validation

Coverage run `38204952772` exposed one PR-owned test expectation and two unrelated upstream failures:

- `TestIssue29400CopyAlterRetainedGatePromotionFastFails/exclusive_gate` expected the competing ALTER to wait, but upstream pre-copy FK admission now fast-fails with `ErrLockConflict` when it meets the retained source lock. The test now accepts that expected conflict and proves the UPDATE owner can execute its next statement, commit value `2`, and complete the target `DROP TABLE` without deadlock.
- `TestPartitionTopNRejectsUnsupportedOrderType` is the existing clean-main issue #29968.
- `TestTruncateLifecycleRCWaitPolicy` is the existing clean-main issue #29971.

Exact-head validation:

- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestIssue29400CopyAlterRetainedGatePromotionFastFails$' ./pkg/tests/issues` — passed in 12.889s.
- `gofmt -w pkg/tests/issues/issue_29400_test.go`, `git diff --check`, and `git status --porcelain=v1 -uall` — clean before commit.

The branch already contained `main` `02a2823c20` for that test-only follow-up.

### Rebase onto `main` `7af631bdf7`

The exact head is now `cf9a1735b7`, rebased onto current `main` `7af631bdf7`. The rebase applied cleanly and incorporates the upstream fixes for the two clean-main coverage blockers:

- `TestPartitionTopNRejectsUnsupportedOrderType` (#29968) now passes on the rebased head.
- `TestTruncateLifecycleRCWaitPolicy` (#29971) now passes on the rebased head.
- The PR-owned `TestIssue29400CopyAlterRetainedGatePromotionFastFails` regression also passes after the rebase.

Exact-head validation:

- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestIssue29400CopyAlterRetainedGatePromotionFastFails$' ./pkg/tests/issues` — passed in 26.805s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestPartitionTopNRejectsUnsupportedOrderType$' ./pkg/sql/colexec/partition` — passed in 3.080s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestTruncateLifecycleRCWaitPolicy$|^TestAlterCopyAndTruncateSerializeBeforeTableLocks$' ./pkg/sql/compile` — passed in 3.543s.
- `gofmt -l` over all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean after the rebase.


### Review update and current exact head: `f8894b6a0f`

Rebased cleanly onto current `main` `11914526ba` and addressed the pessimistic-RC independent-ALTER publication finding:

- `admitReplacementNames` no longer runs before physical COPY preparation. Pessimistic-RC ALTER COPY now acquires the broad SNAPSHOT gate first, then pins replacement endpoint names with `WaitPolicy_Wait`.
- ALTER records the transaction's retained lock-table baseline before preparation. Gate waiting is permitted only when every retained lock table is new relative to that baseline and is certified by the workspace as created in the transaction. Pre-existing, source, catalog, or unprovable locks retain the fast-fail policy, preventing `G -> name -> G` reverse edges.
- Nested temporary CREATE and row copy propagate `WithDisableLock`; nested execution skips pre-pipeline metadata/table locks and lock operators. TRUNCATE keeps its existing fast-fail replacement-name policy.
- `TestIssue29400IndependentCopyAltersProgressInPessimisticRC` covers both a held explicit publisher and overlapping autocommit publishers. It uses separate connections, observes the independent ALTER waiting at the gate, proves it does not fail while the holder retains the gate, and proves both ALTERs finish after release.
- The exact-head validation passed for `./pkg/sql/compile` and `./pkg/tests/issues` with `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s`, including the new independent-publisher integration test. `gofmt -l` over changed Go files, `git diff --check`, and the final clean-tree check also passed.
- The versioned design and implementation now record this `G -> private preparation locks -> replacement names -> source` publication order and its liveness proof.

### Rebase onto `main` `b09f2c6fc5`

Rebased cleanly onto `main` `b09f2c6fc5` at exact head `3e5069423d`.

- The rebase introduced no semantic conflicts; the full PR delta remains scoped to the ALTER COPY publication lifecycle and its tests/design.
- Re-ran the full affected package set after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile ./pkg/tests/issues ./pkg/frontend ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
- All five packages passed.

### Current exact head after the latest rebase: `2e45e40035`

Rebased cleanly onto current `main` `cd8d5abf96`.

- The rebase applied without conflicts. Its only overlapping paths with this PR were `pkg/sql/compile/compile.go` and `pkg/sql/compile/compile_test.go`, where upstream renamed the vector-index scan node; the ALTER COPY ownership changes remained semantically unchanged.
- Re-ran the focused affected package set after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/tests/issues ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
- All four packages passed.
- `git diff --check`, `gofmt -l` over changed Go files, and the clean-tree check passed before push.


### Review update and exact head: `e088a231b9`

Rebased cleanly onto current `main` `175a645a85` and closed the unaffected-index preparation finding:

- The private ALTER-COPY temporary CREATE now opts out of transient index CDC and idxcron task registration. Because no transient tasks are registered, ALTER also skips their catalog cleanup; post-rename publication retains the existing final task-registration path. This removes the `mo_tables`/`mo_database` lock retention introduced by transient task cleanup while preserving final index-task ownership.
- IVF-FLAT `DeleteBeforeClone` now executes its private replacement hidden-table cleanup with `WithDisableLock`, so the nested DELETE acquires neither catalog metadata locks nor row locks.
- `TestIssue29400IndependentCopyAltersProgressInPessimisticRC` now enables `experimental_ivf_index`, creates an unchanged IVF-FLAT index, and covers both a held explicit publisher and overlapping autocommit publishers. The unrelated ALTER waits at the publication gate and completes after release.
- `TestAlterCopyCreateOptionsDisablesNestedCreateLock` asserts the new skip-registration option. `TestScopeAlterTableCopyInsertTmpDataPipelineFlush` now proves private preparation no longer calls `CopyTableDef` for transient task cleanup while retaining its nil-context pipeline-flush oracle.
- The versioned design records the lock-free cleanup and symmetric registration/cleanup policy.

Exact-head validation after the rebase:

- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestScopeAlterTableCopyInsertTmpDataPipelineFlush$' ./pkg/sql/compile` — passed.
- `gofmt -l` over all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean on the exact head.

Additional validation on the identical code before the unrelated one-commit rebase (`896fa84927` on `main` `3e50e1b32d`):

- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.


### Current exact head after latest rebase: `6596f9dc04`

Rebased cleanly onto current `main` `e5111936b9` after the PR was reported behind.

- `git range-diff` confirms all ten PR commits are patch-equivalent to the prior head `e088a231b9`; only their base changed.
- The worktree remained clean, and no PR code or tests were modified by this rebase.
- No new semantic validation is claimed for this commit-only rebase. The exact prior-head focused validations above remain the latest code-specific evidence.

### Current exact head after latest rebase: `abd5a45122`

Rebased onto current `main` `21f19ae063` after `main` advanced twice during the refresh:

- First rebased `6596f9dc04` onto `main` `6b0da62260` at `3574aa681f`; `git range-diff` confirmed all ten PR commits were patch-equivalent.
- After the push, the live PR snapshot showed `main` had advanced to `21f19ae063`. Fetched that base and rebased again to `abd5a45122`.
- `git range-diff` between the `3574aa681f` and `abd5a45122` ranges confirms all ten PR commits remain patch-equivalent. The new upstream commit overlaps this PR only in `pkg/sql/compile/compile.go`/`compile2.go`; the automatic rebase preserves both the ALTER private-preparation locking changes and upstream prepared zero-limit producer behavior.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestPreparedZeroLimitReuse$' ./pkg/tests/sqlintegration` — passed.
- `gofmt -l` over changed Go files, `git diff --check`, protected-scope check, and the final clean-tree check passed on the exact head.



### Review update and current exact head: `7f243d2e4c`

Rebased onto current `main` `fcad62a8ff` and closed the Compile-pool registration-policy escape found in review `PRR_kwDOFEPiGM8AAAABR92hOw`:

- `Compile.clear` resets `skipIndexTaskRegistration` with the other per-statement flags (`disableLock`, `skipDataBranchReclaim`, `keepAutoIncrement`) before the object returns to the global reuse pool, and `NewCompile` re-initializes it. The ALTER COPY private-registration opt-out is now a property of the single private preparation generation and can no longer reach an unrelated later `CREATE TABLE` with an inline async/IVF index through pool reuse (`compile.go`).
- The intentional current-generation suppression is unchanged; the versioned design records the pool-boundary ownership of the opt-out (`docs/design/20261010-alter-copy-pre-publication.md`).
- `ignoreCheckExperimental`, the only other assigned-but-unreset sibling in `txnExecutor.Exec`, is pre-existing upstream state from #22428 and is currently assigned-but-never-read; it is outside this PR's introduced delta and left untouched.

Proof on the exact head:

- `TestCompileClearResetsSkipIndexTaskRegistration` exercises the pool reset directly; mutation-verified: removing only the `clear` reset makes it fail while the rest of the fix stays.
- `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy` deterministically reproduces the review's Release -> same-object `NewCompile` pool handoff (single-P, GC disabled) and proves the next frontend Compile starts with the ordinary registration policy.
- `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` proves, on one CN connection, that an ordinary inline IVF-FLAT `CREATE TABLE` registers its `mo_catalog.mo_index_update` `ivfflat_reindex` task before and after `ALTER ... ALGORITHM=COPY` private preparation, and that publication re-registers the replacement index's task.

Validation on the exact head:

- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 27.431s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae` — passed in 10.236s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae/logtailreplay` — passed in 27.991s.
- `- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=1800s ./pkg/tests/issues` — passed in 552.697s (177 tests, 0 failures; includes all `TestIssue29400*` roots and the new registration control). An earlier run of this suite on the same head failed once with a transient `internal error: cn service bootstrap` while the embedded cluster was starting; the identical rerun and every focused cluster test passed.`
- `gofmt -l` over changed Go files, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.

CI-blocker follow-up: the tracked unrelated blocker #30047 (logservice `gossip_fixture_test.go` obsolete `randomPorts.allocate` signature failing UT/SCA/Coverage on run `38347106648`) was closed at `2026-10-13T08:30:47Z`; its fix landed on `main` in `35c8dd5854` and is incorporated by this rebase. This PR does not modify `pkg/logservice`. The push creates a new head and a fresh CI run; the stale failed run is not rerun.


### Current exact head after latest rebase: `4c5051fc77`

Rebased onto current `main` `5d971d07a7` after the PR was reported behind.

- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `7f243d2e4c`; only their base changed.
- The single new upstream commit `5d971d07a7` (empty indexed FK cascades / self-FK ALTER) touches `pkg/sql/plan` and BVT cases with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 16.425s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.110s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.


### Current exact head after latest rebase: `8e5c8b3b53`

Rebased onto current `main` `e17fc0f7fe` after the PR was reported behind again.

- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `4c5051fc77`; only their base changed.
- The two new upstream commits (`6ca4363a73` information_schema rewritten-column hiding, `e17fc0f7fe` prepared row-rule invalidation) touch `pkg/sql/plan`, `pkg/frontend` production files, and BVT cases with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 19.691s; the focused frontend rollback-classification tests this PR extends (`Test_isErrorRollbackWholeTxn`, `TestStaticRollbackSetIsInfrastructureOnly`, and the surrounding rollback roots) — passed in 2.152s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 9.078s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.


### Current exact head after latest rebase: `60e84f43df`

Rebased onto current `main` `c4a210802d` after the PR was reported behind again.

- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `8e5c8b3b53`; only their base changed.
- The four new upstream commits (`5652252431` window hash partitioning, `959d12d3b9` Starlark NULL boundary, `838bf5d1f8` docs MO-scan branch, `c4a210802d` Iceberg adapter module tidy) have no file overlap with this PR's source or test files; the Iceberg commit's workflow change is upstream-owned and untouched here.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 18.864s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.837s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.


### Current exact head after latest rebase: `cd2c40fd52`

Rebased onto current `main` `a53390c57d` after the PR was reported behind again.

- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `60e84f43df`; only their base changed.
- The two new upstream commits are `ec7a910a02` (TIME assignment bounds for external LOAD) and `a53390c57d` (BuildJsonPlan statistics snapshot race). The LOAD commit also touches `pkg/sql/compile/compile.go` in the extern-scan region; the rebase auto-merged it with this PR's `NewCompile`/`clear` flag changes, and both `skipIndexTaskRegistration` resets are verified present on the exact head (compile.go:161 and compile.go:571).
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 14.119s (includes `TestCompileClearResetsSkipIndexTaskRegistration` and `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy`); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 7.801s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.


### Current exact head after latest rebase: `f796e46fb0`

Rebased onto current `main` `071a79b77f` after the PR was reported behind again.

- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `cd2c40fd52`; only their base changed.
- The single new upstream commit `071a79b77f` (preserve row rewrite rules through CTAS) touches `pkg/sql/compile/ddl.go` (`populateCreatedTable`, CTAS INSERT privilege region) and `pkg/sql/compile/sql_executor.go` (rewrite-option attachment in `txnExecutor.Exec`), both outside this PR's hunks; the rebase auto-merged and all three `skipIndexTaskRegistration` sites are verified present (compile.go:161, compile.go:571, sql_executor.go:618).
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 16.696s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.558s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.


### Current exact head after latest rebase: `ad74f1e810`

Rebased onto current `main` `5a0570ea70` after the PR was reported behind again.

- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `f796e46fb0`; only their base changed.
- The three new upstream commits (`2e139d84bf` Kafka Connect recovery qualification harness, `ac98d7bd1f` scalar DESCRIBE view reflection coverage, `5a0570ea70` docs/skills template validation) are test/documentation changes with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 23.443s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.945s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.



### Review update and current exact head: 173bf86f72

Addresses aptend's test-reliability P2 from the deep re-review of `ad74f1e810e2d1b6c360129e326155dc3fa4875c` (that review closed the previous P1 pool-leak blocker and substantiated no further production blocker). The P2: the new pool-handoff regression asserted `sync.Pool` pointer identity, which the pool's documented contract and the race runtime do not support — `Put` drops values with probability 1/4 under the race detector — so the canonical `-race -count=100` validation could fail randomly on a correct implementation (19/100 on the reviewer's run, reproduced locally at compile_test.go:203).

This cycle adds one commit, test-only. At commit time `main` was unchanged (`5a0570ea70083c9365719009a5ed8d7618f9ed91`); it advanced to `55a019f0b0` during validation, so this commit was then rebased before pushing - see the rebase section below for the patch-equivalence record.

- `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy` is now a drop-tolerant, policy-based oracle. Each of 16 rounds seeds the exact leak payload through the real boundary — private executor `Compile` with its executor-set policy, `Release` (`Compile.clear` then `sync.Pool.Put`) — and requires the ordinary registration policy on the frontend `Compile` constructed next by the public `NewCompile`, whichever object the pool returns. Pointer identity is only logged; a legitimate pool drop can never fail the root. Drops cannot mask a leak: inheritance requires a `Put` the pool kept, every kept seed is asserted on the immediately following construction, and with both reset layers present the root is green by construction.
- Non-masking is verified by mutation: with both the `clear()` reset and the `NewCompile` init removed, the root fails deterministically without `-race` at round 0, and fails all 3 invocations with `-race -count=3`; with the resets present, the canonical race command is fully green. The `clear()` reset layer keeps its deterministic, pool-free probe `TestCompileClearResetsSkipIndexTaskRegistration` (removing only the `clear` reset still fails it).
- Exact-head revalidation: `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS 8.500s (100/100); the same command without `-race` — PASS (7.344s); full `./pkg/sql/compile` package - PASS 18.046s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.

### Rebase onto current main: `173bf86f72` (`173bf86f7228cfc5c3ac604294e2581803ee4294`)

`main` advanced from `5a0570ea70` to `55a019f0b0` during the validation above, so the branch was rebased before pushing.

- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the new drop-tolerant handoff test) are patch-equivalent to the pre-rebase head `01fb35bb3a`; only their base changed.
- The three new upstream commits (`944b721d1b` JOIN reset buffers across execution generations — `pkg/sql/colexec/{dedupjoin,hashjoin,indexjoin,loopjoin}`, `821250ea88` recursive-CTE test cases, `55a019f0b0` canonical collation admission tests) have no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation after the rebase: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 18.046s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 8.500s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 18.363s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.



### Current exact head after latest rebase: `2990b63c36` (`2990b63c36c8cd5d6c652f8927503af2a95361cd`)

Rebased onto current `main` `b2e8bc4789` after `main` advanced again while the previous section was being pushed (`55a019f0b0` -> `b2e8bc4789`).

- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the drop-tolerant handoff test) are patch-equivalent to the prior head `173bf86f7228cfc5c3ac604294e2581803ee4294`; only their base changed.
- The single new upstream commit `b2e8bc4789` (remap reused CTE readers after projection pruning) touches `pkg/sql/plan/{cte_reuse.go,query_builder.go}` plus CTE test cases, with no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 25.422s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 8.389s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 8.846s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.



### Current exact head after latest rebase: `0ed0f79634` (`0ed0f79634b20a0f8b8c74d525f91999dc4cd3f1`)

Rebased onto current `main` `fab7b5c043` after the behind event (head `2990b63c36` was reported behind `main` advanced `b2e8bc4789` -> `fab7b5c043` shortly after the previous cycle's push).

- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the drop-tolerant handoff test) are patch-equivalent to the prior head `2990b63c36c8cd5d6c652f8927503af2a95361cd`; only their base changed.
- The single new upstream commit `fab7b5c043` (preserve join predicate ownership during reordering, #30056) touches `pkg/sql/plan/associative_law.go` plus a plan regression test, with no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 14.853s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 10.348s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 7.680s (first invocation of this root during the cycle aborted with `[build failed]`: the Go linker could not reopen cached cgo objects after a build-cache eviction; the identical command was rerun and passed in 7.680s, so the abort was a toolchain cache eviction, not a test failure).
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.



### Current exact head after latest rebase: `16023e02d6` (`16023e02d691abaa1e46fc0481d40cc0509c1c2e`)

Rebased onto current `main` `51300cbd01` after the behind event (head `0ed0f79634` was reported behind; `main` advanced `fab7b5c043` -> `51300cbd01`).

- The single new upstream commit `51300cbd01` (prevent table rename from bypassing role row filters, #29186) is the first upstream commit during this PR's life that also modifies this PR's main production file: `pkg/sql/compile/alter.go` (+183 — new `checkRoleRuleRenameAdmission*` admission gates at the `Scope.RenameTable` entry and the rename-action path of `Scope.AlterTable`, plus new `role_rule_lifecycle.go`), `alter_test.go`, `types.go` (new `Scope.roleRuleRenameAdmissionChecked`), frontend rename/rewrite-rule files, and two `pkg/tests/issues` roots.
- The rebase auto-merged. Semantic integration verified: the rename admission is orthogonal to this PR's ALTER COPY lifecycle — it runs for user rename statements/actions, while `alterTableCopy` publication (broad gate -> endpoint name pins -> source locking/revalidation -> private-replica replace) is untouched by the upstream hunks. Upstream's insertion anchor `reconcileAlterCopyAutoIncrement` is pre-existing `main` machinery from #26197, not part of this PR. `git range-diff` shows eleven commits patch-equivalent and commit 1 (`fix(alter): avoid global lineage gate during physical copy`) with only its import-hunk context shifted by upstream's import additions; no patch content changed.
- Exact-head revalidation, run over the full affected package set because upstream added tests inside the same packages this PR touches: `./pkg/sql/compile` - PASS 13.688s (includes both this PR's lifecycle/pool regression roots and upstream's new rename-admission roots); `./pkg/frontend` - PASS 34.112s (includes upstream's rewrite-rule/authenticate roots and this PR's whole-transaction rollback roots); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 18.887s, no failure in 100 runs; full `./pkg/tests/issues` - PASS 413.353s (includes upstream's new/updated issue_29133/issue_29095 roots and this PR's issue_29400/issue_277xx roots).
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.



### Current exact head after latest rebase: `cb0ded487f` (`cb0ded487f49a9ad3113c654ccf1404949eec24a`)

Rebased onto current `main` `fd4767e488` after the behind event (head `16023e02d6` was reported behind; `main` advanced `51300cbd01` -> `fd4767e488`).

- The single new upstream commit `fd4767e488` (exclude fake primary key from LAST_INSERT_ID, #30004) touches `pkg/incrservice` and its test cases only, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record above remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `16023e02d691abaa1e46fc0481d40cc0509c1c2e`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 14.348s (includes both pool-boundary regression tests); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 8.890s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 8.838s; the upstream-changed `./pkg/incrservice` package - PASS 5.350s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.



### Current exact head after latest rebase: `a9d969890c` (`a9d969890c8a2e9076840237c163af588bce19fb`)

Rebased onto current `main` `a33dcfb2e5` after the behind event (head `cb0ded487f` was reported behind; `main` advanced `fd4767e488` -> `a33dcfb2e5`).

- The single new upstream commit `a33dcfb2e5` (perf: reduce wide-schema work and redundant gossip fixture startup, #30200) touches `pkg/sql/plan/{default_binder.go,build_show_util.go,types.go}` plus plan/logservice tests, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `cb0ded487f49a9ad3113c654ccf1404949eec24a`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 21.080s (includes both pool-boundary regression tests and exercises upstream's plan-binder change through the normal compilation paths); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 7.788s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 7.968s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.



### Current exact head after latest rebase: `7f086296db` (`7f086296db9f32e3ebcd1d59ef36da325bd20fd9`)

Rebased onto current `main` `b1a6da4e16` after the behind event (head `a9d969890c` was reported behind; `main` advanced `a33dcfb2e5` -> `b1a6da4e16`).

- The single new upstream commit `b1a6da4e16` (fix(parser): reject overflowing type lengths and scales, #30176) touches `pkg/sql/parsers/dialect/mysql` plus tests, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `a9d969890c8a2e9076840237c163af588bce19fb`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 13.528s (includes both pool-boundary regression tests); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 9.102s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 9.154s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run. For the record, the prior head `a9d969890c`'s CI had already passed SCA Linux/arm64, UT Coverage on Ubuntu/x86, and the PROXY BVT compose before this rebase superseded it; its remaining checks were still queued/in progress and are replaced by the new run.




### Current exact head after review fix and rebase: `f0840a56e0` (`f0840a56e0d382b3219b449a69a84a53bc957dbe`)

Handles the shared P1 from aptend's thread and XuPeng-SH's mo-bot review (timestamp-only snapshot rewind after workspace-owned advancement), plus the behind event, in one cycle.

- Rebase: `main` advanced `b1a6da4e16` -> `bdbbd17792` (19 upstream commits: parser/plan/aggregate/function fixes, fileservice ENOSPC handling, race-UT runtime reduction, Sirius update; zero file overlap with this PR's delta). The rebase auto-merged; `git range-diff` confirms all twelve prior commits patch-equivalent.
- P1 fix (new commit `fix(alter): retain workspace-owned snapshot on copy return`): `alterTableCopy` no longer rewinds only the transaction timestamp after the pre-copy `databranchutils.AdvanceLineageSnapshot` workspace advancement. The rewind defer reintroduced by this PR's first commit was the exact defect main's #29539 removed; after `Workspace.AdvanceSnapshot` relocates transaction-local tombstones, a timestamp-only rewind leaves the workspace and snapshot in different generations and resurrects relocated deletes of earlier uncommitted DML. The workspace-owned advanced snapshot is now retained on every return path, matching the publication-side advance and the other owners; the duplicated `isTemp`/non-temporary advance branches collapsed into one mode-gated call. The design doc records the ownership rule and its #29539 lineage.
- New tests: `TestAlterCopyRetainsWorkspaceAdvancedSnapshotOnEveryReturn` (pessimistic-RC `Scope.AlterTableCopy`; any `SetSnapshotTS` rewind fails the test; retention asserted across the workspace-advance-failure and post-advance physical-copy-failure returns; mutation-verified in both directions) and `TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn` (real cluster: uncommitted in-memory DELETEs survive a forced DN flush and the ALTER COPY return inside the same pessimistic-RC transaction and after commit).
- Exact-head validation: full `./pkg/sql/compile` - PASS 14.987s; the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 7.286s, no failure in 100 runs; both new roots - PASS; full `./pkg/tests/issues` - PASS 329.117s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's green CI run is superseded by this push; the new head produces a fresh CI run.




### Current exact head after latest rebase: `ebda98e960` (`ebda98e960e398f4436338f6353f1064d5009161`)

Rebased onto current `main` `501c85ecdd` after the behind event (head `f0840a56e0` was reported behind; `main` advanced `bdbbd17792` -> `501c85ecdd`). No code change in this cycle.

- The single new upstream commit `501c85ecdd` (perf(test): shorten embed and isolated race process lifetimes, #30249) touches `Makefile`, `optools/run_ut.sh`, and `optools/ut_embedded_schedule_test.go` only — test-infrastructure files with zero overlap with this PR's delta; the rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the prior head `f0840a56e0d382b3219b449a69a84a53bc957dbe`; only their base changed.
- Exact-head validation: full `./pkg/sql/compile` - PASS 13.871s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 6.486s, no failure in 100 runs; focused issue roots in `./pkg/tests/issues` (`TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn`, `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation`, `TestIssue29400IndependentCopyAltersProgressInPessimisticRC`) - PASS 9.997s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.




### Current exact head after latest rebase: `9c2e6a6257` (`9c2e6a62574f0b34881fb14a48561ebe4cd054dd`)

Rebased onto current `main` `f2093ae4b3` after the behind event (head `ebda98e960` was reported behind; `main` advanced `501c85ecdd` -> `f2093ae4b3`). No code change in this cycle.

- The two new upstream commits — `f2093ae4b3` (fix(json): reject wildcard and range paths in JSON_KEYS, #28328) and `bb2b725d0a` (fix(shardservice): preserve immutable read cache snapshots, #30187) — touch `pkg/common/moerr/error.go`, `pkg/container/bytejson`, `pkg/shardservice`, `pkg/sql/plan/function` JSON files, and BVT cases, with zero file overlap with this PR's delta. The rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the approved head `ebda98e960e398f4436338f6353f1064d5009161`; only their base changed, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`) and the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), both recorded on `ebda98e960`, and the amended-design PASS (issuecomment-6186238709) review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 14.281s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 9.351s, no failure in 100 runs; the upstream-adjacent `./pkg/common/moerr` - PASS 0.492s; focused issue roots in `./pkg/tests/issues` (`TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn`, `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation`, `TestIssue29400IndependentCopyAltersProgressInPessimisticRC`) - PASS 8.902s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's terminally green CI run (38688137369, CI Required SUCCESS) is superseded by this push; the new head produces a fresh CI run.




### Current exact head after latest rebase: `ce9ed59493` (`ce9ed594933ffe3cf2ea8403b561956d1c833eac`)

Rebased onto current `main` `461bc8e349` after the behind event (head `9c2e6a6257` was reported behind; `main` advanced `f2093ae4b3` -> `461bc8e349`). No code change in this cycle.

- The two new upstream commits — `461bc8e349` (fix(plan): omit overwritten implicit fulltext ordering, #30189) and `b5a4d5c795` (fix(frontend): enforce Starlark OUT and INOUT parameter types, #30134) — touch `pkg/sql/plan` fulltext-index files, `pkg/frontend` Starlark files, and embed/config tests, with zero file overlap with this PR's delta. The rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the approved head `9c2e6a62574f0b34881fb14a48561ebe4cd054dd`; only their base changed, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`), the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), and the amended-design PASS (issuecomment-6186238709) continue to review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 15.167s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 7.856s, no failure in 100 runs; the upstream-modified `./pkg/frontend` (includes both this PR's whole-transaction rollback roots and upstream's new Starlark roots) - PASS 28.287s; focused issue roots in `./pkg/tests/issues` (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers) - PASS 9.759s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.



### Current exact head after latest rebase: `a0e40253d0` (`a0e40253d0488e9c9f0b96752dec0724296df85d`)

Rebased onto current `main` `c46b893f61` after the behind event (head `ce9ed59493` was reported behind base `461bc8e349`, then conflicting while `main` advanced `461bc8e349` -> `83222fa837` -> `c46b893f61`). No PR-side behavior change in this cycle.

- The base hop through `83222fa837` picks up `8795f3699b` (revert: restore fulltext planner before #30189, #30285), upstream's fix for the CI blocker that failed the previous head's run `38703760162`: #30189's widened `tryApplyCoveredFulltext2` missed the stale call site at `apply_indices_fulltext_snapshot_test.go:180-182` and broke the `pkg/sql/plan` test build, failing SCA Linux/arm64, UT Coverage Ubuntu/x86, and UT Test Ubuntu/x86, blocking the Coverage merge at its `Verify coverage prerequisites` step, and turning the `CI Required` gatekeeper red — one verified root cause, pre-existing on `main`, with this PR contributing zero lines to `pkg/sql/plan`. The current base additionally contains the properly re-landed fulltext work `e8b3ed7f21` (fix(plan): integrate fulltext ordering and covered score limits, #30289); `mo-cgo-test -run '^$' ./pkg/sql/plan` passes on this head, so the defect is gone from the merge result.
- The rebase required a semantic interleave in two hunks where upstream `b6789851ca` (#30222) added the statement-retry `lastInsertIDBaseline` to the exact `Compile` flag block this PR extends: `types.go` now declares both upstream's `lastInsertIDBaseline uint64` (with its retry-restore comment) and this PR's `skipIndexTaskRegistration bool`, and `clear()` resets both (`c.lastInsertIDBaseline = 0` upstream; `c.skipIndexTaskRegistration = false` this PR, beside the other per-statement flags). Upstream's compile2.go save/restore pair is untouched and this PR's pool boundary is unchanged. Upstream `a85d90efc9` (#30334) also added cross-CN `SYNCCOMMIT` fences to its own `TestIssue29400CopyAlterRetainedGatePromotionFastFails` root inside `pkg/tests/issues/issue_29400_test.go`; the merged file keeps those fences and this PR's roots. The whitespace part of the resolution was folded into commit 10, preserving the clean 13-commit stack.
- `git range-diff` shows eleven PR commits patch-equivalent; commits 10 and 11 differ only by the interleaved upstream field/reset inside their existing hunks — every line the PR itself adds is unchanged, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`), the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), the design-first PASS (issuecomment-6141109182), and the amended-design PASS (issuecomment-6186238709) continue to review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 34.197s (includes this PR's lifecycle/pool roots and upstream's new retry-baseline and calendar-interval roots); full `./pkg/frontend` - PASS 21.086s (includes upstream's show-metadata/authenticate changes and this PR's whole-transaction rollback roots); `./pkg/sql/plan` build check - ok 1.443s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 4.120s, no failure in 100 runs; focused roots in `./pkg/tests/issues` (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers, plus upstream's re-fenced retained-gate root in the shared file) - PASS 11.945s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's red run `38703760162` (verified upstream-caused) is superseded; this push produces a fresh CI run for the new head.



### Current exact head after latest rebase: `2f4f928170` (`2f4f928170cb614dd8570ff6f4151f98dc1d4821`)

Rebased onto current `main` `76deafc806` after the behind event (head `a0e40253d0` was reported behind; `main` advanced `c46b893f61` -> `76deafc806`). No code change in this cycle.

- The single new upstream commit `76deafc806` (fix: report SELECT division-by-zero warnings, #30314) touches `pkg/sql/compile` expression/remoterun protocol files plus new division-warning test roots, `pkg/sql/plan/function/arithmetic.go` plus new plan test roots, rege…

This branch was previously deployed

1 inactive deployment
ci — 9ef3538f Deployed Oct 16, 2026 by mergify[bot]
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 size/XL Denotes a PR that changes [1000, 1999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants