Repository navigation
Conversation
由 LW 授权的 ChatGPT Personal 智能体提交。
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
由 LW 授权的 ChatGPT Personal 智能体提交。 操作记录:已将 PR 指派给 |
|
回访更新(2026-10-14 12:19Z 读数,head
由LW授权的MOI智能体提交 |
|
Incremental SCA follow-up published.
This resolves the concrete unused-method SCA finding reported above. No duplicate PR, manual CI rerun/cancellation, merge, deployment, or issue closure was performed. 由LW授权的ChatGPT Business智能体提交。 |
|
由 LW 授权的 ChatGPT Personal 智能体提交。 当前head9a3e4180的实际CI(run38673389484)复查:arm64 SCA、UT Coverage与Coverage均success;上一unused finding已消失。剩余失败是Ubuntu普通UT job116221467753,真实日志定位到 TestIssue29400CopyAlterRetainedGatePromotionFastFails/fresh_truncate/commit,issue_29400_test.go:471 返回context deadline exceeded;随后多项subtest在setup drop/create阶段立即因同一context deadline exceeded失败,整项126.86s。 此证据不能直接证明与本PR无关,也不能据一次重跑排除真实锁等待问题;不改测试时限、不跳过用例、不将其他失败归为通过。已请求仅该失败UT作业的正常重跑(含GitHub依赖处理),不整体重跑/取消成功作业,不改产品代码或权限。等待实际结果后再决定是否需固定基线对照。只读核验及本次重跑主体均为本署名。 |
|
CI 跟进(2026-10-15 05:17Z,由LW授权的MOI智能体提交) 续接 04:42Z 说明:本轮无法读取上游失败 job 日志( |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 9a3e41809abca4b56a9b23ad65b771f591bbe41a
Assessment: approve
Reviewed the complete delta and affected callers. The change coherently restores immutable cache snapshots, preserves concurrent updates through retrying CAS, and removes the obsolete mutation helper. No actionable defects found. Cache-hit paths remain unchanged.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Reviewed publication ownership, shared payloads and atomic replica counters, read/error invalidation, table deletion, RPC cleanup, and both new regression tests.
-
Bounded static audit passed: exact head/base, clean source, complete two-file scope, diff whitespace, gofmt, publication-writer inventory and source fingerprints. Receipt: checks/1792048328038021573-2.json; retained output: review_audit.log and review_audit.json in the assigned attempt directory.
-
Frozen evidence records current-head success for Ubuntu UT, arm64 SCA, UT coverage, shared build, proxy and multi-CN BVT, and CI Required. Skipped and neutral checks were not counted as executed validation.
-
Corroborated the author-reported normal/race package results with the current service.go blob and six-line-only final cleanup. Earlier lint failure is resolved; current completed CI supersedes the comments reporting a pending UT rerun.
-
Detailed design, performance, test and comment assessment retained in review_report.txt.
Limitations:
-
No local Go tests were repeated. local_validation was empty; author runtime logs and artifact ZIPs were not locally available for independent inspection.
-
The concurrent test permits contention but does not deterministically force CAS failure. Publication correctness was also assessed through source analysis.
-
Invalidation requires O(table-count) copying, repeated on CAS conflicts; worst-case contention cost was not benchmarked.
-
Full linked-issue text was not supplied. Approval covers this PR's stated snapshot/publication contract, not closure of the broader issue.
Merge Queue Status
This pull request spent 57 seconds in the queue, with no time running CI. ReasonPull request #30187 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
There was a problem hiding this comment.
Deep review of exact head 9a3e41809abca4b56a9b23ad65b771f591bbe41a, base/merge-base fab7b5c0430a475bf64ad1619ce4d5249013a138: no blocking findings.
Reviewed the entire two-file +61/-22 diff, all read-cache writers/readers and their payload/counter ownership, GetTableShards/RPC result handling, read-error invalidation and table-delete consumers. Read the linked issue, all PR discussion, the newly submitted independent review, and verified there are no inline/review threads. This is a bounded existing-invariant bug fix, exempt from a separate feature-design gate.
removeCache now shares the copy/delete/CAS owner instead of mutating a published map. Deletion retries a stale snapshot; the addition path also retries CAS, so it cannot overwrite an unrelated deletion with a stale whole-map Store. Nil/absent/repeated deletion and preservation of unrelated entries are covered. Shallow copies keep existing shared payloads/atomic replica counters; they do not introduce a second payload mutation owner. The removed private delete method has no remaining callers. Cache-hit behavior is unchanged.
| Audit | Result |
|---|---|
| Q1 ownership | Published maps remain immutable; only private copies are changed before CAS. Existing Go reachability owns retired snapshots; existing RPC cleanup remains. |
| Q2 progress | CAS conflict retries reload current state; no new mutex/channel/RPC wait is introduced. This is lock-free retry, not a promise of starvation-free scheduling. Existing pre-publication RPC/polling behavior is unchanged. |
| Q3 bounds | No new retained queue/cache generation list; discarded clones become unreachable. Invalidation remains O(table-count), with extra copy work on contention; no worst-case contention benchmark is claimed. |
Independently reconciled reusable validation rather than relying on aggregate PR claims:
- Downloaded fork artifacts11902064058 and11797959963; ZIP SHA-256 matches GitHub's published
408758aa87d98125501c54e535f5209eef65ef3b538d24b0f34e1177c160188eandf595df2e79c4924b61529883940feee0748515bb23bdee205ae59f8d0180ca57. - Both current changed files match the retained follow-up source byte-for-byte and its SHA manifest. Fetched tested candidate
f40c1899a93c05378c97d803eb0b092d4bd30c88: its entire tree differs from this PR head only by the candidate-only verification workflow. Native inputs, dependencies, product and test sources are identical. - Inspected actual workflow commands, successful job steps and complete package terminals: Go1.27.1 Linux/amd64, repository native build/wrapper; 75/75 top-level roots PASS normal44.059s and race53.064s, no failed root/data-race signature; gofmt/vet/configured incremental lint succeeds (0 issues).
- Original retained baseline snapshot assertion FAILS as expected. Retained focused checks pass4/4. Exact concurrent-test measurement and adaptive count100 race execution pass100/100 (package1.187s). Those test bodies/helpers and production paths are unchanged in the current source; the only archived service.go difference is deletion of the unused mutation method. This concurrency test allows contention but does not deterministically force CAS failure; source-level publication reasoning is also required.
- Current exact-head upstream run38673389484 is green, including ordinary UT, coverage, arm64 SCA, both BVT routes and CI Required. Downloaded ordinary UT log confirms checkout of this exact SHA. Historical failed attempts are not relabeled as passes.
- Local diff/gofmt/publication inventory is clean. A local focused-test invocation stopped before tests at the wrapper's native prerequisite/reuse check; I did not bypass that gate or modify the primary worktree. Runtime conclusions above explicitly reuse the checksum/source-qualified CI evidence, not a claimed fresh local run. No temporary source tests were added.
Correction: the final state read showed the PR had advanced to bd03743a43f6afc7a209a41f41e8da7999ecb36d, but my submission script failed to stop this old-SHA review. This approval covers only the explicitly reviewed 9a3e418 head, not the new head. Current-head review is pending; the queue request is retained. I have not authorized merge or issue closure.
Follow-up state: GitHub now confirms the PR was merged at 2026-10-15T07:16:16Z (merge bb2b725d0af4601d02ebf9cc68b1816a2b300022). The intermediate head is a merge of reviewed9a3e418 with main501c85ecdd and has no shardservice delta against reviewed9a3e418. I did not submit another review after closure; the merged integration is not represented as independently runtime-tested by this old-head review.
|
由 LW 授权的 ChatGPT Personal 智能体提交。 本轮交付回访读回:run38673389484 attempt2实际completed/success;随后PR当前状态closed、merged=true,合并时间2026-10-15T07:16:16Z,merged_by为XuPeng-SH,合并提交bb2b725d0af4601d02ebf9cc68b1816a2b300022。最终PR仍2文件+61/-22。仓库方已完成合并,本智能体未执行合并、关闭Issue、队列/权限变更或部署;不再重跑此旧head,不重复提交修复。此记录的只读核验主体同署名。 |
### Design record
- Added versioned design: `docs/design/20261010-alter-copy-pre-publication.md`.
- The design records the speculative-preparation/publication split, authoritative after-copy source-frontier revalidation, persisted-delete coverage, actual nested lock state, terminal retry and whole-transaction rollback ownership, transaction-local relation and workspace-write handling, alternatives, compatibility, source-state cost model, and validation map.
- Independent design approval of that exact revision is still required before implementation approval.
### Root cause
`ALTER TABLE ... COPY` acquired the transaction-scoped global SNAPSHOT lineage-owner gate before temporary-table creation, physical row copy, auto-increment reconciliation, and unaffected-index cloning. Every independent branch ALTER therefore held the stable `mo_catalog.mo_feature_registry` row for `SNAPSHOT` until commit. Under the reported 500-worker workload, unrelated ALTERs serialized behind each other and eventually returned MySQL 1205 lock-wait timeouts or MySQL 2013 connection losses.
Moving physical work before that gate also exposed correctness obligations:
- ALTER must not hold source locks while waiting for the lineage gate.
- Unlocked preflight must not take authoritative owner-row locks.
- Publication must reject source replacement, same-ID schema changes, row changes, and lineage-state changes that happened during physical preparation.
- If a concurrent same-table ALTER removes an index table between preparation and resolution, missing metadata must become a controlled definition-change retry rather than a nil-pointer panic.
### Exact changes
- Split unlocked lineage inspection and timestamp selection from authoritative, gate-protected lineage preparation in `pkg/sql/compile/alter.go`.
- Run lock-free temporary-table creation, physical row copy, auto-increment reconciliation, and unaffected-index cloning before acquiring the global lineage-owner gate. The temporary CREATE passes `WithDisableLock`, so it does not retain the source database shared lock or temporary target table exclusive lock.
- Acquire the lineage gate before source database, catalog-table, and physical-table locks. Existing upstream TRUNCATE behavior already uses compatible ordering; the existing TRUNCATE interleaving test is updated to observe physical work before the gate and gate acquisition before source locks.
- Preserve late broad admission after rebase onto `4022729da2`, while adopting upstream's `admitBroadTableLifecycleRC` API and logical-ID-aware historical-source probes.
- After gate acquisition, advance the RC snapshot, re-resolve the source, and reject source-ID replacement, same-ID table-definition-version changes, source data changes since copy, foreign-key state changes, stale lineage, late historical ownership, and same-statement lineage column replacement before publication.
- Preserve the physical-copy timestamp when lineage becomes relevant only during late publication.
- Replace the post-copy CDC handle probe with `SourceCommitTSAfterCopy(copyTS)`. It uses the authoritative partition-state frontier, excludes only current-transaction workspace writes, includes in-memory rows, data objects, and persisted tombstone objects, fails closed for unavailable providers, and short-circuits once a source frontier exceeds the copy timestamp.
- Aggregate `SourceCommitTSAfterCopy` across every combined partition member, short-circuiting after any member exceeds the copy timestamp and failing closed for missing member providers; a local write on one member no longer suppresses checks for other rows or partitions.
- Convert post-physical source replacement, definition-version, source-data, lifecycle-admission-retry, and source-lock-refresh races to terminal `ErrTxnWriteConflict`; RC statement retry therefore cannot repeat physical preparation while retaining locks. The frontend classifies this conflict as a whole-transaction rollback in both autocommit and explicit-transaction mode.
- Convert a nil source-index object or definition returned by unlocked `Resolve` into `ErrTxnNeedRetryWithDefChanged`, preventing the CI-observed stale-index-generation panic.
- Add the optional `RelationCreatedInCurrentTxn` and after-copy source-frontier relation capabilities with disttae primary, combined-table, and delegate implementations. Relation-created sources skip the committed probe; existing relations with local writes still check committed mutations from other transactions.
- Add deterministic source-lock retry coverage for optimistic ALTER, catalog-table contention, and physical-table contention.
- Update the concurrent stale-index integration test to require terminal error 20601 for a post-copy source-admission race, explicitly retry that statement in a new transaction, and retain the final schema/index/default assertions.
### Issue-to-test proof
- Independent ALTERs no longer serialize: `TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate` proves both independent physical inserts start while the lineage gate is held elsewhere.
- Lifecycle lock order is acyclic: `TestAlterCopyAndDropUseGateBeforeSourceLocks`, `TestAlterCopyAndTruncateUseGateBeforeSourceLocks`, and `TestAlterCopyAndTruncateSerializeBeforeTableLocks` prove ALTER physical work starts before the gate and both ALTER and TRUNCATE record gate acquisition before source locks.
- Source-lock retry contracts are explicit: `TestLockAlterCopySourceRetryContracts` proves optimistic transactions take no source locks, while catalog-table and physical-table retry errors are converted to `ErrTxnNeedRetryWithDefChanged`.
- Unlocked preflight is read-only and race-safe: `TestInspectAlterDataBranchLineageSeesBranchCreatedAfterPreflight` and `TestAlterTableHasLatestHistoricalBranchSourceUsesFreshUnlockedProbe` prove a late branch is rediscovered by authoritative postgate preparation.
- Stale-copy protection is terminal: `TestAlterCopyRejectsSourceReplacementAfterGate`, `TestAlterCopyRejectsSourceDataChangeAfterCopy`, and `TestAlterCopyRejectsSameIDSourceDefChangeAfterGate` reject replacement, row changes, and same-ID definition changes before publication.
- Missing index metadata is controlled: `TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears` proves the definition-change retry path instead of a nil dereference.
- Publication and rollback remain correct: `TestAlterCopyLateLineagePublicationUsesCopyTimestamp`, `TestAlterCopyFailsAfterPhysicalWorkWithoutReleasingGate`, and same-statement replacement coverage verify the original timestamp, injected failure, and no publication after stale-copy discovery.
- Transaction-local state is handled explicitly: `TestAlterCopySkipsSourceChangesForRelationCreatedInCurrentTxn` skips the probe only for relation-created sources, while `TestAlterCopyChecksCommittedChangesDespiteTransactionLocalWrites` proves local writes do not suppress another transaction's committed change. `SourceCommitTS` itself still fails closed for async-index callers.
- Nested CREATE does not retain catalog locks: `TestAlterCopyCreateOptionsDisablesNestedCreateLock` proves `WithDisableLock`.
- The source frontier is bounded and authoritative: `TestAlterCopySourceChangedSinceCopyUsesSourceCommitTS` and `TestAlterCopySourceChangedSinceCopyFailsClosedWithoutProvider` cover unchanged, changed, and unavailable states; `TestSourceCommitTSAtIncludesPersistedTombstone` proves a persisted DELETE advances the frontier.
- Partition aggregation is correct: `TestCombinedTxnTableSourceCommitTSReturnsMax`, `TestCombinedTxnTableSourceCommitTSShortCircuits`, `TestCombinedTxnTableSourceCommitTSFailsClosedForMissingProvider`, and `TestCombinedTxnTableSourceCommitTSPropagatesMemberError` cover member maxima, short-circuiting, and fail-closed behavior.
- Terminal conflicts do not enter RC statement retry: `TestAlterCopyPostPublicationConflictIsNotStatementRetryable` checks both `isRetryErr` and `canRetry`.
- The reported concurrency shape passes: 500 independent branch tables and 500 concurrent ALTER sessions complete with zero lock-wait and zero connection-loss failures.
### Reproduction
- Issue baseline at `77dbf5464466b1d5ae784e7d17d92cd1c1c8d17d`: 301/500 workers completed, 199/500 failed, 172 failures were MySQL 1205, and 27 failures were MySQL 2013.
- Deterministic pre-fix ALTER ablation: replacing only `pkg/sql/compile/alter.go` with its base-compatible version causes `TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate` to time out while both independent physical inserts wait behind the global lineage gate.
- CI regression: old run `37943988958` panicked in `constructTableClone` from `cloneUnaffectedIndexes` during `TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation`. The missing-index retry guard and exact integration test now pass.
- Definition-guard ablation: removing only the postgate definition-version comparison causes `TestAlterCopyRejectsSameIDSourceDefChangeAfterGate` to lose the expected retry error.
- Real workload: 500 workers, 500 independent branch tables, a one-row base, and a 120-second command timeout completed in 71.995 seconds with 500/500 successful ALTERs, 500/500 observed columns, 0 failed ALTERs, 0 MySQL 1205 errors, 0 MySQL 2013 errors, and successful database cleanup (`/tmp/mo-29208-concurrency-500-revision-r6.out`).
- Source-frontier cost: `BenchmarkSourceCommitTSAtUnchanged250KObject` modeled one unchanged 250,000-row non-appendable object with a threshold after every row commit and measured `44075 ns/op`, `1125 B/op`, and `4 allocs/op` on Apple M5 (`darwin/arm64`, 10 GOMAXPROCS).
### Tests
- Previous review-response, CI-regression, and rebase validation on head `104cac3d12`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=1200s ./pkg/sql/compile ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
— passed after the rebase onto `42d42546fd2c2b2449cb81cea47f81d300139753`: compile in 18.925s, disttae in 11.943s, and logtailreplay in 8.386s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^TestIssue27055DatabaseCloneReadsExplicitTransactionSource$' ./pkg/tests/issues`
— passed in 13.087s after the transaction-local workspace-write fix.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestTxnTableHasTransactionLocalWrites|TestCombinedTxnTableHasTransactionLocalWritesShortCircuits|TestAlterCopySkipsSourceChangesForTransactionLocalWrites)$' ./pkg/vm/engine/disttae ./pkg/sql/compile`
— passed in 1.370s and 1.403s.
- Rebase integration on `433a8dc26c`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
— passed in 15.293s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae ./pkg/vm/engine`
— passed in 9.901s and 1.537s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^(TestIssue277xxDDLConsistency|TestIssue29400CopyAlterRetainedGatePromotionFastFails)$' ./pkg/tests/issues`
— passed in 18.517s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/frontend ./pkg/sql/plan`
— passed in 37.126s and 36.724s.
`gofmt -l`, `git diff --check`, and `git status --porcelain=v1 -uall` — clean.
- Exact CI regression:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation$' -v ./pkg/tests/issues`
— passed in 11.668s on the latest rebased head.
- Exact-head focused closure:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears|TestAlterCopyAndTruncateSerializeBeforeTableLocks|TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation)$' ./pkg/sql/compile ./pkg/tests/issues`
— compile tests passed; the exact integration subtest was rerun explicitly as above.
- Coverage-closing lock contracts on `e3de6b6204`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestLockAlterCopySourceRetryContracts$' ./pkg/sql/compile`
— passed.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate|TestAlterCopyAndDropUseGateBeforeSourceLocks|TestAlterCopyAndTruncateUseGateBeforeSourceLocks|TestAlterCopyFailsAfterPhysicalWorkWithoutReleasingGate|TestAlterCopyLateLineagePublicationUsesCopyTimestamp|TestAlterCopyRejectsSourceReplacementAfterGate|TestAlterCopyRejectsSourceDataChangeAfterCopy|TestAlterCopySkipsSourceChangesForRelationCreatedInCurrentTxn|TestAlterCopyRejectsSameIDSourceDefChangeAfterGate|TestAlterCopyRejectsSameStatementReplacementDiscoveredAfterGate)$' ./pkg/sql/compile`
— passed.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -coverprofile=<profile> -run '^TestLockAlterCopySourceRetryContracts$' ./pkg/sql/compile`
— passed; the profile records executions of `alter.go` blocks `1187`, `1199`, and `1210`, the three previously uncovered changed blocks that caused the 73.61% PR coverage result.
- Full owning package:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
— passed in 14.577s on the rebased head `e3de6b6204`.
- Adjacent engine packages:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae`
— passed in 7.745s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine`
— passed in 0.827s.
- Race stress:
`.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=300s -run '^(TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate|TestAlterCopyAndDropUseGateBeforeSourceLocks|TestAlterCopyAndTruncateSerializeBeforeTableLocks|TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears)$' ./pkg/sql/compile`
— passed in 4.688s.
- Static validation:
`GOWORK=off CGO_CFLAGS="-I<cgo> -I<thirdparties>/include" go vet -mod=readonly ./pkg/sql/compile ./pkg/vm/engine ./pkg/vm/engine/disttae`
— passed.
- Build:
`make build` — passed; only the existing duplicate-library linker warning was emitted.
- BVT:
`cd /tmp/mo-29208-bvt-r3 && bash /Users/ghs-mo/MOWorkSpace/mo-tester/run.sh -n -p <worktree>/test/distributed/cases/ -i diff_schema_evolve,merge_schema_evolve,alter_table_historical_lineage`
— 492/492 passed: `diff_schema_evolve` 278/278, `merge_schema_evolve` 139/139, and `alter_table_historical_lineage` 75/75.
- Real concurrency:
`ulimit -n 2048 && python3 /tmp/mo-29208-concurrency-500.py`
— 500/500 successful ALTERs, 500/500 columns verified, 0 failures, 0 MySQL 1205, 0 MySQL 2013; database dropped.
- Final hygiene:
`gofmt -l` on the seven changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean and limited to the focused seven-file scope.
The BVT and real-workload runs passed on this implementation before the latest rebase. The latest semantic rebase onto `f09d4788fd` applied cleanly; upstream changed unique-index duplicate precheck code in `pkg/sql/compile` and did not alter this PR's ALTER COPY production files. Latest exact-head validation on `79e45f24b5`:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/sql/compile` — passed in 16.208s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^TestIssue277xxDDLConsistency/27725_concurrent_alter_terminal_conflict_supports_external_retry$' ./pkg/tests/issues` — passed in 11.308s.
- `gofmt -l` on all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean and limited to the focused PR scope.
### Residual risk
- The global lineage gate remains intentionally serialized for atomic publication and genuinely conflicting owner operations; this PR narrows and orders the held section rather than removing the ordering guarantee.
- Future lifecycle owners that take both source locks and the lineage gate must preserve gate-before-source-lock ordering.
- Future lineage invariants must be added to the postgate revalidation path.
- The 500-session proof uses a one-row base to isolate the failing ALTER concurrency path; deterministic barriers and race tests provide the row-count-independent ordering proof. The full reported 250,000-row throughput workload was not rerun; the committed 250,000-row unchanged-object benchmark measures the new serialized source-frontier cost, and broader multi-object storage layouts remain a performance envelope to monitor.
- The old run's two Compose failures were infrastructure failures while pulling the `createbuckets` image (`unauthorized: access to the requested resource is not authorized`); no matching issue was found. The old `pr-size-label` failure was an unrelated runner-proxy TLS failure tracked by #27127.
### Current exact head: `cf9a1735b7`
Rebased onto current `main` `02a2823c20` and resolved both semantic rebase boundaries:
- kept pre-publication, unlocked ALTER COPY preparation;
- integrated upstream forward-FK admission by computing `replacementAdmission.createNames` before physical CREATE and passing that admission into nested `withDropLifecycle`;
- kept upstream frontend rollback classification and added `ErrTxnWriteConflict` to the whole-transaction rollback set.
The source mutation proof now closes both DELETE lifecycle counterexamples:
- retained tombstone entries, including soft-deleted objects, remain source-change proof; actual retention truncation is represented by the partition state-start floor;
- appendable tombstones read non-aborted per-row commit timestamps with the same snapshot semantics as the delete reader;
- non-appendable tombstones read per-block commit-ts zonemaps;
- unavailable tombstone files or commit-ts metadata fail closed;
- the unused public `RelationHasTransactionLocalWrites` chain was removed while preserving the private async-index local-write guard.
The concurrent ALTER integration test now distinguishes the newly upstream pre-copy FK name-pin fast-fail (`ErrLockConflict`) from terminal post-copy `ErrTxnWriteConflict`; both are externally retryable, and final schema/index assertions remain unchanged.
Latest exact-head local validation:
- `CGO_CFLAGS=... go test ./pkg/vm/engine/disttae/logtailreplay -run 'TestSourceCommitTSAt|TestMaxCommitTS' -count=1` — passed.
- `CGO_CFLAGS=... go test ./pkg/vm/engine/disttae ./pkg/sql/compile ./pkg/frontend ./pkg/common/moerr -run 'TestSourceCommitTS|TestCombinedTxnTableSourceCommitTS|TestTxnTableDelegateSourceCommitTS|TestAlterCopy|Test_isErrorRollbackWholeTxn|TestStaticRollbackSetIsInfrastructureOnly|Test.*Rollback.*Txn' -count=1` — passed before the final one-commit rebase; the production delta is unchanged by that test-only upstream commit.
- `CGO_CFLAGS=... go test ./pkg/tests/issues -run 'TestIssue277xxDDLConsistency/27725_concurrent_alter_conflict_supports_external_retry' -count=1` — passed on the exact final head.
- `git diff --check` — passed; the working tree is clean.
Freshness update: rebased exact head `cba088b792` onto `main` `02a2823c20`. The only new upstream commit changes join-expression ownership and has no file overlap with this PR. Revalidated on the exact head: focused logtail source-frontier tests, focused ALTER COPY compile tests, the concurrent ALTER integration test, and `git diff --check`; all passed.
### Coverage CI follow-up and rebase validation
Coverage run `38204952772` exposed one PR-owned test expectation and two unrelated upstream failures:
- `TestIssue29400CopyAlterRetainedGatePromotionFastFails/exclusive_gate` expected the competing ALTER to wait, but upstream pre-copy FK admission now fast-fails with `ErrLockConflict` when it meets the retained source lock. The test now accepts that expected conflict and proves the UPDATE owner can execute its next statement, commit value `2`, and complete the target `DROP TABLE` without deadlock.
- `TestPartitionTopNRejectsUnsupportedOrderType` is the existing clean-main issue #29968.
- `TestTruncateLifecycleRCWaitPolicy` is the existing clean-main issue #29971.
Exact-head validation:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestIssue29400CopyAlterRetainedGatePromotionFastFails$' ./pkg/tests/issues` — passed in 12.889s.
- `gofmt -w pkg/tests/issues/issue_29400_test.go`, `git diff --check`, and `git status --porcelain=v1 -uall` — clean before commit.
The branch already contained `main` `02a2823c20` for that test-only follow-up.
### Rebase onto `main` `7af631bdf7`
The exact head is now `cf9a1735b7`, rebased onto current `main` `7af631bdf7`. The rebase applied cleanly and incorporates the upstream fixes for the two clean-main coverage blockers:
- `TestPartitionTopNRejectsUnsupportedOrderType` (#29968) now passes on the rebased head.
- `TestTruncateLifecycleRCWaitPolicy` (#29971) now passes on the rebased head.
- The PR-owned `TestIssue29400CopyAlterRetainedGatePromotionFastFails` regression also passes after the rebase.
Exact-head validation:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestIssue29400CopyAlterRetainedGatePromotionFastFails$' ./pkg/tests/issues` — passed in 26.805s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestPartitionTopNRejectsUnsupportedOrderType$' ./pkg/sql/colexec/partition` — passed in 3.080s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestTruncateLifecycleRCWaitPolicy$|^TestAlterCopyAndTruncateSerializeBeforeTableLocks$' ./pkg/sql/compile` — passed in 3.543s.
- `gofmt -l` over all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean after the rebase.
### Review update and current exact head: `f8894b6a0f`
Rebased cleanly onto current `main` `11914526ba` and addressed the pessimistic-RC independent-ALTER publication finding:
- `admitReplacementNames` no longer runs before physical COPY preparation. Pessimistic-RC ALTER COPY now acquires the broad SNAPSHOT gate first, then pins replacement endpoint names with `WaitPolicy_Wait`.
- ALTER records the transaction's retained lock-table baseline before preparation. Gate waiting is permitted only when every retained lock table is new relative to that baseline and is certified by the workspace as created in the transaction. Pre-existing, source, catalog, or unprovable locks retain the fast-fail policy, preventing `G -> name -> G` reverse edges.
- Nested temporary CREATE and row copy propagate `WithDisableLock`; nested execution skips pre-pipeline metadata/table locks and lock operators. TRUNCATE keeps its existing fast-fail replacement-name policy.
- `TestIssue29400IndependentCopyAltersProgressInPessimisticRC` covers both a held explicit publisher and overlapping autocommit publishers. It uses separate connections, observes the independent ALTER waiting at the gate, proves it does not fail while the holder retains the gate, and proves both ALTERs finish after release.
- The exact-head validation passed for `./pkg/sql/compile` and `./pkg/tests/issues` with `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s`, including the new independent-publisher integration test. `gofmt -l` over changed Go files, `git diff --check`, and the final clean-tree check also passed.
- The versioned design and implementation now record this `G -> private preparation locks -> replacement names -> source` publication order and its liveness proof.
### Rebase onto `main` `b09f2c6fc5`
Rebased cleanly onto `main` `b09f2c6fc5` at exact head `3e5069423d`.
- The rebase introduced no semantic conflicts; the full PR delta remains scoped to the ALTER COPY publication lifecycle and its tests/design.
- Re-ran the full affected package set after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile ./pkg/tests/issues ./pkg/frontend ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
- All five packages passed.
### Current exact head after the latest rebase: `2e45e40035`
Rebased cleanly onto current `main` `cd8d5abf96`.
- The rebase applied without conflicts. Its only overlapping paths with this PR were `pkg/sql/compile/compile.go` and `pkg/sql/compile/compile_test.go`, where upstream renamed the vector-index scan node; the ALTER COPY ownership changes remained semantically unchanged.
- Re-ran the focused affected package set after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/tests/issues ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
- All four packages passed.
- `git diff --check`, `gofmt -l` over changed Go files, and the clean-tree check passed before push.
### Review update and exact head: `e088a231b9`
Rebased cleanly onto current `main` `175a645a85` and closed the unaffected-index preparation finding:
- The private ALTER-COPY temporary CREATE now opts out of transient index CDC and idxcron task registration. Because no transient tasks are registered, ALTER also skips their catalog cleanup; post-rename publication retains the existing final task-registration path. This removes the `mo_tables`/`mo_database` lock retention introduced by transient task cleanup while preserving final index-task ownership.
- IVF-FLAT `DeleteBeforeClone` now executes its private replacement hidden-table cleanup with `WithDisableLock`, so the nested DELETE acquires neither catalog metadata locks nor row locks.
- `TestIssue29400IndependentCopyAltersProgressInPessimisticRC` now enables `experimental_ivf_index`, creates an unchanged IVF-FLAT index, and covers both a held explicit publisher and overlapping autocommit publishers. The unrelated ALTER waits at the publication gate and completes after release.
- `TestAlterCopyCreateOptionsDisablesNestedCreateLock` asserts the new skip-registration option. `TestScopeAlterTableCopyInsertTmpDataPipelineFlush` now proves private preparation no longer calls `CopyTableDef` for transient task cleanup while retaining its nil-context pipeline-flush oracle.
- The versioned design records the lock-free cleanup and symmetric registration/cleanup policy.
Exact-head validation after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestScopeAlterTableCopyInsertTmpDataPipelineFlush$' ./pkg/sql/compile` — passed.
- `gofmt -l` over all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean on the exact head.
Additional validation on the identical code before the unrelated one-commit rebase (`896fa84927` on `main` `3e50e1b32d`):
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
### Current exact head after latest rebase: `6596f9dc04`
Rebased cleanly onto current `main` `e5111936b9` after the PR was reported behind.
- `git range-diff` confirms all ten PR commits are patch-equivalent to the prior head `e088a231b9`; only their base changed.
- The worktree remained clean, and no PR code or tests were modified by this rebase.
- No new semantic validation is claimed for this commit-only rebase. The exact prior-head focused validations above remain the latest code-specific evidence.
### Current exact head after latest rebase: `abd5a45122`
Rebased onto current `main` `21f19ae063` after `main` advanced twice during the refresh:
- First rebased `6596f9dc04` onto `main` `6b0da62260` at `3574aa681f`; `git range-diff` confirmed all ten PR commits were patch-equivalent.
- After the push, the live PR snapshot showed `main` had advanced to `21f19ae063`. Fetched that base and rebased again to `abd5a45122`.
- `git range-diff` between the `3574aa681f` and `abd5a45122` ranges confirms all ten PR commits remain patch-equivalent. The new upstream commit overlaps this PR only in `pkg/sql/compile/compile.go`/`compile2.go`; the automatic rebase preserves both the ALTER private-preparation locking changes and upstream prepared zero-limit producer behavior.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestPreparedZeroLimitReuse$' ./pkg/tests/sqlintegration` — passed.
- `gofmt -l` over changed Go files, `git diff --check`, protected-scope check, and the final clean-tree check passed on the exact head.
### Review update and current exact head: `7f243d2e4c`
Rebased onto current `main` `fcad62a8ff` and closed the Compile-pool registration-policy escape found in review `PRR_kwDOFEPiGM8AAAABR92hOw`:
- `Compile.clear` resets `skipIndexTaskRegistration` with the other per-statement flags (`disableLock`, `skipDataBranchReclaim`, `keepAutoIncrement`) before the object returns to the global reuse pool, and `NewCompile` re-initializes it. The ALTER COPY private-registration opt-out is now a property of the single private preparation generation and can no longer reach an unrelated later `CREATE TABLE` with an inline async/IVF index through pool reuse (`compile.go`).
- The intentional current-generation suppression is unchanged; the versioned design records the pool-boundary ownership of the opt-out (`docs/design/20261010-alter-copy-pre-publication.md`).
- `ignoreCheckExperimental`, the only other assigned-but-unreset sibling in `txnExecutor.Exec`, is pre-existing upstream state from #22428 and is currently assigned-but-never-read; it is outside this PR's introduced delta and left untouched.
Proof on the exact head:
- `TestCompileClearResetsSkipIndexTaskRegistration` exercises the pool reset directly; mutation-verified: removing only the `clear` reset makes it fail while the rest of the fix stays.
- `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy` deterministically reproduces the review's Release -> same-object `NewCompile` pool handoff (single-P, GC disabled) and proves the next frontend Compile starts with the ordinary registration policy.
- `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` proves, on one CN connection, that an ordinary inline IVF-FLAT `CREATE TABLE` registers its `mo_catalog.mo_index_update` `ivfflat_reindex` task before and after `ALTER ... ALGORITHM=COPY` private preparation, and that publication re-registers the replacement index's task.
Validation on the exact head:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 27.431s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae` — passed in 10.236s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae/logtailreplay` — passed in 27.991s.
- `- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=1800s ./pkg/tests/issues` — passed in 552.697s (177 tests, 0 failures; includes all `TestIssue29400*` roots and the new registration control). An earlier run of this suite on the same head failed once with a transient `internal error: cn service bootstrap` while the embedded cluster was starting; the identical rerun and every focused cluster test passed.`
- `gofmt -l` over changed Go files, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
CI-blocker follow-up: the tracked unrelated blocker #30047 (logservice `gossip_fixture_test.go` obsolete `randomPorts.allocate` signature failing UT/SCA/Coverage on run `38347106648`) was closed at `2026-10-13T08:30:47Z`; its fix landed on `main` in `35c8dd5854` and is incorporated by this rebase. This PR does not modify `pkg/logservice`. The push creates a new head and a fresh CI run; the stale failed run is not rerun.
### Current exact head after latest rebase: `4c5051fc77`
Rebased onto current `main` `5d971d07a7` after the PR was reported behind.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `7f243d2e4c`; only their base changed.
- The single new upstream commit `5d971d07a7` (empty indexed FK cascades / self-FK ALTER) touches `pkg/sql/plan` and BVT cases with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 16.425s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.110s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `8e5c8b3b53`
Rebased onto current `main` `e17fc0f7fe` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `4c5051fc77`; only their base changed.
- The two new upstream commits (`6ca4363a73` information_schema rewritten-column hiding, `e17fc0f7fe` prepared row-rule invalidation) touch `pkg/sql/plan`, `pkg/frontend` production files, and BVT cases with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 19.691s; the focused frontend rollback-classification tests this PR extends (`Test_isErrorRollbackWholeTxn`, `TestStaticRollbackSetIsInfrastructureOnly`, and the surrounding rollback roots) — passed in 2.152s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 9.078s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `60e84f43df`
Rebased onto current `main` `c4a210802d` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `8e5c8b3b53`; only their base changed.
- The four new upstream commits (`5652252431` window hash partitioning, `959d12d3b9` Starlark NULL boundary, `838bf5d1f8` docs MO-scan branch, `c4a210802d` Iceberg adapter module tidy) have no file overlap with this PR's source or test files; the Iceberg commit's workflow change is upstream-owned and untouched here.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 18.864s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.837s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `cd2c40fd52`
Rebased onto current `main` `a53390c57d` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `60e84f43df`; only their base changed.
- The two new upstream commits are `ec7a910a02` (TIME assignment bounds for external LOAD) and `a53390c57d` (BuildJsonPlan statistics snapshot race). The LOAD commit also touches `pkg/sql/compile/compile.go` in the extern-scan region; the rebase auto-merged it with this PR's `NewCompile`/`clear` flag changes, and both `skipIndexTaskRegistration` resets are verified present on the exact head (compile.go:161 and compile.go:571).
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 14.119s (includes `TestCompileClearResetsSkipIndexTaskRegistration` and `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy`); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 7.801s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `f796e46fb0`
Rebased onto current `main` `071a79b77f` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `cd2c40fd52`; only their base changed.
- The single new upstream commit `071a79b77f` (preserve row rewrite rules through CTAS) touches `pkg/sql/compile/ddl.go` (`populateCreatedTable`, CTAS INSERT privilege region) and `pkg/sql/compile/sql_executor.go` (rewrite-option attachment in `txnExecutor.Exec`), both outside this PR's hunks; the rebase auto-merged and all three `skipIndexTaskRegistration` sites are verified present (compile.go:161, compile.go:571, sql_executor.go:618).
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 16.696s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.558s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `ad74f1e810`
Rebased onto current `main` `5a0570ea70` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `f796e46fb0`; only their base changed.
- The three new upstream commits (`2e139d84bf` Kafka Connect recovery qualification harness, `ac98d7bd1f` scalar DESCRIBE view reflection coverage, `5a0570ea70` docs/skills template validation) are test/documentation changes with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 23.443s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.945s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Review update and current exact head: 173bf86f72
Addresses aptend's test-reliability P2 from the deep re-review of `ad74f1e810e2d1b6c360129e326155dc3fa4875c` (that review closed the previous P1 pool-leak blocker and substantiated no further production blocker). The P2: the new pool-handoff regression asserted `sync.Pool` pointer identity, which the pool's documented contract and the race runtime do not support — `Put` drops values with probability 1/4 under the race detector — so the canonical `-race -count=100` validation could fail randomly on a correct implementation (19/100 on the reviewer's run, reproduced locally at compile_test.go:203).
This cycle adds one commit, test-only. At commit time `main` was unchanged (`5a0570ea70083c9365719009a5ed8d7618f9ed91`); it advanced to `55a019f0b0` during validation, so this commit was then rebased before pushing - see the rebase section below for the patch-equivalence record.
- `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy` is now a drop-tolerant, policy-based oracle. Each of 16 rounds seeds the exact leak payload through the real boundary — private executor `Compile` with its executor-set policy, `Release` (`Compile.clear` then `sync.Pool.Put`) — and requires the ordinary registration policy on the frontend `Compile` constructed next by the public `NewCompile`, whichever object the pool returns. Pointer identity is only logged; a legitimate pool drop can never fail the root. Drops cannot mask a leak: inheritance requires a `Put` the pool kept, every kept seed is asserted on the immediately following construction, and with both reset layers present the root is green by construction.
- Non-masking is verified by mutation: with both the `clear()` reset and the `NewCompile` init removed, the root fails deterministically without `-race` at round 0, and fails all 3 invocations with `-race -count=3`; with the resets present, the canonical race command is fully green. The `clear()` reset layer keeps its deterministic, pool-free probe `TestCompileClearResetsSkipIndexTaskRegistration` (removing only the `clear` reset still fails it).
- Exact-head revalidation: `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS 8.500s (100/100); the same command without `-race` — PASS (7.344s); full `./pkg/sql/compile` package - PASS 18.046s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Rebase onto current main: `173bf86f72` (`173bf86f7228cfc5c3ac604294e2581803ee4294`)
`main` advanced from `5a0570ea70` to `55a019f0b0` during the validation above, so the branch was rebased before pushing.
- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the new drop-tolerant handoff test) are patch-equivalent to the pre-rebase head `01fb35bb3a`; only their base changed.
- The three new upstream commits (`944b721d1b` JOIN reset buffers across execution generations — `pkg/sql/colexec/{dedupjoin,hashjoin,indexjoin,loopjoin}`, `821250ea88` recursive-CTE test cases, `55a019f0b0` canonical collation admission tests) have no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation after the rebase: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 18.046s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 8.500s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 18.363s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `2990b63c36` (`2990b63c36c8cd5d6c652f8927503af2a95361cd`)
Rebased onto current `main` `b2e8bc4789` after `main` advanced again while the previous section was being pushed (`55a019f0b0` -> `b2e8bc4789`).
- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the drop-tolerant handoff test) are patch-equivalent to the prior head `173bf86f7228cfc5c3ac604294e2581803ee4294`; only their base changed.
- The single new upstream commit `b2e8bc4789` (remap reused CTE readers after projection pruning) touches `pkg/sql/plan/{cte_reuse.go,query_builder.go}` plus CTE test cases, with no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 25.422s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 8.389s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 8.846s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `0ed0f79634` (`0ed0f79634b20a0f8b8c74d525f91999dc4cd3f1`)
Rebased onto current `main` `fab7b5c043` after the behind event (head `2990b63c36` was reported behind `main` advanced `b2e8bc4789` -> `fab7b5c043` shortly after the previous cycle's push).
- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the drop-tolerant handoff test) are patch-equivalent to the prior head `2990b63c36c8cd5d6c652f8927503af2a95361cd`; only their base changed.
- The single new upstream commit `fab7b5c043` (preserve join predicate ownership during reordering, #30056) touches `pkg/sql/plan/associative_law.go` plus a plan regression test, with no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 14.853s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 10.348s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 7.680s (first invocation of this root during the cycle aborted with `[build failed]`: the Go linker could not reopen cached cgo objects after a build-cache eviction; the identical command was rerun and passed in 7.680s, so the abort was a toolchain cache eviction, not a test failure).
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `16023e02d6` (`16023e02d691abaa1e46fc0481d40cc0509c1c2e`)
Rebased onto current `main` `51300cbd01` after the behind event (head `0ed0f79634` was reported behind; `main` advanced `fab7b5c043` -> `51300cbd01`).
- The single new upstream commit `51300cbd01` (prevent table rename from bypassing role row filters, #29186) is the first upstream commit during this PR's life that also modifies this PR's main production file: `pkg/sql/compile/alter.go` (+183 — new `checkRoleRuleRenameAdmission*` admission gates at the `Scope.RenameTable` entry and the rename-action path of `Scope.AlterTable`, plus new `role_rule_lifecycle.go`), `alter_test.go`, `types.go` (new `Scope.roleRuleRenameAdmissionChecked`), frontend rename/rewrite-rule files, and two `pkg/tests/issues` roots.
- The rebase auto-merged. Semantic integration verified: the rename admission is orthogonal to this PR's ALTER COPY lifecycle — it runs for user rename statements/actions, while `alterTableCopy` publication (broad gate -> endpoint name pins -> source locking/revalidation -> private-replica replace) is untouched by the upstream hunks. Upstream's insertion anchor `reconcileAlterCopyAutoIncrement` is pre-existing `main` machinery from #26197, not part of this PR. `git range-diff` shows eleven commits patch-equivalent and commit 1 (`fix(alter): avoid global lineage gate during physical copy`) with only its import-hunk context shifted by upstream's import additions; no patch content changed.
- Exact-head revalidation, run over the full affected package set because upstream added tests inside the same packages this PR touches: `./pkg/sql/compile` - PASS 13.688s (includes both this PR's lifecycle/pool regression roots and upstream's new rename-admission roots); `./pkg/frontend` - PASS 34.112s (includes upstream's rewrite-rule/authenticate roots and this PR's whole-transaction rollback roots); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 18.887s, no failure in 100 runs; full `./pkg/tests/issues` - PASS 413.353s (includes upstream's new/updated issue_29133/issue_29095 roots and this PR's issue_29400/issue_277xx roots).
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `cb0ded487f` (`cb0ded487f49a9ad3113c654ccf1404949eec24a`)
Rebased onto current `main` `fd4767e488` after the behind event (head `16023e02d6` was reported behind; `main` advanced `51300cbd01` -> `fd4767e488`).
- The single new upstream commit `fd4767e488` (exclude fake primary key from LAST_INSERT_ID, #30004) touches `pkg/incrservice` and its test cases only, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record above remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `16023e02d691abaa1e46fc0481d40cc0509c1c2e`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 14.348s (includes both pool-boundary regression tests); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 8.890s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 8.838s; the upstream-changed `./pkg/incrservice` package - PASS 5.350s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `a9d969890c` (`a9d969890c8a2e9076840237c163af588bce19fb`)
Rebased onto current `main` `a33dcfb2e5` after the behind event (head `cb0ded487f` was reported behind; `main` advanced `fd4767e488` -> `a33dcfb2e5`).
- The single new upstream commit `a33dcfb2e5` (perf: reduce wide-schema work and redundant gossip fixture startup, #30200) touches `pkg/sql/plan/{default_binder.go,build_show_util.go,types.go}` plus plan/logservice tests, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `cb0ded487f49a9ad3113c654ccf1404949eec24a`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 21.080s (includes both pool-boundary regression tests and exercises upstream's plan-binder change through the normal compilation paths); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 7.788s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 7.968s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `7f086296db` (`7f086296db9f32e3ebcd1d59ef36da325bd20fd9`)
Rebased onto current `main` `b1a6da4e16` after the behind event (head `a9d969890c` was reported behind; `main` advanced `a33dcfb2e5` -> `b1a6da4e16`).
- The single new upstream commit `b1a6da4e16` (fix(parser): reject overflowing type lengths and scales, #30176) touches `pkg/sql/parsers/dialect/mysql` plus tests, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `a9d969890c8a2e9076840237c163af588bce19fb`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 13.528s (includes both pool-boundary regression tests); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 9.102s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 9.154s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run. For the record, the prior head `a9d969890c`'s CI had already passed SCA Linux/arm64, UT Coverage on Ubuntu/x86, and the PROXY BVT compose before this rebase superseded it; its remaining checks were still queued/in progress and are replaced by the new run.
### Current exact head after review fix and rebase: `f0840a56e0` (`f0840a56e0d382b3219b449a69a84a53bc957dbe`)
Handles the shared P1 from aptend's thread and XuPeng-SH's mo-bot review (timestamp-only snapshot rewind after workspace-owned advancement), plus the behind event, in one cycle.
- Rebase: `main` advanced `b1a6da4e16` -> `bdbbd17792` (19 upstream commits: parser/plan/aggregate/function fixes, fileservice ENOSPC handling, race-UT runtime reduction, Sirius update; zero file overlap with this PR's delta). The rebase auto-merged; `git range-diff` confirms all twelve prior commits patch-equivalent.
- P1 fix (new commit `fix(alter): retain workspace-owned snapshot on copy return`): `alterTableCopy` no longer rewinds only the transaction timestamp after the pre-copy `databranchutils.AdvanceLineageSnapshot` workspace advancement. The rewind defer reintroduced by this PR's first commit was the exact defect main's #29539 removed; after `Workspace.AdvanceSnapshot` relocates transaction-local tombstones, a timestamp-only rewind leaves the workspace and snapshot in different generations and resurrects relocated deletes of earlier uncommitted DML. The workspace-owned advanced snapshot is now retained on every return path, matching the publication-side advance and the other owners; the duplicated `isTemp`/non-temporary advance branches collapsed into one mode-gated call. The design doc records the ownership rule and its #29539 lineage.
- New tests: `TestAlterCopyRetainsWorkspaceAdvancedSnapshotOnEveryReturn` (pessimistic-RC `Scope.AlterTableCopy`; any `SetSnapshotTS` rewind fails the test; retention asserted across the workspace-advance-failure and post-advance physical-copy-failure returns; mutation-verified in both directions) and `TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn` (real cluster: uncommitted in-memory DELETEs survive a forced DN flush and the ALTER COPY return inside the same pessimistic-RC transaction and after commit).
- Exact-head validation: full `./pkg/sql/compile` - PASS 14.987s; the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 7.286s, no failure in 100 runs; both new roots - PASS; full `./pkg/tests/issues` - PASS 329.117s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's green CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `ebda98e960` (`ebda98e960e398f4436338f6353f1064d5009161`)
Rebased onto current `main` `501c85ecdd` after the behind event (head `f0840a56e0` was reported behind; `main` advanced `bdbbd17792` -> `501c85ecdd`). No code change in this cycle.
- The single new upstream commit `501c85ecdd` (perf(test): shorten embed and isolated race process lifetimes, #30249) touches `Makefile`, `optools/run_ut.sh`, and `optools/ut_embedded_schedule_test.go` only — test-infrastructure files with zero overlap with this PR's delta; the rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the prior head `f0840a56e0d382b3219b449a69a84a53bc957dbe`; only their base changed.
- Exact-head validation: full `./pkg/sql/compile` - PASS 13.871s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 6.486s, no failure in 100 runs; focused issue roots in `./pkg/tests/issues` (`TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn`, `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation`, `TestIssue29400IndependentCopyAltersProgressInPessimisticRC`) - PASS 9.997s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `9c2e6a6257` (`9c2e6a62574f0b34881fb14a48561ebe4cd054dd`)
Rebased onto current `main` `f2093ae4b3` after the behind event (head `ebda98e960` was reported behind; `main` advanced `501c85ecdd` -> `f2093ae4b3`). No code change in this cycle.
- The two new upstream commits — `f2093ae4b3` (fix(json): reject wildcard and range paths in JSON_KEYS, #28328) and `bb2b725d0a` (fix(shardservice): preserve immutable read cache snapshots, #30187) — touch `pkg/common/moerr/error.go`, `pkg/container/bytejson`, `pkg/shardservice`, `pkg/sql/plan/function` JSON files, and BVT cases, with zero file overlap with this PR's delta. The rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the approved head `ebda98e960e398f4436338f6353f1064d5009161`; only their base changed, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`) and the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), both recorded on `ebda98e960`, and the amended-design PASS (issuecomment-6186238709) review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 14.281s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 9.351s, no failure in 100 runs; the upstream-adjacent `./pkg/common/moerr` - PASS 0.492s; focused issue roots in `./pkg/tests/issues` (`TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn`, `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation`, `TestIssue29400IndependentCopyAltersProgressInPessimisticRC`) - PASS 8.902s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's terminally green CI run (38688137369, CI Required SUCCESS) is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `ce9ed59493` (`ce9ed594933ffe3cf2ea8403b561956d1c833eac`)
Rebased onto current `main` `461bc8e349` after the behind event (head `9c2e6a6257` was reported behind; `main` advanced `f2093ae4b3` -> `461bc8e349`). No code change in this cycle.
- The two new upstream commits — `461bc8e349` (fix(plan): omit overwritten implicit fulltext ordering, #30189) and `b5a4d5c795` (fix(frontend): enforce Starlark OUT and INOUT parameter types, #30134) — touch `pkg/sql/plan` fulltext-index files, `pkg/frontend` Starlark files, and embed/config tests, with zero file overlap with this PR's delta. The rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the approved head `9c2e6a62574f0b34881fb14a48561ebe4cd054dd`; only their base changed, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`), the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), and the amended-design PASS (issuecomment-6186238709) continue to review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 15.167s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 7.856s, no failure in 100 runs; the upstream-modified `./pkg/frontend` (includes both this PR's whole-transaction rollback roots and upstream's new Starlark roots) - PASS 28.287s; focused issue roots in `./pkg/tests/issues` (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers) - PASS 9.759s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `a0e40253d0` (`a0e40253d0488e9c9f0b96752dec0724296df85d`)
Rebased onto current `main` `c46b893f61` after the behind event (head `ce9ed59493` was reported behind base `461bc8e349`, then conflicting while `main` advanced `461bc8e349` -> `83222fa837` -> `c46b893f61`). No PR-side behavior change in this cycle.
- The base hop through `83222fa837` picks up `8795f3699b` (revert: restore fulltext planner before #30189, #30285), upstream's fix for the CI blocker that failed the previous head's run `38703760162`: #30189's widened `tryApplyCoveredFulltext2` missed the stale call site at `apply_indices_fulltext_snapshot_test.go:180-182` and broke the `pkg/sql/plan` test build, failing SCA Linux/arm64, UT Coverage Ubuntu/x86, and UT Test Ubuntu/x86, blocking the Coverage merge at its `Verify coverage prerequisites` step, and turning the `CI Required` gatekeeper red — one verified root cause, pre-existing on `main`, with this PR contributing zero lines to `pkg/sql/plan`. The current base additionally contains the properly re-landed fulltext work `e8b3ed7f21` (fix(plan): integrate fulltext ordering and covered score limits, #30289); `mo-cgo-test -run '^$' ./pkg/sql/plan` passes on this head, so the defect is gone from the merge result.
- The rebase required a semantic interleave in two hunks where upstream `b6789851ca` (#30222) added the statement-retry `lastInsertIDBaseline` to the exact `Compile` flag block this PR extends: `types.go` now declares both upstream's `lastInsertIDBaseline uint64` (with its retry-restore comment) and this PR's `skipIndexTaskRegistration bool`, and `clear()` resets both (`c.lastInsertIDBaseline = 0` upstream; `c.skipIndexTaskRegistration = false` this PR, beside the other per-statement flags). Upstream's compile2.go save/restore pair is untouched and this PR's pool boundary is unchanged. Upstream `a85d90efc9` (#30334) also added cross-CN `SYNCCOMMIT` fences to its own `TestIssue29400CopyAlterRetainedGatePromotionFastFails` root inside `pkg/tests/issues/issue_29400_test.go`; the merged file keeps those fences and this PR's roots. The whitespace part of the resolution was folded into commit 10, preserving the clean 13-commit stack.
- `git range-diff` shows eleven PR commits patch-equivalent; commits 10 and 11 differ only by the interleaved upstream field/reset inside their existing hunks — every line the PR itself adds is unchanged, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`), the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), the design-first PASS (issuecomment-6141109182), and the amended-design PASS (issuecomment-6186238709) continue to review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 34.197s (includes this PR's lifecycle/pool roots and upstream's new retry-baseline and calendar-interval roots); full `./pkg/frontend` - PASS 21.086s (includes upstream's show-metadata/authenticate changes and this PR's whole-transaction rollback roots); `./pkg/sql/plan` build check - ok 1.443s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 4.120s, no failure in 100 runs; focused roots in `./pkg/tests/issues` (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers, plus upstream's re-fenced retained-gate root in the shared file) - PASS 11.945s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's red run `38703760162` (verified upstream-caused) is superseded; this push produces a fresh CI run for the new head.
### Current exact head after latest rebase: `2f4f928170` (`2f4f928170cb614dd8570ff6f4151f98dc1d4821`)
Rebased onto current `main` `76deafc806` after the behind event (head `a0e40253d0` was reported behind; `main` advanced `c46b893f61` -> `76deafc806`). No code change in this cycle.
- The single new upstream commit `76deafc806` (fix: report SELECT division-by-zero warnings, #30314) touches `pkg/sql/compile` expression/remoterun protocol files plus new division-warning test roots, `pkg/sql/plan/function/arithmetic.go` plus new plan test roots, rege…
由 LW 授权的 ChatGPT Personal 智能体提交。
What type of PR is this?
Which issue(s) this PR fixes:
Related to #25877 (does not automatically close the issue).
What this PR does / why we need it:
Keep published shard read-cache maps immutable. removeCache now shares the existing copy-on-write removal path; deletion retries CAS conflicts. Cache addition also uses CAS so an outdated snapshot cannot overwrite an unrelated concurrent deletion.
Two files, +61/-16 (77 changed lines including regression tests). No generated files required; repository native generation was actually built for validation. No SQL/storage format change.
Verification
Product commit: b70690c.
Actual fork verification: https://github.com/MatrixAdventurer/matrixone/actions/runs/38369130578
Validation commit: 4253bc9.
Full commands, logs, source/patch and checksums are retained in artifact 11797959963 and Issue [Bug]: shardservice removeCache 原地修改已发布快照导致并发 map 崩溃 #25877 comment 6141467810.
These are actual focused/package gates, NOT full repository CI. Concurrent tests allow contention but do not deterministically force CAS failure.
Independent review previously Approve; fresh read-only independent review on 2026-10-14 also Approve, no findings. Latest main b2e8bc4 does not change shardservice, Go dependencies, Makefile, lint configuration or the CGo test wrapper relative to the verified baseline.
Delivery / operations
User fork MatrixAdventurer/matrixone, upstream and push permission verified; feature branch head read back. No exact dev branch exists; current user authorization explicitly allows main in this case. No direct upstream push, merge, deployment or issue closure.
The maintainer's prior “low priority!” comment is respected: this only publishes the already completed small patch, without expanding its scope. Assignee/review request will target the actual GitHub username XuPeng-SH. Read-only verification and all publishing operations were performed by the attributed agent above.