Skip to content

fix: avoid global lineage gate during ALTER COPY preparation - #29798

Merged
mergify[bot] merged 16 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-29208-105e4888
Oct 18, 2026
Merged

mergify[bot] merged 16 commits into
matrixorigin:mainfrom
gouhongshen:agent/issue-29208-105e4888

Conversation

@gouhongshen

@gouhongshen gouhongshen commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Related to #29208.

What this PR does / why we need it:

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 [Bug]: pr-size-label fails when the runner proxy drops the GitHub API TLS connection #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:

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:

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 enable partition feature #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 allTestIssue29400*roots and the new registration control). An earlier run of this suite on the same head failed once with a transientinternal 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: 173bf86

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, fix: 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, fix: 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 fix: reconcile auto-increment state for copy and clone #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, fix(insert): exclude fake primary key from LAST_INSERT_ID (#29903) #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, 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, 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 fix: preserve tombstones across lineage snapshot advances #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 fix: preserve tombstones across lineage snapshot advances #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, 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, fix(json): reject wildcard and range paths in JSON_KEYS #28328) and bb2b725d0a (fix(shardservice): preserve immutable read cache snapshots, 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, fix(plan): omit overwritten implicit fulltext ordering #30189) and b5a4d5c795 (fix(frontend): enforce Starlark OUT and INOUT parameter types, 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 fix(plan): omit overwritten implicit fulltext ordering #30189, revert: restore fulltext planner before #30189 #30285), upstream's fix for the CI blocker that failed the previous head's run 38703760162: fix(plan): omit overwritten implicit fulltext ordering #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, 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 (fix(compile): retry restores the statement's LAST_INSERT_ID baseline (#29903) #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 (test: reduce race fixture work and fix ISCP and cross-CN test synchronization #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, 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, regenerated pkg/pb/pipeline, pkg/defines, and pkg/sql/colexec — 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 previous head a0e40253d0, which itself carried the documented semantic interleave with upstream fix(compile): retry restores the statement's LAST_INSERT_ID baseline (#29903) #30222/test: reduce race fixture work and fix ISCP and cross-CN test synchronization #30334 inside commits 10/11; 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 17.188s (includes this PR's lifecycle/pool roots and upstream's new division-warning protocol roots); ./pkg/sql/plan build check - ok 1.925s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 7.492s, 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 13.674s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI run 38843646044 is superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: 02ec55ad2d (02ec55ad2dc9033a20053fe34ca0ef29957ebfaa)

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

  • The single new upstream commit b24d1b3115 (fix(window): support temporal interval frame parameters and string parsing, fix(window): support temporal interval frame parameters and string parsing #30310) adds pkg/container/types/window_interval.go, pkg/sql/colexec/window/interval*, pkg/sql/plan/visit_plan_rule.go changes, and increments pkg/sql/compile/compile.go (+6), compile2.go (+4), and compile_test.go (+27). The rebase auto-merged; the previously documented clear()/constructor interleave (upstream lastInsertIDBaseline beside this PR's skipIndexTaskRegistration) is unchanged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head 2f4f928170, 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 13.762s (includes upstream's new window-frame roots and this PR's lifecycle/pool roots); ./pkg/sql/plan build check - ok 1.486s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 9.581s, 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 13.433s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI run 38847713751 is superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: da8284097c (da8284097c5449367456c7ce614d8fb4c9f66f38)

Rebased onto current main ac55588b8d after the behind event (head 02ec55ad2d was reported behind; main advanced b24d1b3115 -> ac55588b8d). No code change in this cycle.

  • The single new upstream commit ac55588b8d (fix(lockservice): balance row waiter and range ownership lifetimes, fix(lockservice): balance row waiter and range ownership lifetimes #30321) is confined to pkg/lockservice (lock_table_local.go, waiter_events.go, and new waiter-retry/conditional-unlock/benchmark tests) — zero file overlap with this PR's delta. The rebase auto-merged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head 02ec55ad2d, 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: the upstream-modified ./pkg/lockservice - PASS 71.228s (upstream's new waiter-retry and conditional-unlock roots; the lock service owns the gate/source locks this PR's pessimistic publication paths acquire); full ./pkg/sql/compile - PASS 27.274s; ./pkg/sql/plan build check - ok 2.581s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 10.463s, 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 15.447s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's CI run 38849507295 (build, SCA Linux/arm64, UT Coverage, Coverage, proxy and multi-CN pessimistic BVT all SUCCESS; UT Test still running when the behind event arrived) is superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: 6b2e7efd14 (6b2e7efd14359649c6bc245facacaed5d12c1c54)

Rebased onto current main ad0568a82c after the behind event (head da8284097c was reported behind; main advanced ac55588b8d -> ad0568a82c). No code change in this cycle.

  • The single new upstream commit ad0568a82c (refactor(sirius): use embedded MO readers and remove Flight, refactor(sirius): use embedded MO readers and remove Flight #30251) rewrites the Sirius/sidecar surface across 88 files (pkg/sql/compile/sirius*, sidecarflight/, siriusbridge/, pkg/sql/plan/substrait/*, pkg/vm/engine/disttae/{txn.go,object_list.go,sidecar/,logtailreplay/object_list.go}, design docs). Its only direct file overlap with this PR's delta is pkg/vm/engine/disttae/txn_table_delegate.go, where upstream removed the sidecar snapshot-visit methods (VisitSnapshotObjects, HasSnapshotTombstones, CanVisitSnapshotLocally) while this PR adds CreatedInCurrentTxn between CollectChanges and CollectObjectList; the hunks are disjoint, the rebase auto-merged, and the merged file keeps both sides' intent — the PR's delegate method is intact, the upstream removals are applied, and no PR-added code references any removed symbol.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head da8284097c, 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 over the upstream-modified packages that overlap this PR's engine/compile delta: full ./pkg/sql/compile - PASS 14.912s (upstream's embedded-Sirius rewrite compiled together with this PR's lifecycle/pool roots); full ./pkg/vm/engine/disttae - PASS 7.276s; full ./pkg/vm/engine/disttae/logtailreplay - PASS 7.853s; ./pkg/sql/plan build check - ok 4.558s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 5.851s, 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 12.849s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI runs (38862657021 family, started for da8284097c) are superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: bae0af149e (bae0af149e5a10b00c16e133c7ca74bd34098a71)

Rebased onto current main 2305954d0b after the behind event (head 6b2e7efd14 was reported behind base 575d57ae55; while handling it, main had already advanced to 2305954d0b). No code change in this cycle.

  • The two new upstream commits — 575d57ae55 (perf(container): speed up column summaries and UTF8 counting, perf(container): speed up column summaries and UTF8 counting #30338) and 2305954d0b (perf(spill): amortize bounded writes and incremental recovery projection, perf(spill): amortize bounded writes and incremental recovery projection #30284) — touch 15 files across pkg/container/vector, pkg/vectorize/lengthutf8, pkg/sql/colexec/{hashbuild,spillio,spillutil}, pkg/sql/plan/function, pkg/vm/engine/tae/index, and pkg/vm/process, 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 previous head 6b2e7efd14, 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 13.439s (this PR's lifecycle/pool roots compiled with upstream's vector/spill performance changes); ./pkg/sql/plan build check - ok 1.991s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 9.309s, 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 14.386s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI runs (38866612162 family, started for 6b2e7efd14) are superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: 604026934a (604026934aa513da88f4698d4456970843ce81c3)

Rebased onto current main ac9dbfeeec after the behind event (head bae0af149e was reported behind; main advanced 2305954d0b -> ac9dbfeeec with the frontend NEWDECIMAL commit that had arrived while the previous rebase was being finalized). No code change in this cycle.

  • The single new upstream commit ac9dbfeeec (fix(frontend): advertise NEWDECIMAL for SELECT DECIMAL wire metadata, fix(frontend): advertise NEWDECIMAL for SELECT DECIMAL wire metadata #30302) touches pkg/frontend/mysql_protocol.go, pkg/frontend/mysql_protocol_test.go, and the new pkg/frontend/decimal_wire_metadata_test.go — zero file overlap with this PR's delta (the PR's frontend files are rollback_on_error_test.go and util_test.go). The rebase auto-merged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head bae0af149e, 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, including the upstream-modified package that carries this PR's whole-transaction rollback roots: full ./pkg/frontend - PASS 21.463s (upstream's NEWDECIMAL wire-metadata roots compiled together with this PR's rollback roots); full ./pkg/sql/compile - PASS 13.873s; ./pkg/sql/plan build check - ok 1.588s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 6.418s, 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 13.475s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI runs (38868998507/38868998568 families, started for bae0af149e) are superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: 6ae11fd41e (6ae11fd41e2cf5922e80eb9733ebe9bf4c397ebd)

Rebased onto current main 4f9f2e33c9 after the behind event (head 604026934a was reported behind; main advanced ac9dbfeeec -> 4f9f2e33c9). No code change in this cycle.

  • The single new upstream commit 4f9f2e33c9 (fix: evict idle lock routes after CN scale-down, fix: evict idle lock routes after CN scale-down #30269) touches 11 pkg/lockservice files (idle_route*, lock_table_keeper*, lock_table_remote*, rpc.go, service.go) plus a new isolated issue root in pkg/tests/issues/isolated/ — zero file overlap with this PR's delta. The rebase auto-merged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head 604026934a, 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, including the upstream-modified package because the lock service owns the gate/source locks this PR's pessimistic publication paths acquire: full ./pkg/lockservice - PASS 89.576s (upstream's new idle-route eviction/cleanup/publication roots); full ./pkg/sql/compile - PASS 14.138s; ./pkg/sql/plan build check - ok 1.637s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 14.032s, 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 20.618s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI runs (38870465190/38870465055 families, started for 604026934a) are superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: 0a4cedb775 (0a4cedb775f184a73f1ecba2713d90c3dbb1e01d)

Rebased onto current main c2b990cd71 after the behind event (head 6ae11fd41e was reported behind; main advanced 4f9f2e33c9 -> c2b990cd71 with the two commits that had arrived while the previous rebase was being finalized). No code change in this cycle.

  • The two new upstream commits — 61e8b454ce (fix(frontend): scope role-rule invalidation to owning account, fix(frontend): scope role-rule invalidation to owning account #30358, in pkg/frontend/{authenticate*,rewrite_rule*,session.go} plus accesscontrol BVT cases) and c2b990cd71 (fix(process): discard stale automatic spill disk capacity samples, fix(process): discard stale automatic spill disk capacity samples #30356, in pkg/vm/process/execution_resource_budget*/spill_disk_refresh*) — touch 12 files with zero overlap with this PR's delta (the PR's frontend files are rollback_on_error_test.go and util_test.go). The rebase auto-merged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head 6ae11fd41e, 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, including the upstream-modified package that carries this PR's whole-transaction rollback roots: full ./pkg/frontend - PASS 15.109s (upstream's role-rule invalidation scoping compiled together with this PR's rollback roots); full ./pkg/sql/compile - PASS 12.720s; ./pkg/sql/plan build check - ok 1.477s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 6.419s, 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 15.289s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI runs (38873509822 family, started for 6ae11fd41e) are superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: 6a2b64bb82 (6a2b64bb829e46429309e8f7743c7956db855cdf)

Rebased onto current main b3d6b21fe9 after the behind event (head 0a4cedb775 was reported behind base 7c61f67e5d; main had advanced past that while the previous rebase was being finalized). No code change in this cycle.

  • The three new upstream commits — 9f873692e0 (fix(sql): preserve COLLATE expressions and resolve coercibility C04, fix(sql): preserve COLLATE expressions and resolve coercibility (C04) #29892), 7c61f67e5d (perf(container): optimize appends, validity ranges and typed reads, perf(container): optimize appends, validity ranges and typed reads #30160), and b3d6b21fe9 (fix(frontend): admit native Unicode handshake collations, fix(frontend): admit native Unicode handshake collations #30093) — touch 82 files across pkg/common/collation, pkg/container/{nulls,vector}, pkg/frontend, pkg/sql/parsers, pkg/sql/plan/{,function}, pkg/sql/compile/{remoterun.go,expression*}, pkg/pb/plan, and BVT cases. Their only direct file overlap with this PR's delta is pkg/frontend/util_test.go: upstream added its TestCollectScalarSubqueriesCollate root near the top of the file while this PR's single-line TxnWriteConflict rollback assertion sits in Test_isErrorRollbackWholeTxn ~1360 lines below — disjoint hunks, the rebase auto-merged, and the merged file keeps both sides verified (NewTxnWriteConflictNoCtx assert present at line 1460; upstream's new root present).
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head 0a4cedb775, 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 over the upstream-modified packages that carry this PR's roots: full ./pkg/frontend - PASS 20.802s (upstream's collation roots compiled together with this PR's whole-transaction rollback roots); full ./pkg/sql/compile - PASS 14.335s (includes upstream's remoterun/expression-protocol changes); ./pkg/sql/plan build check - ok 1.675s (upstream heavily modified plan); the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 7.497s, 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 15.440s.
  • gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's in-progress CI runs (38876060429 family, started for 0a4cedb775) are superseded; this push produces a fresh CI run for the new head.

Current exact head after latest rebase: f6f20a37fd (f6f20a37fd4383a40e6b642ec3804371eeea6445)

Rebased onto current main 2cf7684062 after a ci_failures event: the previous head 6a2b64bb82 was behind, and recovery followed the freshness rule (rebase + push supersedes the stale run; no rerun of the stale run was requested). No code change in this cycle.

  • CI failure record, resolved as unrelated: run 38882194805 (attempt 1, old head) failed Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 (job 116916731411) with one root — pkg/tests/issues/isolated / TestDropDatabaseAfterCNScaleDown, --- FAIL (26.50s). Verified evidence: the failing root is the isolated embedded-cluster regression test added by upstream fix: evict idle lock routes after CN scale-down #30269 for the DROP DATABASE ... lock table bind changed class after controlled 3 CN -> 1 CN scale-down (open upstream issue [Bug]: DROP DATABASE fails with lock table bind changed after controlled 3 CN to 1 CN scale-down #29447); the failing window logged lock table bind changed on a moadmin session, matching the issue's error class; this PR contributes zero lines to every package the test exercises (git diff origin/main...HEAD -- pkg/lockservice pkg/tests/issues/isolated/ pkg/embed is empty). A reproduction record was posted on [Bug]: DROP DATABASE fails with lock table bind changed after controlled 3 CN to 1 CN scale-down #29447 (issuecomment-6214046587), and the CI-blockers tracking comment now records {"blockers":[{"issue":29447,...}]}.
  • The five new upstream commits — 5c10d8a99f (fix(compile): execute ALTER VIEW on the schema-qualified database, [Bug]: ALTER VIEW with a qualified target resolves the target in the current database #30296), 5f9a8c3138 (fix(plan): scalar subqueries in INSERT VALUES, fix(plan): support scalar subqueries in INSERT VALUES with cold admission #30220), 14a8d854b0 (fix(plan): EXPLAIN sequence formatting, fix(plan): let EXPLAIN format sequence functions in group keys #30386), 3478692905 (fix(mo-tool): text/blob subtypes in checkpoint DDL, fix(mo-tool): preserve text and blob subtypes in checkpoint DDL #30374), 2cf7684062 (fix(plan): validate catalog collation metadata before pruning, fix(plan): validate catalog collation metadata before pruning #29056) — intersect this PR's delta only in pkg/sql/compile/ddl.go/ddl_test.go, where upstream's AlterView change (line ~667) is far from this PR's createTable index-registration gate (~2346) and TruncateTable admission (~4083); the hunks are disjoint and the rebase auto-merged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head 6a2b64bb82, 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 12.758s (includes upstream's ALTER VIEW roots and this PR's lifecycle/pool roots); ./pkg/sql/plan build check - ok 1.302s (three upstream plan commits); the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 8.241s, 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 204.004s (shared-runner load). gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The fresh CI run for this head supersedes run 38882194805.

Current exact head after latest rebase: 56fdf0f82c (56fdf0f82c321c5ebcbe763e846874c7399bcf95)

Rebased onto current main 6b081a1fcf after a ci_failures event: the run for the previous head failed during job setup and the PR was behind, so recovery followed the freshness rule (rebase + push; no rerun of the stale run). No code change in this cycle.

  • CI failure record, resolved as unrelated: run 38890955566 (attempt 1, previous head) failed Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 (job 116940230290) at the Set up Go step with ##[error]Client network socket disconnected before secure TLS connection was established; checkout had succeeded and every test step was skipped — a transient cold-toolchain provisioning flake, unrelated to any repository code. A matching open upstream issue ([Bug]: UT coverage setup action times out during cold Go/JDK provisioning #28652, "UT coverage setup action times out during cold Go/JDK provisioning") exists, so a reproduction record was posted there (issuecomment-6214432805), no issue was created, and the CI-blockers tracking comment now records both verified blockers with existing issues: #29447 (the previous event's TestDropDatabaseAfterCNScaleDown failure; its behavior on the new head is still unverified because the superseded run never reached tests) and #28652 (this provisioning flake).
  • The four new upstream commits — 0bf5bc7058 (fix(aggexec): support YEAR input for variance/stddev, [Bug]: statistical aggregates accept YEAR at binding but fail in the executor #30181), 8037b4832f (test: give truncate FK identity statements individual operation budgets, test: give truncate FK identity statements individual operation budgets #30383), ec62e1d879 (test: fence cross-CN view visibility, test: fence cross-CN view visibility in prepared-reader rebind test #30382), 6b081a1fcf (test(iscp): wait for watermark transitions, test(iscp): wait for watermark transitions against the test context budget #30385) — touch pkg/sql/colexec/aggexec/vardev2*, pkg/tests/issues/issue_29852_test.go/issue_30090_test.go, pkg/vm/engine/test/change_handle_test.go, and BVT function cases — zero file overlap with this PR's delta. The rebase auto-merged.
  • git range-diff confirms all thirteen PR commits patch-equivalent to the previous head f6f20a37fd, 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 13.544s; ./pkg/sql/plan build check - ok 1.720s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) - PASS 6.849s, 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 15.116s. gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The fresh CI run for this head supersedes run 38890955566.

Current exact head after latest rebase: 666ff98 (666ff98)

Rebased onto current main 65bcea5d24 after a conflict event (GitHub reported mergeStateStatus: DIRTY). main advanced by eighteen commits; this cycle resolves exactly one genuine content conflict, semantically, in pkg/util/executor/types.go.

Why the histories conflicted, and the resolution:

  • Upstream 18d5335ee3 (Fix: Unify SQL server file access authority #30212, unify SQL server file access authority) and this PR both rewrite the same StatementOption struct block in pkg/util/executor/types.go, which is why GitHub marked the PR DIRTY: upstream added the accountName/roleName session-identity fields behind a three-line comment that also re-split gofmt's field-alignment groups for the first five fields, while this PR (commit 10) realigned the same block to add skipIndexTaskRegistration. The merge is two-sided: the resolved struct keeps upstream's five-field group, its comment, and accountName/roleName, plus this PR's skipIndexTaskRegistration in the recomputed second alignment group; gofmt -l is clean on the result. No line from either side was discarded.
  • Every other direct file overlap auto-merged because the hunks are disjoint, and the merged files keep both sides: alter.go/alter_test.go (upstream 85d03e833e rewrote updateNewTableColId's quadratic column-ID map and appended TestUpdateNewTableColID next to this PR's lifecycle surfaces); compile.go (upstream 18d5335ee3 propagates WithSessionIdentity in runSqlWithResultAndOptions — the same helper this PR threads internalStatementOption through — plus e44d8f9bef's S3 flush analyze control and 7387b96afd's LOAD boundary split; 43c4771168's CTAS sequence state in ddl.go sits beside this PR's createTable registration gate); sql_executor.go (upstream's Params() error-return and sequence-state plumbing beside this PR's skipIndexTaskRegistration assignment); issue_29400_test.go (47b9690d7c gave each subtest of the shared retained-gate root its own deadline, alongside this PR's three roots, unchanged).
  • git range-diff against the previous head 56fdf0f82c shows twelve of thirteen PR commits patch-equivalent; commit 10 (239bcc963c) differs only by the struct interleave above, so every line the PR itself adds is unchanged. 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.

Tracked CI blockers, resolved and verified: the fresh run for the previous head, 38893412045, completed terminally green — Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 (job 116948706903) ran the full suite including the previously failing pkg/tests/issues/isolated/TestDropDatabaseAfterCNScaleDown and concluded success, and the CI Required gatekeeper (job 117032719116) reported SUCCESS. This verifies the resolution of both tracked blockers on that head: #29447 (the isolated CN-scale-down root passed under the same UT Coverage job that failed before) and #28652 (the Set up Go cold-toolchain TLS flake did not recur; setup completed and the suite was green). The CI-blockers tracking comment now records both resolutions and tracks no open blockers. The push of this rebased head produces a fresh CI run for the new head.

Exact-head validation:

  • Full ./pkg/sql/compile — PASS 15.816s (upstream's new TestUpdateNewTableColID, sequence-state, load-boundary and analyze-control roots compiled together with this PR's lifecycle/pool roots).
  • Full ./pkg/frontend — PASS 20.115s (upstream's authenticate/export/session changes alongside this PR's whole-transaction rollback roots).
  • Full ./pkg/util/executor — PASS 1.992s (upstream's new options_test.go roots and error-returning Params() compiled with this PR's skipIndexTaskRegistration option pair; the merged struct is exercised).
  • Full ./pkg/vm/engine/disttae — PASS 7.783s; full ./pkg/vm/engine/disttae/logtailreplay — PASS 2.382s.
  • ./pkg/sql/plan build check — ok 2.613s.
  • Canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) — PASS 8.731s, no failure in 100 runs.
  • Four focused ./pkg/tests/issues roots (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers, plus upstream's deadline-rescoped retained-gate root in the shared file) — PASS 14.482s.
  • gofmt -l over the delta, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head.

Current exact head after exact fix and rebase: 0e0f496 (0e0f496)

Fixes the review P2 from the 666ff988d1 review (PRR_kwDOFEPiGM8AAAABS3d1LA, thread PRRT_kwDOFEPiGM6tmjHP): independent COPY ALTER publication failed terminal-fast (MySQL 20706) for HASH-partitioned and AUTO_INCREMENT sources, because service-owned catalog SQL did not inherit the private-preparation lock policy.

  • Root cause, in two hops. (1) txnExecutor.Exec compiles the private temporary CREATE with WithDisableLock, but the SQL that CREATE triggers indirectly on the same transaction — partitionservice metadata INSERTs and incrservice column INSERTs, both executed on service executors with fresh StatementOption{} — re-armed public catalog locks publication admission cannot certify as private. (2) The allocator had a second hole beyond the CREATE-path INSERT: reconcileAlterCopyAutoIncrement runs on the outer ALTER context before the gate, and its svc.SetOffset UPDATE into mo_catalog.mo_increment_columns retained public catalog locks even after hop (1) was fixed — reproduced locally before the second fix as the same 20706.
  • Fix: the internal SQL executor (pkg/sql/compile/sql_executor.go) marks the statement tree of every lock-free internal statement, and nested executions — service executors included — inherit WithDisableLock from that context; reconcileAlterCopyAutoIncrement now runs inside the same lock-free statement tree. The rows those services write address keys unique to the in-flight private replacement (new table IDs, its partition children, its allocator rows), so the same isolation argument as the nested CREATE applies; nothing was blanket-whitelisted and every unproven retained owner keeps fast-fail. The design doc records the completed scope of the lock-free policy in the preparation section and verification map.
  • Dead code flagged by the same review is removed: the transient-index-task cleanup branch in alterTableCopy that alterCopyCreateOptions made unreachable (SkipIndexTaskRegistration is always set). The late replacementAdmission.createNames assignment in TruncateTable is kept: it has a live consumer — withDropLifecycle installs the admission as the dropLifecycleReceipt, and the nested replacement CREATE (whose options carry no WithDisableLock) consults receipt.admission.createNames in pinCreateNames (lifecycle_fk_scope.go:583); removing it would fail delete-mode TRUNCATE's replacement with "CREATE exceeds admitted replacement names".
  • TestIssue29400IndependentCopyAltersProgressInPessimisticRC/held_explicit_transaction now covers three victim layouts selecting every service-owned catalog write: unaffected IVF-FLAT index, HASH-partitioned, and AUTO_INCREMENT. Mutation-verified on the exact fix lineage: with only the production change reverted, the regression reproduces the review's counterexample exactly — index control PASSes while both new layouts FAIL with 20706 before the holder commits; with the fix all three wait at the gate and succeed. TestIssue29400CopyAlterRetainedGatePromotionFastFails and the other shared roots stay green.
  • Stack: the fix is one new commit on top of the previously approved series; git range-diff shows all thirteen prior commits patch-equivalent (aptend APPROVE PRR_kwDOFEPiGM8AAAABSZFhbw, mo-bot approve PRR_kwDOFEPiGM8AAAABSZQRVg, design PASSes issuecomment-6141109182 and issuecomment-6186238709 continue to review exactly that code) plus the new fourteenth commit. The head is rebased onto current main 8ed73ff815 (ten new upstream commits; only 7c2847207d (fix(sql): persist charset defaults and implement table conversion #29374 charset/CONVERT) touches PR files, with additive disjoint hunks — charset fields in alterCopyPkColumnValueUnchanged, the AlterDatabase magic type, and txnTable.AlterTable extra-info fields — and the rebase auto-merged).
  • Exact-head validation: full ./pkg/sql/compile — PASS 13.110s; focused ./pkg/tests/issues roots (relocated workspace-delete retention, ordinary indexed-CREATE registration, the three-layout independent pessimistic-RC publishers, plus upstream's retained-gate root) — PASS 25.440s; full ./pkg/frontend — PASS 22.972s; full ./pkg/vm/engine/disttae — PASS 8.039s; ./pkg/sql/plan build check — ok 3.108s; canonical race command ×100 — PASS 6.354s, no failure. gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed. This push supersedes green CI run 38995621936 with a fresh run for the new head.

Current exact head after latest rebase: cc26004214 (cc2600421437473cb0e9658b139822c3f9ef90a5)

Rebased onto current main 3c07fac240 after the behind event for the 0e0f496225 head (the branch was reported behind base 154a24d463; main had advanced once more by fetch time, and the rebase is onto the current tip). No code change in this cycle.

  • The two new upstream commits — 154a24d463 (fix(load): keep trailing-CR strip inside the current field, fix(load): keep trailing-CR strip inside the current field #30498, in pkg/sql/util/csvparser/csv_parser.go plus a new test file) and 3c07fac240 (perf(python-sdk): chunk vector batch inserts in one transaction, perf(python-sdk): chunk vector batch inserts in one transaction #30076, in clients/python/** only) — have zero file overlap with this PR's 27-file delta. The rebase auto-merged.
  • git range-diff confirms all fourteen PR commits patch-equivalent to the previous head 0e0f496225: the thirteen-commit reviewed series plus the service-catalog-SQL fix answering the 666ff988d1 review P2. The aptend implementation APPROVE (PRR_kwDOFEPiGM8AAAABSZFhbw, re-affirmed as PRR_kwDOFEPiGM8AAAABSpGJUw), the mo-bot approve (PRR_kwDOFEPiGM8AAAABSZQRVg), the design-first PASS (issuecomment-6141109182), and the amended-design PASS (issuecomment-6186238709) continue to review exactly that code; the fourteenth commit remains under XuPeng-SH/reviewer re-review.
  • Exact-head validation: full ./pkg/sql/compile — PASS 16.367s; full ./pkg/frontend — PASS 56.132s; full ./pkg/util/executor — PASS 0.688s; full ./pkg/vm/engine/disttae — PASS 7.602s; full ./pkg/vm/engine/disttae/logtailreplay — PASS 5.448s; ./pkg/sql/plan build check — ok 5.640s; canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) — PASS 14.630s, no failure in 100 runs; the four focused ./pkg/tests/issues roots (relocated workspace-delete retention, ordinary indexed-CREATE registration, the three-layout independent pessimistic-RC publishers, plus upstream's re-fenced retained-gate root in the shared file) — PASS 20.049s.
  • gofmt -l over the delta, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's terminally green CI run 39094077072 is superseded; this push produces a fresh CI run for the new head.

@mergify mergify Bot added the kind/bug Something isn't working label Oct 9, 2026
@gouhongshen
gouhongshen force-pushed the agent/issue-29208-105e4888 branch from 03a27ec to 178b276 Compare October 10, 2026 06:01
@matrix-meow matrix-meow added the size/XL Denotes a PR that changes [1000, 1999] lines label Oct 10, 2026
@gouhongshen

gouhongshen commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

PR #29798 currently tracks no verified unrelated CI blockers with existing upstream issues.

The previously tracked blocker #30047 (logservice gossip_fixture_test.go:130 obsolete randomPorts.allocate call, failing UT Test on Ubuntu/x86, SCA Linux/arm64, and the downstream Coverage jobs on exact-head run 38347106648) was closed at 2026-10-13T08:30:47Z. The resolution is verified: the fix (caller updated to the (first, limit, probeTestPort) signature) landed on main in 35c8dd5854, and this PR does not modify pkg/logservice, so caller and allocator were identical to the affected main revision.

2026-10-15 record — exact-head run 38703760162 (attempt 1, head ce9ed59493) failed with one shared root cause that was pre-existing on main, not in this PR's delta:

  • Matrixone CI execution / SCA Test on Linux/arm64 (job 116318317133): molint: pkg/sql/plan/apply_indices_fulltext_snapshot_test.go:182:70: not enough arguments in call to builder.tryApplyCoveredFulltext2; make static-check-analysis exit 1.
  • Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 (job 116318368325): pkg/sql/plan/apply_indices_fulltext_snapshot_test.go:182:67: not enough arguments in call to builder.tryApplyCoveredFulltext2; FAIL github.com/matrixorigin/matrixone/pkg/sql/plan [build failed].
  • Matrixone CI execution / UT Test on Ubuntu/x86 (job 116318317078): pkg/sql/plan/apply_indices_fulltext_snapshot_test.go:182:67: not enough arguments in call to builder.tryApplyCoveredFulltext2.
  • Downstream of the same producer failure: Matrixone Coverage execution / Coverage (job 116343149819) failed at its Verify coverage prerequisites step (PREREQUISITES_READY: false, "coverage merge blocked: a required producer did not publish a complete coverage profile"), and the CI Required gatekeeper (job 116382930300) reported red because the required jobs above failed.

Root cause, verified: upstream commit 461bc8e349 (fix(plan): omit overwritten implicit fulltext ordering, #30189) widened tryApplyCoveredFulltext2 from 11 to 12 parameters, updating the production call site and the test call sites at apply_indices_fulltext_snapshot_test.go:109 and :129, but missed the call at line 180–182 of the same upstream file. This PR contributes zero lines to pkg/sql/plan (git diff 461bc8e349..HEAD -- pkg/sql/plan/ is empty; the file is byte-identical to main), and the failure is reproduced locally on the exact PR head with the canonical wrapper: FAIL github.com/matrixorigin/matrixone/pkg/sql/plan [build failed].

Handling: no matching open issue was found on matrixorigin/matrixone for this compile break (searched tryApplyCoveredFulltext2, apply_indices_fulltext_snapshot_test, static-check molint, 30189 fulltext, fulltext snapshot build failed; #30164 is an unrelated performance issue), so per the tracking rule no marker entry is added and no issue is created. The failure is deterministic, so rerunning the run could not change the result; reruns were not requested.

Resolution, recorded 2026-10-15: upstream fixed main in two steps — 8795f3699b (revert: restore fulltext planner before #30189, #30285) removed the broken widened signature together with the stale call site, and e8b3ed7f21 (fix(plan): integrate fulltext ordering and covered score limits, #30289) re-landed the intended planner change. This branch has been rebased onto the current main c46b893f61, which contains both, and the merge result now builds the previously broken package: .agents/skills/mo-dev/scripts/mo-cgo-test -run '^$' ./pkg/sql/plan passes on the rebased head. Nothing remains to track; the fresh CI run for the new head supersedes run 38703760162.

2026-10-16 record — NEW tracked blocker: #29447. Exact-head run 38882194805 (attempt 1, head 6a2b64bb82) failed Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 (job 116916731411) with one root: pkg/tests/issues/isolated / TestDropDatabaseAfterCNScaleDown — --- FAIL (26.50s). The failing root is the isolated embedded-cluster regression test added by upstream #30269 for the DROP DATABASE ... lock table bind changed class after controlled 3 CN -> 1 CN scale-down, and the failing window logged lock table bind changed on a moadmin session — the same error class as #29447. Verified unrelated to this PR: zero delta on pkg/lockservice, pkg/tests/issues/isolated/, pkg/embed, or any path the test exercises (git diff origin/main...HEAD -- pkg/lockservice pkg/tests/issues/isolated/ pkg/embed is empty). Reproduction record posted on #29447 (issuecomment-6214046587). The PR was behind, so recovery followed the freshness rule (rebase + push supersedes the stale run); no rerun was requested.

2026-10-16 record (second event) — NEW tracked blocker: #28652. The fresh run for the rebased head, 38890955566 (attempt 1, head f6f20a37fd), failed Matrixone UT Coverage execution / UT Coverage on Ubuntu/x86 (job 116940230290) at the Set up Go step — ##[error]Client network socket disconnected before secure TLS connection was established. Tests never ran (checkout succeeded; every step after Set up Go skipped). This is a transient cold-toolchain provisioning failure on the runner, identical in class to #28652 (UT coverage setup provisioning). Verified unrelated to this PR: the failure precedes any repository code execution and the PR's delta cannot influence actions/setup-go. Reproduction record posted on #28652 (issuecomment-6214432805). Recovery again followed the freshness rule: the PR was behind, so the rebased head supersedes the stale run; no rerun was requested. The #29447 blocker from the previous event remains tracked because the superseded run's UT Coverage job never reached its tests, so that root's behavior on the new head is still unverified.

2026-10-17 record — both tracked blockers resolved and verified. The fresh CI run for the rebased head 56fdf0f82c, run 38893412045, completed terminally green:

Per the tracking rule (resolution verified for each blocker against its own upstream issue), both entries are removed from the marker. No new unrelated CI blocker exists for this PR; the current head is the post-conflict rebase 666ff988d1, whose fresh CI run supersedes run 38893412045.

2026-10-18 record — one verified unrelated UT failure during the merge queue's in-place checks; no open tracking issue, so no marker entry is added.

After the approval landed (XuPeng-SH, 2026-10-18T07:27:04Z), the merge queue synchronized the branch in-place: main 35253f2a95 was merged into cc26004214, producing head 32cb74a9cb. pkg/tests/upgrade and the whole fence surface are byte-identical across both heads; the two newly merged main commits touch only pkg/frontend PITR and pkg/sql/plan/LOAD-DATA parsing paths. Exact-head run 39107760931 (attempt 1, 2026-10-18T07:28Z) then failed with one root: Matrixone CI execution / UT Test on Ubuntu/x86 (job 117617232057) — pkg/tests/upgrade / TestV406UpgradeCreatesViewMetadataCatalogTables/catalog_fence_overlaps_uncommitted_upgrade, upgrade_v4_0_6_view_metadata_test.go:198: catalog upgrade did not commit after releasing the overlap barrier. CI Required (job 117627323250) only propagated matrixone-ci: failure. Every other lane of the same run is green (SCA Test on Linux/arm64; UT Coverage on Ubuntu/x86, which runs the same full suite; Coverage; shared build; proxy/pessimistic multi-CN BVT), and the same run's failed_attempt_rolls_back_and_retry_converges sibling subtest passes.

Root cause, verified: this is the exact recorded signature of #29033 — the unchanged test waits one second after releasing the overlap barrier, and the upgrade DDL transaction commits successfully just past that window (tn.handle.commit.with.ddl commit-latency: 984.033589ms · Committed, with dragonboat LocalTick scheduler pressure in the same window). #29033 is the closed recurring ledger for this Ubuntu/x86 control-plane timing candidate, with prior independently verified occurrences on #30169, #30297, #30184 and #30299. Verified unrelated to this PR: the 27-file delta contributes zero lines to pkg/tests/upgrade, pkg/embed, pkg/bootstrap or pkg/cnservice and zero fence/view-metadata symbols; the patch-identical pre-merge head cc26004214 was terminally green in run 39098955105 (UT Test on Ubuntu/x86 job 117591115016, CI Required job 117599345825, 2026-10-18T05:47Z), ~2.5 h before the failure; and focused local runs on the exact merged head pass the fence subtest in 0.42–0.68s on every iteration whose embedded cluster is healthy, with the exact CI assertion never reproducing (full detail, including the local-load caveats, in the issue-29033 record).

Handling: no open issue matches this signature (searched TestV406UpgradeCreatesViewMetadataCatalogTables, catalog fence overlaps uncommitted upgrade, RequireViewMetadataRevalidation, and title/body matches for the assertion text; the only matching issue is the closed #29033 ledger), so per the tracking rule no marker entry is added and no issue is created. A concise reproduction record was posted on #29033 (issuecomment-6248117535). Recovery: the PR head is current with main and the run's attempt is 1, so a single failed-job rerun of run 39107760931 was requested per the rerun budget; it is now running as attempt 2, and its result will be inspected on a later scan. Mergify dequeued the PR from the main merge queue when CI Required reported the failure (its queue-status comment issuecomment-6247134127 was updated to dequeued at 2026-10-18T08:22:14Z); re-entering the queue stays with the controller's merge-queue step, which requires terminally successful CI, so no requeue comment is posted while attempt 2 is in flight. No change was made to this PR for this failure; the marker continues to track no open blockers.

@gouhongshen

Copy link
Copy Markdown
Contributor Author

@aptend Fresh reconciliation for the post-conflict rebase: the exact head is now 666ff988d1 (666ff988d18bb66a1fee5b2a0b661415a71e8ba3), rebased onto main 65bcea5d24 after GitHub reported the branch DIRTY/CONFLICTING. Recording what the reconciliation found, on the record so the approval chain stays traceable:

  • Why the histories conflicted: main advanced by eighteen commits, and 18d5335ee3 (Fix: Unify SQL server file access authority #30212, unify SQL server file access authority) rewrote the same StatementOption struct block in pkg/util/executor/types.go that this PR's commit 10 realigned — upstream inserted the accountName/roleName session-identity fields behind a three-line comment that also re-split gofmt's field-alignment groups of the first five fields, while this PR realigned the same block to add skipIndexTaskRegistration. That produced exactly one genuine content conflict, resolved two-sided: the merged struct keeps upstream's five-field group, its comment, and accountName/roleName, plus this PR's skipIndexTaskRegistration in the recomputed second alignment group; gofmt -l is clean and no line from either side was dropped.
  • Every other direct file overlap auto-merged with both sides preserved: alter.go/alter_test.go with 85d03e833e's quadratic-dedup rewrite of updateNewTableColId and its appended TestUpdateNewTableColID; compile.go with 18d5335ee3's WithSessionIdentity propagation in runSqlWithResultAndOptions (the helper this PR threads internalStatementOption through), e44d8f9bef's S3 flush analyze control, and 7387b96afd's LOAD boundary split; ddl.go with 43c4771168's CTAS sequence state beside this PR's createTable registration gate; sql_executor.go with upstream's error-returning Params() and sequence-state plumbing beside this PR's skipIndexTaskRegistration assignment; issue_29400_test.go with 47b9690d7c's per-subtest deadline scoping of the shared retained-gate root, beside this PR's three unchanged roots.
  • git range-diff against the previous head 56fdf0f82c shows twelve of thirteen PR commits patch-equivalent; commit 10 (239bcc963c) differs only by the struct interleave above, so every line the PR itself adds is unchanged. Your 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.
  • Tracked CI blockers resolved and verified: run 38893412045 for the previous head completed terminally green — UT Coverage on Ubuntu/x86 (job 116948706903) ran the full suite including the previously failing pkg/tests/issues/isolated/TestDropDatabaseAfterCNScaleDown and passed, Coverage (job 116967678213) succeeded, and CI Required (job 117032719116) reported SUCCESS. This resolves both tracked blockers ([Bug]: DROP DATABASE fails with lock table bind changed after controlled 3 CN to 1 CN scale-down #29447 and [Bug]: UT coverage setup action times out during cold Go/JDK provisioning #28652) with verified evidence on each issue; the CI-blockers tracking comment now records both resolutions and tracks no open blocker. The push of this rebased head produces a fresh run for the new head.
  • Exact-head revalidation: full ./pkg/sql/compile — PASS 15.816s; full ./pkg/frontend — PASS 20.115s; full ./pkg/util/executor — PASS 1.992s; full ./pkg/vm/engine/disttae — PASS 7.783s; full ./pkg/vm/engine/disttae/logtailreplay — PASS 2.382s; ./pkg/sql/plan build check — ok 2.613s; the canonical race command — PASS 8.731s, no failure in 100 runs; the four focused ./pkg/tests/issues roots (this PR's three plus upstream's deadline-rescoped retained-gate root in the shared file) — PASS 14.482s. gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head.

Re-requesting your review so the approval rides the current head.

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

Codex automated review

Re-inspected the PR at HEAD 666ff98 (git diff origin/main...HEAD, 27 files, +2981/-320) and reconciled it with the complete review history, all 33 reviews, 18 conversation comments and 27 inline comments. The 13-patch series is range-diff equivalent to the previous reviewed head f0840a5; the only differing hunks are rebase-conflict realignments in compile/types.go, Compile.clear and executor/types.go for upstream lastInsertIDBaseline and accountName/roleName field additions, verified byte-by-byte to carry no semantic change. Every previously blocking topic is fixed and independently re-verified in the current tree. Fixed: (1) the pre-copy global lineage gate that failed unrelated pessimistic-RC ALTERs - the broad gate now precedes physical preparation, endpoint name pins moved post-copy with WaitPolicy_Wait, and only workspace-certified transaction-created tables may wait at the gate; (2) private preparation is lock-free (nested CREATE, row copy, unaffected-index DELETE all use WithDisableLock) while locking returns on the publication path; (3) the publication proof is complete - SourceCommitTSAt scans retained tombstone entries including soft-deleted ones with per-row non-aborted commit_ts for appendable tombstones and per-block commit_ts zonemaps for merged ones, with the state-start floor as retention boundary; (4) SourceCommitTSAfterCopy bypasses only the current transaction local-write failure and still fails closed across every partition member; (5) post-copy retry ownership is terminal - alterCopyPostPublicationRetryConflict converts ErrTxnNeedRetry* into ErrTxnWriteConflict, which is now in wholeTxnRollbackCodes with frontend coverage, and isRetryErr/canRetry do not classify it as statement-retryable; (6) the private index-registration policy is reset in Compile.clear and NewCompile and cannot escape the reuse pool; the pool-oracle test tolerates documented sync.Pool drops; (7) the timestamp-only snapshot rewind removed at f0840a5 stays removed - the workspace-owned advanced snapshot is retained on every return path (TestAlterCopyRetainsWorkspaceAdvancedSnapshotOnEveryReturn, TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn). Accepted as non-blocking: lagging SI or optimistic COPY publications now terminate with a whole-transaction conflict when any committed source mutation postdates the statement snapshot, which is the documented publication-proof contract rather than the old silent stale-copy replacement. Upstream commits interleaved by the final rebase (updateNewTableColId map refactor in alter.go, delegate sidecar removal, lastInsertIDBaseline, session-identity fields) are orthogonal to this PR machinery. No new blocking or non-blocking defect found on this head. Focused tests could not run in this environment because the required CGo native headers (jemalloc.h, roaring.h, xxhash.h, usearch.h) are absent and CGO_ENABLED=0 breaks unrelated upstream packages; that limitation is environmental and not attributable to this change. gofmt is clean on all touched packages and every fix carries a dedicated regression test present at this head. There are no unresolved review threads; aptends latest approval (2026-10-16) and the mo-bot approval cover a patch-equivalent series and still stand.

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-18 02:08 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • 🚫 Left the queue — 2026-10-18 02:20 UTC · at 666ff988d18bb66a1fee5b2a0b661415a71e8ba3

This pull request spent 11 minutes 50 seconds in the queue, with no time running CI.

Reason

Pull request #29798 has been dequeued

Queue conditions are not satisfied:

  • #changes-requested-reviews-by<=0
  • approved-reviews-by=XuPeng-SH

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Requeued — the merge queue status continues in this comment ↓.

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

REQUEST_CHANGES on exact head 666ff988d18bb66a1fee5b2a0b661415a71e8ba3, merge-base 65bcea5d24610dde1a21bb9f4dea1efd82a8ce50.

One independently reproduced P2 remains: independent COPY ALTER publication fails for partitioned and AUTO_INCREMENT tables, because nested service executors retain public catalog locks during preparation. The inline finding contains the owner chain and remedy.

Real two-CN counterexample, current production source: A executes COPY ALTER on an unrelated ordinary table inside an explicit transaction and leaves it open. B executes COPY ALTER on another table. The nearest ordinary-table control enqueues at the actual SNAPSHOT gate, waits, then succeeds after A commits. Changing only B's table layout produces:

  • ordinary table: PASS (0.10s);
  • two HASH partitions: MySQL 20706, lock options conflict, wait policy is fast fail, before A releases the gate (0.09s);
  • AUTO_INCREMENT primary key: the same premature transaction-fatal failure (0.05s).

TestReview29798IndependentPartitionCopyWaitsAtGate ended FAIL (root 4.92s; package 6.156s). Logs show completed INSERT-copy, then FastFail on the registry row, transaction rollback and workspace-file cleanup. This is an executed SQL counterexample, not a mock or a performance-noise inference. An earlier partition-only run reproduced the same result with a passing ordinary control. The base acquires admission before nested CREATE; that ordering was checked in source, not claimed as a separate base runtime run.

Other closure/evidence: read all 27 changed files/hunks and reconciled historical review concerns. The exact approved design amendment still matches SHA256 89b0f9d527cf05660d45ed44af6cd9f5810b6069357d1dc5d44f920a507f71d2; I am not reopening its approval-label or accepted cost tradeoffs. Source-frontier/tombstone/local-write fixes, terminal retry classification, IVF cleanup, pool reset, and removal of snapshot-only rewind are present. The new counterexample demonstrates that the private-preparation invariant remains incomplete beyond the previously reviewed compiler-owned nested SQL.

Fresh local validation, darwin/arm64 Go 1.27.1, canonical native build and CGo wrapper:

  • Focused compile/disttae/logtailreplay roots PASS (4.129s / 4.059s / 4.053s).
  • Independent concurrent-DML commit-versus-rollback SQL probe PASS (root 4.67s): rollback allows COPY; commit produces 20601 without publishing stale schema/data; a fresh ALTER transaction succeeds.
  • git diff --check PASS. Production source unchanged; temporary probes removed after retaining evidence.
  • Exact-head CI run 38995621936 is green, including UT, SCA, coverage and required BVT. Those tests did not select the failing preparation layouts. Prior independent race evidence was reconciled through all 13 patches; no new full/race/500-worker run is claimed.
Audit Result
Q1 cleanup Reproduced failures reach whole-transaction rollback and workspace-file cleanup
Q2 progress Public catalog locks from service preparation force FastFail on an unrelated publisher
Q3 cost Failed COPY wastes completed physical work; frontier scanning/I/O remains source-state dependent

Accounting reviewed separately: implementation +704/-250, tests +2143/-70, design +134/-0. The speculative/publication split is reasonable, but its policy must reach the actual partition/allocator owners. No general TP regression was measured; the known scan/I/O cost and original one-object benchmark are not a zero-regression guarantee.

Nonblocking cleanup: the transient-task cleanup branch is unreachable because alterCopyCreateOptions always sets SkipIndexTaskRegistration; the late replacementAdmission.createNames assignment also has no later consumer. These obsolete remnants are separate from the demonstrated blocker.

Comment thread pkg/sql/compile/alter.go
@gouhongshen

Copy link
Copy Markdown
Contributor Author

@XuPeng-SH Fixed at 0e0f496225 (0e0f4962256a6e7eb09f6438a079170fe1c8dcb9), rebased onto main 8ed73ff815 (all thirteen previously reviewed commits patch-equivalent plus the new fix commit).

Your P2 is valid and is fixed at one additional hop beyond the reproduced path: making createTable's service executors lock-free still left the AUTO_INCREMENT layout failing 20706 locally, because reconcileAlterCopyAutoIncrement runs on the outer ALTER context before the gate and its allocator SetOffset UPDATE into mo_catalog.mo_increment_columns retained public catalog locks. The fix marks the lock-free statement tree in txnExecutor.Exec and nested executions — partition metadata INSERTs, allocator column INSERTs, and the allocator offset UPDATE — inherit WithDisableLock from that context; no catalog whitelisting and every unproven retained owner keeps fast-fail. The excluded cleanup branch is removed; the late replacementAdmission.createNames assignment is kept with its live consumer chain documented in the thread reply.

TestIssue29400IndependentCopyAltersProgressInPessimisticRC now selects all three victim layouts (unaffected IVF-FLAT index, HASH-partitioned, AUTO_INCREMENT); reverting only the production change reproduces your 20706 counterexample on exactly the two new layouts while the index control keeps passing. Full evidence in the thread: #29798 (comment)

Re-requesting your review and aptend's so the approvals ride the current head.

gouhongshen and others added 14 commits October 18, 2026 12:39
Retain soft-deleted tombstone proof, read appendable tombstone row commit timestamps, fail closed on unavailable object metadata, remove the unused public local-write capability, and reconcile the concurrent ALTER test with upstream pre-copy FK admission.
The ALTER COPY private replica create opts out of index CDC and idxcron
task registration through skipIndexTaskRegistration on its nested
executor Compile. Compile.clear reset the neighboring per-statement
flags but never this one, and NewCompile never initialized it, so the
released object carried the suppression into the global reuse pool: the
next frontend CREATE TABLE with an inline async/IVF index could reuse
that Compile and silently skip CreateAllIndexCdcTasks and
CreateAllIndexUpdateTasks, leaving a published index without its
maintenance owner.

Reset the flag in Compile.clear alongside disableLock and the other
statement-option flags, and re-initialize it in NewCompile. The
suppression stays scoped to the single private preparation generation.

Proof:
- TestCompileClearResetsSkipIndexTaskRegistration exercises the pool
  reset directly (mutation-verified: removing only the clear reset
  fails it).
- TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy reproduces
  the Release -> same-object NewCompile handoff deterministically
  (single-P, GC disabled) and asserts the next frontend Compile starts
  with the ordinary policy.
- TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation
  proves an ordinary inline IVF-FLAT CREATE registers its
  mo_catalog.mo_index_update ivfflat_reindex task before and after
  ALTER COPY private preparation on the same CN, and that publication
  re-registers the replacement's task.
… drops

TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy asserted that the
frontend Compile handed back by sync.Pool is the same object as the just
released private executor Compile. sync.Pool's documented contract permits
dropping Put values and returning unrelated objects, and the race runtime
drops Put values deliberately (runtime_randn(4) == 0), so the assertion made
the canonical -race -count=100 validation randomly fail for a correct
implementation.

The oracle is now policy-based: 16 rounds each seed the real leak payload
(private executor Compile with its executor-set skipIndexTaskRegistration,
then Release -> Compile.clear -> sync.Pool.Put) and require the ordinary
policy on the frontend Compile returned by the public NewCompile, whichever
object the pool chooses; identity is only logged. A leak travels only
through a Put the pool kept, and every kept seed is asserted on the next
construction, so drops never mask the regression; the pool-free
TestCompileClearResetsSkipIndexTaskRegistration keeps pinning the clear()
layer.

Verified: -race -count=100 green (13.128s); -count=100 without race green
(7.344s); full ./pkg/sql/compile green (65.880s). Mutation check (both
resets removed): deterministic round-0 failure without -race; all 3
invocations of -race -count=3 fail at round 0.
The pre-copy lineage snapshot advance went through the workspace-owned
AdvanceLineageSnapshot, but alterTableCopy still rewound only the
transaction timestamp when it returned. After Workspace.AdvanceSnapshot
relocates transaction-local tombstones, a timestamp-only rewind leaves
the workspace and the snapshot in different generations and resurrects
relocated deletes of earlier uncommitted DML in the same transaction —
the exact defect main removed in matrixorigin#29539, reintroduced when the advance
moved before physical preparation.

Remove the rewind and retain the workspace-owned advanced snapshot on
every return path, matching the databranchutils.AdvanceLineageSnapshot
contract. The duplicated isTemp/non-temp advance branches collapse into
one mode-gated call.

Tests: the compile root fails if ALTER COPY ever calls SetSnapshotTS
after a workspace advancement (verified by mutation in both directions)
and asserts retention across advance-failure and physical-copy-failure
returns; a pessimistic-RC integration test keeps DN-flush-relocated
in-memory deletes deleted across the ALTER COPY return boundary.
… tree

ALTER COPY private preparation runs its nested CREATE, row copy and index
cleanup with WithDisableLock, but SQL those steps trigger indirectly on the
same transaction did not inherit the policy: partition-service metadata
writes, allocator column creates and the allocator offset reconciliation
ran on service executors with fresh statement options, arming public
catalog locks that publication admission cannot certify as private. An
unrelated pessimistic-RC publisher holding the SNAPSHOT gate then forced
HASH-partitioned and AUTO_INCREMENT sources to FastFail (MySQL 20706)
instead of waiting, while ordinary sources still waited.

The internal SQL executor now marks the statement tree of every lock-free
statement and nested executions inherit the policy from that context: the
catalog rows created during preparation address keys private to the
in-flight replacement, so the same isolation argument as the nested
CREATE applies. The dead transient-index-task cleanup branch that
alterCopyCreateOptions made unreachable is removed.

TestIssue29400IndependentCopyAltersProgressInPessimisticRC now selects
every service-owned catalog write with two new victim layouts,
HASH-partitioned and AUTO_INCREMENT, alongside the unaffected IVF-FLAT
index; reverting only the production change reproduces 20706 on exactly
those two layouts while the index control keeps passing.
@XuPeng-SH

XuPeng-SH commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: 0e0f4962256a6e7eb09f6438a079170fe1c8dcb9

"interrupted"

@gouhongshen

Copy link
Copy Markdown
Contributor Author

@XuPeng-SH @aptend Fresh reconciliation for the post-fix rebase: the exact head is now cc26004214 (cc2600421437473cb0e9658b139822c3f9ef90a5), rebased onto main 3c07fac240 after the behind event for the 0e0f496225 head (the branch was reported behind base 154a24d463, and main had advanced once more by fetch time; the rebase is onto the current tip). Recording what the reconciliation found, on the record so the approval chain stays traceable:

  • main advanced with two commits: 154a24d463 (fix(load): keep trailing-CR strip inside the current field, fix(load): keep trailing-CR strip inside the current field #30498), touching only pkg/sql/util/csvparser/csv_parser.go and its new test, and 3c07fac240 (perf(python-sdk): chunk vector batch inserts in one transaction, perf(python-sdk): chunk vector batch inserts in one transaction #30076), touching only clients/python/** — zero file overlap with this PR's 27-file delta. The rebase auto-merged.
  • git range-diff 8ed73ff815..0e0f496225 vs 3c07fac240..cc26004214 shows all fourteen PR commits patch-equivalent — the thirteen-commit series previously reviewed plus the fourteenth service-catalog-SQL fix (0e0f496225) answering the 666ff988d1 review's P2 (thread PRRT_kwDOFEPiGM6tmjHP, reply discussion_r4305592967). No PR-owned line changed in this cycle, so the aptend implementation APPROVE (PRR_kwDOFEPiGM8AAAABSZFhbw, re-affirmed as PRR_kwDOFEPiGM8AAAABSpGJUw), the mo-bot approve (PRR_kwDOFEPiGM8AAAABSZQRVg), the design-first PASS (issuecomment-6141109182), and the amended-design PASS (issuecomment-6186238709) continue to review exactly that code; the fourteenth commit remains under your re-review as before.
  • Exact-head revalidation: full ./pkg/sql/compile — PASS 16.367s; full ./pkg/frontend — PASS 56.132s; full ./pkg/util/executor — PASS 0.688s; full ./pkg/vm/engine/disttae — PASS 7.602s; full ./pkg/vm/engine/disttae/logtailreplay — PASS 5.448s; ./pkg/sql/plan build check — ok 5.640s; the canonical race command (-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile) — PASS 14.630s, no failure in 100 runs; the four focused ./pkg/tests/issues roots (relocated workspace-delete retention, ordinary indexed-CREATE registration, the three-layout independent pessimistic-RC publishers, plus upstream's re-fenced retained-gate root in the shared file) — PASS 20.049s. gofmt -l, git diff --check, the protected-scope check, and the clean-tree check passed on the exact head.
  • The previous head's terminally green CI run 39094077072 (UT Test on Ubuntu/x86, SCA Test on Linux/arm64, UT Coverage on Ubuntu/x86, Coverage, proxy and pessimistic multi-CN BVT, CI Required job 117585849026 all SUCCESS) is superseded; this push produces a fresh run for the new head.

Re-requesting your reviews so the decisions ride the current head.

@XuPeng-SH

XuPeng-SH commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: cc2600421437473cb0e9658b139822c3f9ef90a5

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-xupeng · review

Commit: cc2600421437473cb0e9658b139822c3f9ef90a5

Assessment: approve

Reviewed the complete 27-file delta, ownership chain, design and supplied review concerns. Private preparation, publication revalidation, terminal conflicts and compiler-policy cleanup are supported by source review and targeted tests. No actionable introduced defect remains.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

Validation:

  • Preflight and native-provenance verification passed. Source remained unchanged at the assessed commit.

  • Full compiler suite passed normally and under race detection; five focused concurrency tests each passed 100 race repetitions.

  • Full frontend, executor, moerr, disttae and logtailreplay package suites passed.

  • Five selected SQL integration roots passed, covering independent publishers, retained-gate rejection, stale-index retries, workspace deletes and index-task registration.

  • A supplemental two-CN SQL probe passed: committed source updates rejected stale COPY publication with error 20601; rolled-back updates allowed publication, with data/schema assertions.

  • Two build timeouts were recovered using the same caches. Receipts, logs and artifact identities are reconciled in /home/xupeng/.local/state/mo-bot/jobs/fdb7674b8f0f3149c1d2ddc5/attempt-1/validation-summary.json; closing audit receipt: checks/1792308348858032027-3.json.

Limitations:

  • The supplemental partition-plus-IVF INSERT probe failed before ALTER on both candidate and frozen-base production code; this preexisting failure is not attributed to this PR.

  • No full-repository suite or renewed 500-session/production-scale benchmark. Acceptance includes the documented source-state scan/I/O cost and maintenance-window rollout.

  • The standalone linked issue #29208 body and raw historical author/CI logs were not supplied; assessment uses the supplied PR contract, comments, frozen sources and local evidence.

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-18 07:27 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in-place
  • 🚫 Left the queue — 2026-10-18 08:22 UTC · at 32cb74a9cb158c903b39ed9d51e170a0dd0bd2e6

This pull request spent 54 minutes 31 seconds in the queue, with no time running CI.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

Hint

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Waiting for any of
  • check-neutral = CI Required
  • check-skipped = CI Required
  • check-success = CI Required
All conditions

Requeued — the merge queue status continues in this comment ↓.

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-18 10:02 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-18 12:26 UTC · at 68e642fdc533e96ed8f83ac44659119ad8be97af · squash

This pull request spent 2 hours 24 minutes 1 second in the queue, including 51 minutes 33 seconds running CI.

Required conditions to merge

@XuPeng-SH XuPeng-SH mentioned this pull request Oct 18, 2026
4 of 7 tasks

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants