Repository navigation
Conversation
Preserve default relevance order, observing pagination and stateful consumers. Add canonical SQL regression coverage for all fulltext owners.
VioletQwQ-0
marked this pull request as ready for review
October 14, 2026 10:53
VioletQwQ-0
requested review from
LeftHandCold,
XuPeng-SH,
aptend and
aunjgr
as code owners
October 14, 2026 10:53
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? |
cpegeric
added a commit
to cpegeric/matrixone
that referenced
this pull request
Oct 15, 2026
…t test matrixorigin#30193 added this call after matrixorigin#30189 added the orderOverwritten parameter, so pkg/sql/plan tests do not compile on main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 task done
cpegeric
added a commit
to cpegeric/matrixone
that referenced
this pull request
Oct 15, 2026
…ore-limit test" This reverts commit 3896399. The fix belongs to main (matrixorigin#30189 x matrixorigin#30193), not to this PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 of 7 tasks
2 of 7 tasks
2 of 7 tasks
XuPeng-SH
added a commit
that referenced
this pull request
Oct 15, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Related to #30164 — the original performance issue addressed by #30189. Reverts #30189 (`461bc8e34920959e5fc141e3d1b37673a90894e1`). This rollback restores compilation and the previous covered-score TopK behavior; it does **not** fix #30164. Keep #30164 open for the coherent follow-up optimization. ## What this PR does / why we need it: The original issue #30164 reports an unused relevance-score Sort below an explicit vector-distance or other-key ordering. PR #30189 attempted to eliminate that work. Fully revert #30189 to restore the previous fulltext planning implementation while its integration problems are addressed separately. The original performance requirement remains tracked in #30164. The verified main head fails planner UT compilation because one call to `tryApplyCoveredFulltext2` omitted its newly added `orderOverwritten` parameter. After fixing only that test call in an isolated main-source view, the existing score-alias LIMIT and LIMIT+OFFSET tests also fail: implicit-sort removal leaves the existing covered TopK consumer expecting the old intermediate-sort shape, so candidate LIMIT pushdown is lost. This is an exact `git revert` of the main commit, with no independent optimization, test relaxation or additional production branch. `git diff b5a4d5c HEAD` is empty: the resulting tracked tree exactly matches the parent of #30189. The tradeoff is restoration of the previous redundant implicit relevance sorts and their CPU/memory cost. The optimization can be reintroduced after its consumers and existing regression tests are integrated coherently. ### Verification of the revert commit Revert head: `1e3233159a0e36a7005d52fade502404047b40f5`, based on verified main `461bc8e34920959e5fc141e3d1b37673a90894e1`. - **Exact source equivalence:** revert HEAD and pre-#30189 commit `b5a4d5c7958fe921288f73083eab74dd5609f85e` both have tree `21876c5e13bae15fc12727b8efc211564a96d137`. Their complete tracked-tree diff is empty. No extra fix is included. - **Test compilation:** repository CGo wrapper, `-run '^$' -count=1`, `pkg/sql/plan`, `pkg/sql/compile`, `pkg/cnservice`: PASS, exit 0. This intentionally proves compilation only, not execution of those entire suites. The missing-argument error is gone. - **Related race UT:** existing covered-fulltext snapshot and score-limit tests: 19 named PASS terminals, exit 0. Score-alias LIMIT and LIMIT+OFFSET retain their original positive assertions. - **Complete owning planner race UT:** CGo wrapper, `-short -race -count=1 -timeout=12m -p=2 ./pkg/sql/plan`: PASS, 15,404 named passes, 2 existing skips, zero failures, 99.809 s. Linux amd64 / Go 1.27.1 / GOMAXPROCS=2. - **Actual service build:** `go build -mod=readonly -p=2 -ldflags=-w ./cmd/mo-service`: PASS, exit 0; resulting ELF and native-library resolution checked. Native source inputs match the already validated artifacts; no native source changes are included. - **Incremental configured SCA:** PASS, 0 issues, exit 0; `golangci-lint run --new-from-rev=461bc8e34920959e5fc141e3d1b37673a90894e1 ./pkg/sql/plan`. - `git diff --check`: PASS; worktree clean. No full-repository UT/Coverage/BVT execution is claimed. Local evidence: `/home/xupeng/ut-race-next-20261015/revert-pr-*` (raw JSON, build/static logs, command scripts and tree/binary fingerprints). Verification above was performed after opening this revert PR as requested. The separate optimization PR #30277 is not part of this revert diff.
This was referenced Oct 15, 2026
2 of 7 tasks
2 of 7 tasks
XuPeng-SH
pushed a commit
that referenced
this pull request
Oct 15, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #30164 Integration follow-up to #30189 and #30193, based on main `8795f3699b` after the emergency revert #30285. References the optional-inner-sort repair in #30274; that reference PR is unchanged. ## What this PR does / why we need it: Restore removal of implicit fulltext relevance sorts when an explicit order replaces them, while preserving safe covered FULLTEXT2 score candidate limits. The revert restored compilation and Top-K behavior but also restored the redundant sort reported in #30164. The score-LIMIT consumer now accepts both `SORT -> PROJECT -> INDEX_SEARCH_SCAN` and the equivalent shape with an intervening implicit score sort. A present inner sort must still have the same single score-DESC key. Direct-column projection, exact-search, filter, pagination, rank, secondary-key, ASC and overflow barriers remain enforced. The outer sort retains SQL pagination; the search receives LIMIT+OFFSET (2 for LIMIT 2, 3 with OFFSET 1). Search-level rank is also explicitly rejected. Python UDF handlers are conservatively treated as order-sensitive: the wrapper registry flags cannot establish handler purity. This applies recursively inside scalar wrappers and preserves the implicit relevance order before their projections. Update all covered-rewrite test callers together with the ordering change. Public parse/bind/optimize regressions cover default implicit relevance order, explicit MATCH and score aliases, nested pages, LIMIT/OFFSET and unsafe controls. Typed tests independently cover the optional sort's equivalence and refusal barriers. Restore #30189's ordering regressions and extend the canonical candidate-limit BVT with distinct-score pages and combined candidate-bound/single-sort assertions. Validation on `3d263e5c79bef731a1667c8c294708818d932cf6` (local run content matches this commit): - Reproduced raw `461bc8e349` planner UT compilation failure at the missing boolean argument. On an amended baseline containing only that mechanical argument fix, `score_alias` and `score_alias_offset` fail their candidate-limit assertions. - A new public planning regression fails in all 6 direct/wrapped Python UDF scenarios on the previous PR head `25a66777d2`, and passes with the local purity-proof repair. - PASS: fresh native `make -j8 cgo`; focused regressions; complete `pkg/sql/plan` tests (`-count=1`); owning build and vet; incremental golangci-lint. - PASS (reused unchanged consumer evidence): focused FULLTEXT2 search/Top-K/candidate/INCLUDE tests, complete `pkg/fulltext2/plugin/search`, and complete `pkg/sql/colexec/vectorscan` tests. - PASS: default SIMD `mo-service` build and real SQL on a private macOS/arm64 instance, Go 1.27.1. Toolchain PATH was pinned after the system launcher's automatic switching failed. - PASS: normal mo-tester `-n -g -o` comparison of `fulltext2/fulltext2_candidate_limit.sql`, `fulltext2/fulltext2_covered.sql`, and `fulltext/fulltext_overwritten_order.sql`, twice on the same instance: **180/180 statements per round, zero ignored or abnormal**. Fixtures were staged byte-for-byte outside `.codex` to avoid mo-tester's dotted-path rewriting. - PASS: independent test-database residue checks after each round; graceful instance shutdown, closed test ports and removal of its data directory; Python UDF catalog entries are also removed. - Python handler execution: NOT_RUN. The new SQL regression uses real CREATE FUNCTION/EXPLAIN without a Python service to assert the ordering barrier; it does not claim external-handler runtime validation. - Pending: exact-head Linux CI and formal QA/performance acceptance. These functional checks do not claim a throughput improvement. QA required: yes — the full issue's performance acceptance and exact-head CI remain separate from local functional validation. Ready for review; #30164 remains open for QA/performance acceptance. Exact-head CI is still in progress. No scoring, defaults, index format, cache, remote benchmark or issue-lifecycle changes. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
XuPeng-SH
added a commit
that referenced
this pull request
Oct 15, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [x] Code Refactoring ## Which issue(s) this PR fixes: Fixes #30232. Fixes #30243. Related to #29562 (the existing UT performance tracking issue is closed; this is a follow-up). ## What this PR does / why we need it: Reduce work inside the existing race UT execution path, preserving the same runner, test roots, CN topology, assertions, race instrumentation, coverage and BVT selection. Reuse the existing Go package scheduler and cluster-admission owner; no new worker pools are introduced. ### Design and implementation - **Constant folding:** reuse a successful whole-subtree spatial-capability scan during recursive folding. Keep both existing folding owners, their guard placement, spatial admission requirements, prepared-expression behavior and child evaluation order. No persistent cache or mutable cross-query state. - **CN startup:** enqueue the initial heartbeat through the existing serial heartbeat owner after command targets have been constructed. Cancellation is checked before sending queued work. Frontend readiness remains governed by its existing owner. - **Mock cluster teardown tests:** use private namespaces of the existing admission manager. These mocks start no real services and should not reserve the real cluster admission slots. Real file locks, lease ownership and release semantics remain tested; actual clusters retain the runner admission mechanism. - **Object metadata:** empty/all-NULL batches contribute no NDV, so skip their dense HLL allocation/scan while preserving NULL counts, zone maps and sketches from preceding non-NULL batches. Remove unused `pkData` retention and its unused getter: Bloom filters still consume the current PK vector immediately and PK NDV still uses row count. This state was never serialized; no disk format/version or old-data reader changes. - **Wide DDL:** reuse the existing Unicode SimpleFold key implementation for linear duplicate-column detection, retaining EqualFold equivalence and the existing error order. Build the legacy 4098-column/two-partition fixture from a minimal SQL-derived template with the original column attributes. Keep its actual width, rows, COPY, rollback, rejection/error-code and cleanup assertions. Existing legal CREATE boundary UT/BVT remain intact. - **#30232:** observe durable broadcast-consumer retirement even when scheduler completion is already ready; retain the final scheduler result. The old late-observation oracle failed 4/10 controlled runs; the corrected test passed 100 rounds. - **#30243:** use the existing RPC filter to select both retry-before-keeper and keeper-before-Lock-handler schedules. Preserve successful same-txn retry before invalidation; after authoritative keeper rejection, assert fencing, release old intents, and verify fresh-txn recovery. The old same-txn-success oracle failed 3/3 deterministic race runs. Production fencing is unchanged. Retire fixture tables through their existing lifecycle owner. - Tighten existing sink/pipeline tests to cover accepted work queued before failure, exactly once completion, cleanup and original-error preservation. Remove an unnecessary fixed startup sleep. Implementation and test counts are recorded in the PR diff; no experiment artifacts are included. For the eight retained commits: implementation 11 files, +103/-79; tests 15 files, +488/-198. No documentation or experiment files are committed; moving the fold helper is not counted as a cleanup benefit. ### Measured local results and limits Controlled sequential arms used Linux amd64, Go 1.27.1, GCC 14.2, identical source/native inputs within each pair, GOMAXPROCS=2 per test process, an eight-CPU quota, 16 GiB aggregate memory limit and no swap. These are staged measurements at base `501c85ecdd6eee0195172743c6d8aaf125cb252d`, before the final four-commit main rebase; they are not exact-head whole-CI measurements. | Scope | Wall before / after | Resource result | |---|---:|---| | Full embedded package, same 406 PASS + 2 existing SKIP terminals | 204.15 / 177.18 s | Integrated aggregate PSS about -15%; CPU about +1.2%; peak PSS about +8.5% | | Unchanged large-OR SQL integration scenario | 36.16 / 15.33 s | CPU 38.37 / 13.64 s; peak PSS about -6% | | NULL-sketch change, unchanged wide SQL scenario (reverse-order pair) | 54.27 / 50.16 s | CPU 64.73 / 57.77 s; peak PSS about -5.7% | | Additional wide-template/linear-validation change (reverse-order pair) | 49.12 / 45.49 s | CPU 56.93 / 50.04 s; integrated PSS about -8%; peak PSS about +7.8% | The wide tests also passed forward-order comparisons; those controls had larger wall-time variance and are not used as the conservative estimate. These overlapping staged results must not be summed into an end-to-end CI saving. Whole-CI peak-memory reduction and the ten-minute CI target remain **unproven**. ### Validation Before rebase: - Full planner normal and race: 15,414 PASS + 2 unchanged SKIP terminals each; configured incremental SCA PASS. Planner coverage 80,239/94,997 -> 80,240/94,997 statements, no unchanged-source-block coverage regression (prior normal/current race profiles). - Full plan/rule folding validation retained all prior terminal scenarios. Spatial distance families, invalid inactive branches and independent list-element admission are explicitly covered. - Full CN/compile normal and race: PASS; objectio/ioutil normal/race: 126 PASS each; admission race: PASS. Admission coverage union matches 100/110 statements in both arms. Objectio retained-block coverage is unchanged; removing dead code changes its aggregate 66.10247% to 66.10169% (both round to 66.10%). - #30243: 50 race rounds / 150 named PASS terminals; related race regressions 15 PASS; full lockservice normal 870 PASS; configured incremental SCA 0 issues. - Actual `ddl/table_column_limit.sql` BVT comparison on an isolated current-code embedded instance: 34/34 statements PASS, zero ignored, twice on the same instance. ISCP readiness was observed before execution and database cleanup was asserted between and after rounds. Expected results were not regenerated. ### Rebase and ordinary embedded package scheduling Rebased onto main `83222fa8371007c7969d3aeca3ab8ced90695f4c`; current head `26b298f88f8d17469d5e7c6cc7307cb831464610`. Range-diff confirms all eight retained patches are unchanged by this rebase. The separate fulltext repair was removed following the merged rollback of #30189; the affected fulltext files match main. The six ordinary embedded packages previously ran through `go test -p 1`. Use the existing Go scheduler with at most two test processes, `GOMAXPROCS=2` each, and the existing two-slot cluster admission owner. The four-batch embedded groups still run at most two batches concurrently. Existing high-footprint/unknown-package classification forces serial execution; one/four-issue-batch defaults and explicit serial rollback remain available. Failure, cancellation and report ownership stay in the original driver. No cases, assertions, CN topology, coverage instrumentation or BVT selection are removed. A sequential local pair on identical source/native inputs, with a four-CPU quota, 8 GiB memory cap and no swap, measured the complete six-package ordinary wave: | Metric | Serial | Two concurrent processes | |---|---:|---:| | Wall time | 185.642 s | 116.567 s (-37.2%) | | CPU time | 179.389 s | 198.032 s (+10.4%) | | Aggregate test-process peak PSS | 2.169 GiB | 3.180 GiB | | Integrated PSS | baseline | +4.1% | Both arms retained the identical 163 named terminal outcomes (150 PASS, 13 existing SKIP). This improves wall time with a resource tradeoff; it does not demonstrate reduced whole-CI CPU or memory. Against the observed 500-second ordinary CI wave, proportional scaling suggests roughly three minutes saved, **not yet verified in CI**. Four concurrent processes were measured separately but are not adopted because of their larger memory peak. These results cannot be added to overlapping earlier measurements to claim the ten-minute target. Validation: - On final rebased head: actual six-package Go race driver PASS, all six packages successful, 150 named PASS and 13 existing SKIP; terminal process exit 0. - On final rebased head: configured incremental SCA across all ten changed Go packages PASS, 0 issues, terminal exit 0. - On final rebased head: production `mo-service` build PASS, terminal exit 0; binary metadata records revision `26b298f88f8d17469d5e7c6cc7307cb831464610`, `vcs.modified=false`. - Full optools race suite: 324 named PASS, zero failure/skip, terminal exit 0 before rebase; its source and this stage's patches are unchanged by the rebase. Existing tests cover defaults, serial rollback, unknown/high-footprint classification, admission settings and failure handling. - An initial local lint run hit its own 6 GiB scope limit (exit 137); rerunning with concurrency 1, GOMEMLIMIT=6 GiB and a 10 GiB scope passed. This was not a lint diagnostic. - A local MinIO executable on the root filesystem stalled while reading its own binary checksum. Both fresh measurement arms and actual-driver runs used a byte-identical copy on NVMe; the MinIO cases passed without skips or longer timeouts. - No new full BVT run is claimed for this scheduling-only stage; historical production-change BVT evidence is retained above. ### Earlier full local race attempt (26b298f; historical failure) The complete local race runner has been started on head `26b298f88f8d17469d5e7c6cc7307cb831464610`, using the repository Make/runner entry point with no package filters or added skips. Native prerequisites completed and the light stage is running. It observed a local MinIO startup failure in `pkg/sql/colexec/external/TestExternalArrowLoadFromLocalMinIOAndRejectsObjectChange` (connection refused after the 15-second readiness budget; no MinIO log output). This full-run invocation omitted the previously validated byte-identical NVMe MinIO copy from PATH. A focused repeat on the same source/native inputs with that copy passed: named test 7.54 s, package 9.13 s, process exit 0. The root-filesystem checksum-read stall is consistent with earlier diagnosis but is not proved for this particular failure. The original full-run failure is retained; the full run remains **pending and must not be reported as a clean PASS**. Local limits are eight CPU cores, 16 GiB memory and no swap within the test scope. The local invocation uses `UT_PARALLEL=8`, light parallelism 6 and inherited `GOMAXPROCS=2`; the referenced CI used `UT_PARALLEL=6` without this explicit global GOMAXPROCS. Cache, host contention and these settings prevent claiming a directly comparable CI speedup from the local total alone. Whole-CI savings of ten minutes and reductions in total CPU/peak memory remain unproven. The next investigation profiles actual repeated work and cluster lifecycle cost. Experimental fixture changes are kept outside the delivery tree until both their benefit and behavioral equivalence are established. ### Review and outstanding scope Whole-change self-review covers implementation, tests, ownership/cleanup, cancellation, Unicode equivalence, spatial capability preservation, persistence compatibility and hot-path cost. The merged fulltext rollback was inspected for interaction; the now-obsolete dependent repair was removed. No independent subagent review is claimed. **#30229 and #30209 remain open and are not fixed by this PR.** Their causes have not been proved; no retries, longer waits, skips or weaker assertions are added to claim acceptance. Complete Coverage UT and full BVT suite results are not claimed. The later complete race execution and repaired report finalization are recorded below. Local raw evidence, arm scripts, coverage comparisons, profiles and cgroup/PSS samples: `/home/xupeng/ut-race-next-20261015/`. ### WAL recovery readiness (92bbd2b) Reuse the existing client discovery policy to select a replica with a usable service address. Remove the fixed five-second delay and second gossip lookup: neither established stable leadership. The existing connection plus linearizable marker/lease reads remain the authority for replay readiness. The bounded discovery wait, cancellation, fencing, dirty-target rejection and WAL format remain unchanged. Shared discovery normalization is a pure helper used by public discovery and recovery; no worker, state machine, retry layer or configuration is added. The two existing real recovery test roots previously took 27.65 + 15.52 seconds; candidate focused run took 2.55 + 0.52 seconds. This removes eight fixed waits (40 seconds in this local test scope), not a proven whole-CI saving. Existing test selection and assertions are unchanged. Validation: full logservice normal and race each 582 named PASS; bootstrap recovery 11 race rounds PASS and dirty-target/fence recovery 57 race rounds PASS. Incremental configured SCA for pkg/logservice: 0 issues, exit 0. Those test runs used byte-identical candidate overlays except a subsequent local variable/private parameter rename from leaderServiceAddress to replicaServiceAddress; no behavior changed. No fresh full BVT is claimed for this stage. ### Complete local race run: FAILED, follow-up in progress The complete local `make ut` run on 26b298f ended with exit 2; it is not a complete-suite PASS. Its logservice code preceded the WAL optimization above. The external MinIO case failed with connection refused; a focused identical-source race rerun using the byte-identical NVMe MinIO executable passed (7.54 seconds). A slow root-filesystem executable checksum read is consistent with the environment evidence, but is not proven to have caused this exact failure. A separate actual failure occurred in pkg/vm/engine/tae/db/test/Test_RWDB4: GetValueByFilter returned not found instead of the final value 99; cleanup then waited on replay/transaction completion for several minutes. The test-owned process was stopped with SIGQUIT to preserve goroutine stacks; remaining cases in that process were not executed. Root-cause investigation and a focused race reproduction are in progress. No attribution to this PR or clean main is claimed yet; no timeout increase, assertion weakening or case skip is used. ### Replay heartbeat admission and full-run follow-up (d41d24d) The RWDB4 failure above also reproduces with all changed Go files restored to clean main base 83222fa: final value lookup failed, followed by a 100-second test timeout. This establishes a baseline counterexample under this local two-worker configuration, not an assertion about a particular CI failure. Root cause: replay/readonly modes already mark local heartbeats as skipped, and completion refuses to advance their committed frontier, but the existing two-millisecond cron producer still submitted them through the commit pipeline. With two apply workers and the existing injected 0–9ms commit delays, this creates expanding useless heartbeat traffic ahead of replay commits. This is queue overload; a shared-pool deadlock is not claimed. Closing the engine waits for the in-flight replay commit while the fault remains enabled. The existing heartbeat owner now checks its authoritative skip flag before creating/enqueuing work. No extra pool, worker, state, timer or retry is introduced. Write-mode behavior is retained, including the completion-side check for a heartbeat admitted before a mode transition. A small direct frontier test covers that in-flight readonly/replay/write boundary. The existing real RWDB4 test explicitly uses two apply workers even on a large host, preserves all 100 updates and the final-value assertion, and registers cleanup so fault removal precedes replay-engine close. Its unused wait group/commented remnants are removed. No persistence or SQL protocol changes. Validation on the final implementation: - Exact RWDB4: 25 race rounds PASS, package 29.448s; first strengthened-test duration 1.20s gives floor(30/1.20)=25 rounds. - Reverse control: same strengthened test, only production guard removed -> FAIL in 4.57s (expected99, actualnil); teardown completes after fault removal. The test catches the missing fix without merely timing out. - Complete TAE db integration package: 299 named PASS normal (46.774s), 299 PASS race (68.380s), no skip/fail. - Complete txnbase final version: 50 named PASS normal and 50 PASS race, no skip/fail; includes the in-flight heartbeat mode-boundary test. - Parent db package: 4 PASS normal and 4 PASS race, no skip/fail. Integration coverage includes replay promotion, write/replay transitions and cancellation rollback. - Configured incremental SCA for both changed packages: 0 issues, terminal exit0. Final subsequent edit only removes two blank lines from RWDB4; semantic evidence is unchanged. - No fresh full BVT or whole-CI performance saving is claimed for this stage. Existing regressions are strengthened rather than replaced with a smaller simulated path. The subsequent complete local race execution on d41d24d has finished; its exact terminal outcomes and report-finalization repair are recorded below. Earlier failures remain recorded. Whole-CI ten-minute saving and lower total CPU/memory remain unproven. ### Report executable ownership and completed local execution (ae24f30) The complete local `make ut` on d41d24d executed all Go test stages successfully: 75,212 named PASS, 73 named SKIP, 457 package PASS, 80 no-test/package SKIP, zero test failures, `UT_TEST_STATUS=0`. No additional test filters or skips were introduced. Measured wall time was 2,088.4s (34m48s), total CPU 4,689.2s, aggregate peak PSS 6.32GiB, cgroup peak 9.43GiB, no OOM. These are local totals, not a same-environment CI speedup. The original Make invocation nevertheless exited 2 because the pinned analyzer had installed successfully outside PATH and the report step invoked its bare name (analysis exit127). This original failure is retained. The existing installer now returns its installed executable path and the existing summary caller invokes that exact quoted path, also preventing a stale PATH executable from shadowing it. Existing version checks and retry policy remain authoritative. No new state, wrapper framework or production execution path. Validation of this report-only follow-up: complete optools normal and race each 330 named PASS; configured incremental SCA zero issues; shell syntax/gofmt/diff checks pass. The same new integration regression with the two old shell files fails as expected for missing/stale executables. It exercises the actual summary entry and covers GOBIN/GOPATH, spaces, stale PATH, analyzer failure and Go-test failure. Re-executing the actual repaired summary against the preserved complete raw report and original successful Go status ended exit0 with `UNIT TESTING SUCCEEDED !!!`. This proves complete Go execution plus repaired finalization; it does not claim a fresh monolithic `make ut` exit0 on ae24f30. A same-machine baseline/PR comparison of the dominant issues+embedded stages is being prepared using two actual source checkouts, verified native artifacts, identical warm compilation, eight CPU/16GiB/no-swap limits, and sequential measurement arms. No GOFLAGS overlays or reduced case selection are used. Results pending. The six-package parallel optimization separately increased CPU about10% and peak PSS from2.17 to3.18GiB; whole-run resource reduction remains unproven.
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Oct 16, 2026
Preserve source native collation admission tests and regenerated parser and pipeline artifacts. Reserve upstream DECIMAL MORPC v113 and retain the merged JSON/ODKU/functional-key/binary contracts at v114-v118. Correct the PR-side binary error assertion to require protocol version 118: the receiver is 117, but the error reports the required floor 118. incidental upstream repair, identical to upstream main newer fix at pkg/sql/plan/apply_indices_fulltext_snapshot_test.go:182 (matrixorigin#30193/matrixorigin#30189 cross-integration break). Pass orderOverwritten=false because this explicit-sort fixture has no ancestor ordering override. Only that call line differs from the pinned upstream snapshot test. Validation: planner/frontend build with -p 2; planner Collation tests; exact covered-fulltext score-limit and binary sender/receiver tests pass. Affected collation/pre-insert and merged protocol checks also pass. PR-owned whitespace checks pass.
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Oct 16, 2026
Base: b24d1b3, including the cross-integration repairs for matrixorigin#30189/matrixorigin#30193 delivered by matrixorigin#30289. Preserve both the ODKU row-alias changes and upstream binder/index-key semantics. Regenerate mysql_sql.go from the merged mysql_sql.y using the repository goyacc flow. Two formatted generations are byte-identical with zero shift/reduce or reduce/reduce conflicts. The generated body matches those bytes; keep the repository's canonical generated command header. Discard the earlier integration against main@461bc8e349. The new base naturally supplies the repaired fulltext production helper and complete snapshot test suite. Both files match the new upstream blobs byte-for-byte; no incidental upstream patch or old test expectation is carried forward. Validation: | Check | Result | | --- | --- | | go build -p 2 ./pkg/sql/plan/... ./pkg/sql/parsers/... | PASS | | Focused planner Insert/ODKU/RowAlias/Alias/PrimaryKeyIdentity and CoveredFulltext/FulltextSnapshot/Snapshot tests; -p 2 -count=1 -timeout=20m | PASS | | TestCoveredFulltext2ScoreLimitOnBoundSQL and every subtest | PASS | | Focused MySQL parser insert/row-alias/keyword/conflict tests; -p 2 -count=1 -timeout=20m | PASS | | Goyacc repeated byte comparison, upstream blob equality, gofmt, git diff --check | PASS | Required CI on this new head will be checked in the next root round. The old-head Ubuntu UT failure and CR ledger remain root-owned.
mergify Bot
pushed a commit
that referenced
this pull request
Oct 18, 2026
### Design record
- Added versioned design: `docs/design/20261010-alter-copy-pre-publication.md`.
- The design records the speculative-preparation/publication split, authoritative after-copy source-frontier revalidation, persisted-delete coverage, actual nested lock state, terminal retry and whole-transaction rollback ownership, transaction-local relation and workspace-write handling, alternatives, compatibility, source-state cost model, and validation map.
- Independent design approval of that exact revision is still required before implementation approval.
### Root cause
`ALTER TABLE ... COPY` acquired the transaction-scoped global SNAPSHOT lineage-owner gate before temporary-table creation, physical row copy, auto-increment reconciliation, and unaffected-index cloning. Every independent branch ALTER therefore held the stable `mo_catalog.mo_feature_registry` row for `SNAPSHOT` until commit. Under the reported 500-worker workload, unrelated ALTERs serialized behind each other and eventually returned MySQL 1205 lock-wait timeouts or MySQL 2013 connection losses.
Moving physical work before that gate also exposed correctness obligations:
- ALTER must not hold source locks while waiting for the lineage gate.
- Unlocked preflight must not take authoritative owner-row locks.
- Publication must reject source replacement, same-ID schema changes, row changes, and lineage-state changes that happened during physical preparation.
- If a concurrent same-table ALTER removes an index table between preparation and resolution, missing metadata must become a controlled definition-change retry rather than a nil-pointer panic.
### Exact changes
- Split unlocked lineage inspection and timestamp selection from authoritative, gate-protected lineage preparation in `pkg/sql/compile/alter.go`.
- Run lock-free temporary-table creation, physical row copy, auto-increment reconciliation, and unaffected-index cloning before acquiring the global lineage-owner gate. The temporary CREATE passes `WithDisableLock`, so it does not retain the source database shared lock or temporary target table exclusive lock.
- Acquire the lineage gate before source database, catalog-table, and physical-table locks. Existing upstream TRUNCATE behavior already uses compatible ordering; the existing TRUNCATE interleaving test is updated to observe physical work before the gate and gate acquisition before source locks.
- Preserve late broad admission after rebase onto `4022729da2`, while adopting upstream's `admitBroadTableLifecycleRC` API and logical-ID-aware historical-source probes.
- After gate acquisition, advance the RC snapshot, re-resolve the source, and reject source-ID replacement, same-ID table-definition-version changes, source data changes since copy, foreign-key state changes, stale lineage, late historical ownership, and same-statement lineage column replacement before publication.
- Preserve the physical-copy timestamp when lineage becomes relevant only during late publication.
- Replace the post-copy CDC handle probe with `SourceCommitTSAfterCopy(copyTS)`. It uses the authoritative partition-state frontier, excludes only current-transaction workspace writes, includes in-memory rows, data objects, and persisted tombstone objects, fails closed for unavailable providers, and short-circuits once a source frontier exceeds the copy timestamp.
- Aggregate `SourceCommitTSAfterCopy` across every combined partition member, short-circuiting after any member exceeds the copy timestamp and failing closed for missing member providers; a local write on one member no longer suppresses checks for other rows or partitions.
- Convert post-physical source replacement, definition-version, source-data, lifecycle-admission-retry, and source-lock-refresh races to terminal `ErrTxnWriteConflict`; RC statement retry therefore cannot repeat physical preparation while retaining locks. The frontend classifies this conflict as a whole-transaction rollback in both autocommit and explicit-transaction mode.
- Convert a nil source-index object or definition returned by unlocked `Resolve` into `ErrTxnNeedRetryWithDefChanged`, preventing the CI-observed stale-index-generation panic.
- Add the optional `RelationCreatedInCurrentTxn` and after-copy source-frontier relation capabilities with disttae primary, combined-table, and delegate implementations. Relation-created sources skip the committed probe; existing relations with local writes still check committed mutations from other transactions.
- Add deterministic source-lock retry coverage for optimistic ALTER, catalog-table contention, and physical-table contention.
- Update the concurrent stale-index integration test to require terminal error 20601 for a post-copy source-admission race, explicitly retry that statement in a new transaction, and retain the final schema/index/default assertions.
### Issue-to-test proof
- Independent ALTERs no longer serialize: `TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate` proves both independent physical inserts start while the lineage gate is held elsewhere.
- Lifecycle lock order is acyclic: `TestAlterCopyAndDropUseGateBeforeSourceLocks`, `TestAlterCopyAndTruncateUseGateBeforeSourceLocks`, and `TestAlterCopyAndTruncateSerializeBeforeTableLocks` prove ALTER physical work starts before the gate and both ALTER and TRUNCATE record gate acquisition before source locks.
- Source-lock retry contracts are explicit: `TestLockAlterCopySourceRetryContracts` proves optimistic transactions take no source locks, while catalog-table and physical-table retry errors are converted to `ErrTxnNeedRetryWithDefChanged`.
- Unlocked preflight is read-only and race-safe: `TestInspectAlterDataBranchLineageSeesBranchCreatedAfterPreflight` and `TestAlterTableHasLatestHistoricalBranchSourceUsesFreshUnlockedProbe` prove a late branch is rediscovered by authoritative postgate preparation.
- Stale-copy protection is terminal: `TestAlterCopyRejectsSourceReplacementAfterGate`, `TestAlterCopyRejectsSourceDataChangeAfterCopy`, and `TestAlterCopyRejectsSameIDSourceDefChangeAfterGate` reject replacement, row changes, and same-ID definition changes before publication.
- Missing index metadata is controlled: `TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears` proves the definition-change retry path instead of a nil dereference.
- Publication and rollback remain correct: `TestAlterCopyLateLineagePublicationUsesCopyTimestamp`, `TestAlterCopyFailsAfterPhysicalWorkWithoutReleasingGate`, and same-statement replacement coverage verify the original timestamp, injected failure, and no publication after stale-copy discovery.
- Transaction-local state is handled explicitly: `TestAlterCopySkipsSourceChangesForRelationCreatedInCurrentTxn` skips the probe only for relation-created sources, while `TestAlterCopyChecksCommittedChangesDespiteTransactionLocalWrites` proves local writes do not suppress another transaction's committed change. `SourceCommitTS` itself still fails closed for async-index callers.
- Nested CREATE does not retain catalog locks: `TestAlterCopyCreateOptionsDisablesNestedCreateLock` proves `WithDisableLock`.
- The source frontier is bounded and authoritative: `TestAlterCopySourceChangedSinceCopyUsesSourceCommitTS` and `TestAlterCopySourceChangedSinceCopyFailsClosedWithoutProvider` cover unchanged, changed, and unavailable states; `TestSourceCommitTSAtIncludesPersistedTombstone` proves a persisted DELETE advances the frontier.
- Partition aggregation is correct: `TestCombinedTxnTableSourceCommitTSReturnsMax`, `TestCombinedTxnTableSourceCommitTSShortCircuits`, `TestCombinedTxnTableSourceCommitTSFailsClosedForMissingProvider`, and `TestCombinedTxnTableSourceCommitTSPropagatesMemberError` cover member maxima, short-circuiting, and fail-closed behavior.
- Terminal conflicts do not enter RC statement retry: `TestAlterCopyPostPublicationConflictIsNotStatementRetryable` checks both `isRetryErr` and `canRetry`.
- The reported concurrency shape passes: 500 independent branch tables and 500 concurrent ALTER sessions complete with zero lock-wait and zero connection-loss failures.
### Reproduction
- Issue baseline at `77dbf5464466b1d5ae784e7d17d92cd1c1c8d17d`: 301/500 workers completed, 199/500 failed, 172 failures were MySQL 1205, and 27 failures were MySQL 2013.
- Deterministic pre-fix ALTER ablation: replacing only `pkg/sql/compile/alter.go` with its base-compatible version causes `TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate` to time out while both independent physical inserts wait behind the global lineage gate.
- CI regression: old run `37943988958` panicked in `constructTableClone` from `cloneUnaffectedIndexes` during `TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation`. The missing-index retry guard and exact integration test now pass.
- Definition-guard ablation: removing only the postgate definition-version comparison causes `TestAlterCopyRejectsSameIDSourceDefChangeAfterGate` to lose the expected retry error.
- Real workload: 500 workers, 500 independent branch tables, a one-row base, and a 120-second command timeout completed in 71.995 seconds with 500/500 successful ALTERs, 500/500 observed columns, 0 failed ALTERs, 0 MySQL 1205 errors, 0 MySQL 2013 errors, and successful database cleanup (`/tmp/mo-29208-concurrency-500-revision-r6.out`).
- Source-frontier cost: `BenchmarkSourceCommitTSAtUnchanged250KObject` modeled one unchanged 250,000-row non-appendable object with a threshold after every row commit and measured `44075 ns/op`, `1125 B/op`, and `4 allocs/op` on Apple M5 (`darwin/arm64`, 10 GOMAXPROCS).
### Tests
- Previous review-response, CI-regression, and rebase validation on head `104cac3d12`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=1200s ./pkg/sql/compile ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
— passed after the rebase onto `42d42546fd2c2b2449cb81cea47f81d300139753`: compile in 18.925s, disttae in 11.943s, and logtailreplay in 8.386s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^TestIssue27055DatabaseCloneReadsExplicitTransactionSource$' ./pkg/tests/issues`
— passed in 13.087s after the transaction-local workspace-write fix.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestTxnTableHasTransactionLocalWrites|TestCombinedTxnTableHasTransactionLocalWritesShortCircuits|TestAlterCopySkipsSourceChangesForTransactionLocalWrites)$' ./pkg/vm/engine/disttae ./pkg/sql/compile`
— passed in 1.370s and 1.403s.
- Rebase integration on `433a8dc26c`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
— passed in 15.293s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae ./pkg/vm/engine`
— passed in 9.901s and 1.537s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^(TestIssue277xxDDLConsistency|TestIssue29400CopyAlterRetainedGatePromotionFastFails)$' ./pkg/tests/issues`
— passed in 18.517s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/frontend ./pkg/sql/plan`
— passed in 37.126s and 36.724s.
`gofmt -l`, `git diff --check`, and `git status --porcelain=v1 -uall` — clean.
- Exact CI regression:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation$' -v ./pkg/tests/issues`
— passed in 11.668s on the latest rebased head.
- Exact-head focused closure:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears|TestAlterCopyAndTruncateSerializeBeforeTableLocks|TestIssue277xxDDLConsistency/27725_concurrent_alter_retries_a_stale_physical_index_generation)$' ./pkg/sql/compile ./pkg/tests/issues`
— compile tests passed; the exact integration subtest was rerun explicitly as above.
- Coverage-closing lock contracts on `e3de6b6204`:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -run '^TestLockAlterCopySourceRetryContracts$' ./pkg/sql/compile`
— passed.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^(TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate|TestAlterCopyAndDropUseGateBeforeSourceLocks|TestAlterCopyAndTruncateUseGateBeforeSourceLocks|TestAlterCopyFailsAfterPhysicalWorkWithoutReleasingGate|TestAlterCopyLateLineagePublicationUsesCopyTimestamp|TestAlterCopyRejectsSourceReplacementAfterGate|TestAlterCopyRejectsSourceDataChangeAfterCopy|TestAlterCopySkipsSourceChangesForRelationCreatedInCurrentTxn|TestAlterCopyRejectsSameIDSourceDefChangeAfterGate|TestAlterCopyRejectsSameStatementReplacementDiscoveredAfterGate)$' ./pkg/sql/compile`
— passed.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=300s -coverprofile=<profile> -run '^TestLockAlterCopySourceRetryContracts$' ./pkg/sql/compile`
— passed; the profile records executions of `alter.go` blocks `1187`, `1199`, and `1210`, the three previously uncovered changed blocks that caused the 73.61% PR coverage result.
- Full owning package:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
— passed in 14.577s on the rebased head `e3de6b6204`.
- Adjacent engine packages:
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae`
— passed in 7.745s.
`.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine`
— passed in 0.827s.
- Race stress:
`.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=10 -timeout=300s -run '^(TestAlterCopyPhysicalWorkDoesNotWaitForLineageOwnerGate|TestAlterCopyAndDropUseGateBeforeSourceLocks|TestAlterCopyAndTruncateSerializeBeforeTableLocks|TestCloneUnaffectedIndexesRetriesWhenSourceIndexDisappears)$' ./pkg/sql/compile`
— passed in 4.688s.
- Static validation:
`GOWORK=off CGO_CFLAGS="-I<cgo> -I<thirdparties>/include" go vet -mod=readonly ./pkg/sql/compile ./pkg/vm/engine ./pkg/vm/engine/disttae`
— passed.
- Build:
`make build` — passed; only the existing duplicate-library linker warning was emitted.
- BVT:
`cd /tmp/mo-29208-bvt-r3 && bash /Users/ghs-mo/MOWorkSpace/mo-tester/run.sh -n -p <worktree>/test/distributed/cases/ -i diff_schema_evolve,merge_schema_evolve,alter_table_historical_lineage`
— 492/492 passed: `diff_schema_evolve` 278/278, `merge_schema_evolve` 139/139, and `alter_table_historical_lineage` 75/75.
- Real concurrency:
`ulimit -n 2048 && python3 /tmp/mo-29208-concurrency-500.py`
— 500/500 successful ALTERs, 500/500 columns verified, 0 failures, 0 MySQL 1205, 0 MySQL 2013; database dropped.
- Final hygiene:
`gofmt -l` on the seven changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean and limited to the focused seven-file scope.
The BVT and real-workload runs passed on this implementation before the latest rebase. The latest semantic rebase onto `f09d4788fd` applied cleanly; upstream changed unique-index duplicate precheck code in `pkg/sql/compile` and did not alter this PR's ALTER COPY production files. Latest exact-head validation on `79e45f24b5`:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s ./pkg/sql/compile` — passed in 16.208s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=900s -run '^TestIssue277xxDDLConsistency/27725_concurrent_alter_terminal_conflict_supports_external_retry$' ./pkg/tests/issues` — passed in 11.308s.
- `gofmt -l` on all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean and limited to the focused PR scope.
### Residual risk
- The global lineage gate remains intentionally serialized for atomic publication and genuinely conflicting owner operations; this PR narrows and orders the held section rather than removing the ordering guarantee.
- Future lifecycle owners that take both source locks and the lineage gate must preserve gate-before-source-lock ordering.
- Future lineage invariants must be added to the postgate revalidation path.
- The 500-session proof uses a one-row base to isolate the failing ALTER concurrency path; deterministic barriers and race tests provide the row-count-independent ordering proof. The full reported 250,000-row throughput workload was not rerun; the committed 250,000-row unchanged-object benchmark measures the new serialized source-frontier cost, and broader multi-object storage layouts remain a performance envelope to monitor.
- The old run's two Compose failures were infrastructure failures while pulling the `createbuckets` image (`unauthorized: access to the requested resource is not authorized`); no matching issue was found. The old `pr-size-label` failure was an unrelated runner-proxy TLS failure tracked by #27127.
### Current exact head: `cf9a1735b7`
Rebased onto current `main` `02a2823c20` and resolved both semantic rebase boundaries:
- kept pre-publication, unlocked ALTER COPY preparation;
- integrated upstream forward-FK admission by computing `replacementAdmission.createNames` before physical CREATE and passing that admission into nested `withDropLifecycle`;
- kept upstream frontend rollback classification and added `ErrTxnWriteConflict` to the whole-transaction rollback set.
The source mutation proof now closes both DELETE lifecycle counterexamples:
- retained tombstone entries, including soft-deleted objects, remain source-change proof; actual retention truncation is represented by the partition state-start floor;
- appendable tombstones read non-aborted per-row commit timestamps with the same snapshot semantics as the delete reader;
- non-appendable tombstones read per-block commit-ts zonemaps;
- unavailable tombstone files or commit-ts metadata fail closed;
- the unused public `RelationHasTransactionLocalWrites` chain was removed while preserving the private async-index local-write guard.
The concurrent ALTER integration test now distinguishes the newly upstream pre-copy FK name-pin fast-fail (`ErrLockConflict`) from terminal post-copy `ErrTxnWriteConflict`; both are externally retryable, and final schema/index assertions remain unchanged.
Latest exact-head local validation:
- `CGO_CFLAGS=... go test ./pkg/vm/engine/disttae/logtailreplay -run 'TestSourceCommitTSAt|TestMaxCommitTS' -count=1` — passed.
- `CGO_CFLAGS=... go test ./pkg/vm/engine/disttae ./pkg/sql/compile ./pkg/frontend ./pkg/common/moerr -run 'TestSourceCommitTS|TestCombinedTxnTableSourceCommitTS|TestTxnTableDelegateSourceCommitTS|TestAlterCopy|Test_isErrorRollbackWholeTxn|TestStaticRollbackSetIsInfrastructureOnly|Test.*Rollback.*Txn' -count=1` — passed before the final one-commit rebase; the production delta is unchanged by that test-only upstream commit.
- `CGO_CFLAGS=... go test ./pkg/tests/issues -run 'TestIssue277xxDDLConsistency/27725_concurrent_alter_conflict_supports_external_retry' -count=1` — passed on the exact final head.
- `git diff --check` — passed; the working tree is clean.
Freshness update: rebased exact head `cba088b792` onto `main` `02a2823c20`. The only new upstream commit changes join-expression ownership and has no file overlap with this PR. Revalidated on the exact head: focused logtail source-frontier tests, focused ALTER COPY compile tests, the concurrent ALTER integration test, and `git diff --check`; all passed.
### Coverage CI follow-up and rebase validation
Coverage run `38204952772` exposed one PR-owned test expectation and two unrelated upstream failures:
- `TestIssue29400CopyAlterRetainedGatePromotionFastFails/exclusive_gate` expected the competing ALTER to wait, but upstream pre-copy FK admission now fast-fails with `ErrLockConflict` when it meets the retained source lock. The test now accepts that expected conflict and proves the UPDATE owner can execute its next statement, commit value `2`, and complete the target `DROP TABLE` without deadlock.
- `TestPartitionTopNRejectsUnsupportedOrderType` is the existing clean-main issue #29968.
- `TestTruncateLifecycleRCWaitPolicy` is the existing clean-main issue #29971.
Exact-head validation:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestIssue29400CopyAlterRetainedGatePromotionFastFails$' ./pkg/tests/issues` — passed in 12.889s.
- `gofmt -w pkg/tests/issues/issue_29400_test.go`, `git diff --check`, and `git status --porcelain=v1 -uall` — clean before commit.
The branch already contained `main` `02a2823c20` for that test-only follow-up.
### Rebase onto `main` `7af631bdf7`
The exact head is now `cf9a1735b7`, rebased onto current `main` `7af631bdf7`. The rebase applied cleanly and incorporates the upstream fixes for the two clean-main coverage blockers:
- `TestPartitionTopNRejectsUnsupportedOrderType` (#29968) now passes on the rebased head.
- `TestTruncateLifecycleRCWaitPolicy` (#29971) now passes on the rebased head.
- The PR-owned `TestIssue29400CopyAlterRetainedGatePromotionFastFails` regression also passes after the rebase.
Exact-head validation:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestIssue29400CopyAlterRetainedGatePromotionFastFails$' ./pkg/tests/issues` — passed in 26.805s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestPartitionTopNRejectsUnsupportedOrderType$' ./pkg/sql/colexec/partition` — passed in 3.080s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=240s -run '^TestTruncateLifecycleRCWaitPolicy$|^TestAlterCopyAndTruncateSerializeBeforeTableLocks$' ./pkg/sql/compile` — passed in 3.543s.
- `gofmt -l` over all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean after the rebase.
### Review update and current exact head: `f8894b6a0f`
Rebased cleanly onto current `main` `11914526ba` and addressed the pessimistic-RC independent-ALTER publication finding:
- `admitReplacementNames` no longer runs before physical COPY preparation. Pessimistic-RC ALTER COPY now acquires the broad SNAPSHOT gate first, then pins replacement endpoint names with `WaitPolicy_Wait`.
- ALTER records the transaction's retained lock-table baseline before preparation. Gate waiting is permitted only when every retained lock table is new relative to that baseline and is certified by the workspace as created in the transaction. Pre-existing, source, catalog, or unprovable locks retain the fast-fail policy, preventing `G -> name -> G` reverse edges.
- Nested temporary CREATE and row copy propagate `WithDisableLock`; nested execution skips pre-pipeline metadata/table locks and lock operators. TRUNCATE keeps its existing fast-fail replacement-name policy.
- `TestIssue29400IndependentCopyAltersProgressInPessimisticRC` covers both a held explicit publisher and overlapping autocommit publishers. It uses separate connections, observes the independent ALTER waiting at the gate, proves it does not fail while the holder retains the gate, and proves both ALTERs finish after release.
- The exact-head validation passed for `./pkg/sql/compile` and `./pkg/tests/issues` with `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s`, including the new independent-publisher integration test. `gofmt -l` over changed Go files, `git diff --check`, and the final clean-tree check also passed.
- The versioned design and implementation now record this `G -> private preparation locks -> replacement names -> source` publication order and its liveness proof.
### Rebase onto `main` `b09f2c6fc5`
Rebased cleanly onto `main` `b09f2c6fc5` at exact head `3e5069423d`.
- The rebase introduced no semantic conflicts; the full PR delta remains scoped to the ALTER COPY publication lifecycle and its tests/design.
- Re-ran the full affected package set after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile ./pkg/tests/issues ./pkg/frontend ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
- All five packages passed.
### Current exact head after the latest rebase: `2e45e40035`
Rebased cleanly onto current `main` `cd8d5abf96`.
- The rebase applied without conflicts. Its only overlapping paths with this PR were `pkg/sql/compile/compile.go` and `pkg/sql/compile/compile_test.go`, where upstream renamed the vector-index scan node; the ALTER COPY ownership changes remained semantically unchanged.
- Re-ran the focused affected package set after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile`
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/tests/issues ./pkg/vm/engine/disttae ./pkg/vm/engine/disttae/logtailreplay`
- All four packages passed.
- `git diff --check`, `gofmt -l` over changed Go files, and the clean-tree check passed before push.
### Review update and exact head: `e088a231b9`
Rebased cleanly onto current `main` `175a645a85` and closed the unaffected-index preparation finding:
- The private ALTER-COPY temporary CREATE now opts out of transient index CDC and idxcron task registration. Because no transient tasks are registered, ALTER also skips their catalog cleanup; post-rename publication retains the existing final task-registration path. This removes the `mo_tables`/`mo_database` lock retention introduced by transient task cleanup while preserving final index-task ownership.
- IVF-FLAT `DeleteBeforeClone` now executes its private replacement hidden-table cleanup with `WithDisableLock`, so the nested DELETE acquires neither catalog metadata locks nor row locks.
- `TestIssue29400IndependentCopyAltersProgressInPessimisticRC` now enables `experimental_ivf_index`, creates an unchanged IVF-FLAT index, and covers both a held explicit publisher and overlapping autocommit publishers. The unrelated ALTER waits at the publication gate and completes after release.
- `TestAlterCopyCreateOptionsDisablesNestedCreateLock` asserts the new skip-registration option. `TestScopeAlterTableCopyInsertTmpDataPipelineFlush` now proves private preparation no longer calls `CopyTableDef` for transient task cleanup while retaining its nil-context pipeline-flush oracle.
- The versioned design records the lock-free cleanup and symmetric registration/cleanup policy.
Exact-head validation after the rebase:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=120s -run '^TestScopeAlterTableCopyInsertTmpDataPipelineFlush$' ./pkg/sql/compile` — passed.
- `gofmt -l` over all changed Go files, `git diff --check`, and `git status --porcelain=v1 -uall` — clean on the exact head.
Additional validation on the identical code before the unrelated one-commit rebase (`896fa84927` on `main` `3e50e1b32d`):
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -race -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
### Current exact head after latest rebase: `6596f9dc04`
Rebased cleanly onto current `main` `e5111936b9` after the PR was reported behind.
- `git range-diff` confirms all ten PR commits are patch-equivalent to the prior head `e088a231b9`; only their base changed.
- The worktree remained clean, and no PR code or tests were modified by this rebase.
- No new semantic validation is claimed for this commit-only rebase. The exact prior-head focused validations above remain the latest code-specific evidence.
### Current exact head after latest rebase: `abd5a45122`
Rebased onto current `main` `21f19ae063` after `main` advanced twice during the refresh:
- First rebased `6596f9dc04` onto `main` `6b0da62260` at `3574aa681f`; `git range-diff` confirmed all ten PR commits were patch-equivalent.
- After the push, the live PR snapshot showed `main` had advanced to `21f19ae063`. Fetched that base and rebased again to `abd5a45122`.
- `git range-diff` between the `3574aa681f` and `abd5a45122` ranges confirms all ten PR commits remain patch-equivalent. The new upstream commit overlaps this PR only in `pkg/sql/compile/compile.go`/`compile2.go`; the automatic rebase preserves both the ALTER private-preparation locking changes and upstream prepared zero-limit producer behavior.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400IndependentCopyAltersProgressInPessimisticRC$' ./pkg/tests/issues` — passed.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestPreparedZeroLimitReuse$' ./pkg/tests/sqlintegration` — passed.
- `gofmt -l` over changed Go files, `git diff --check`, protected-scope check, and the final clean-tree check passed on the exact head.
### Review update and current exact head: `7f243d2e4c`
Rebased onto current `main` `fcad62a8ff` and closed the Compile-pool registration-policy escape found in review `PRR_kwDOFEPiGM8AAAABR92hOw`:
- `Compile.clear` resets `skipIndexTaskRegistration` with the other per-statement flags (`disableLock`, `skipDataBranchReclaim`, `keepAutoIncrement`) before the object returns to the global reuse pool, and `NewCompile` re-initializes it. The ALTER COPY private-registration opt-out is now a property of the single private preparation generation and can no longer reach an unrelated later `CREATE TABLE` with an inline async/IVF index through pool reuse (`compile.go`).
- The intentional current-generation suppression is unchanged; the versioned design records the pool-boundary ownership of the opt-out (`docs/design/20261010-alter-copy-pre-publication.md`).
- `ignoreCheckExperimental`, the only other assigned-but-unreset sibling in `txnExecutor.Exec`, is pre-existing upstream state from #22428 and is currently assigned-but-never-read; it is outside this PR's introduced delta and left untouched.
Proof on the exact head:
- `TestCompileClearResetsSkipIndexTaskRegistration` exercises the pool reset directly; mutation-verified: removing only the `clear` reset makes it fail while the rest of the fix stays.
- `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy` deterministically reproduces the review's Release -> same-object `NewCompile` pool handoff (single-P, GC disabled) and proves the next frontend Compile starts with the ordinary registration policy.
- `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` proves, on one CN connection, that an ordinary inline IVF-FLAT `CREATE TABLE` registers its `mo_catalog.mo_index_update` `ivfflat_reindex` task before and after `ALTER ... ALGORITHM=COPY` private preparation, and that publication re-registers the replacement index's task.
Validation on the exact head:
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 27.431s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae` — passed in 10.236s.
- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/vm/engine/disttae/logtailreplay` — passed in 27.991s.
- `- `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=1800s ./pkg/tests/issues` — passed in 552.697s (177 tests, 0 failures; includes all `TestIssue29400*` roots and the new registration control). An earlier run of this suite on the same head failed once with a transient `internal error: cn service bootstrap` while the embedded cluster was starting; the identical rerun and every focused cluster test passed.`
- `gofmt -l` over changed Go files, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
CI-blocker follow-up: the tracked unrelated blocker #30047 (logservice `gossip_fixture_test.go` obsolete `randomPorts.allocate` signature failing UT/SCA/Coverage on run `38347106648`) was closed at `2026-10-13T08:30:47Z`; its fix landed on `main` in `35c8dd5854` and is incorporated by this rebase. This PR does not modify `pkg/logservice`. The push creates a new head and a fresh CI run; the stale failed run is not rerun.
### Current exact head after latest rebase: `4c5051fc77`
Rebased onto current `main` `5d971d07a7` after the PR was reported behind.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `7f243d2e4c`; only their base changed.
- The single new upstream commit `5d971d07a7` (empty indexed FK cascades / self-FK ALTER) touches `pkg/sql/plan` and BVT cases with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 16.425s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.110s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `8e5c8b3b53`
Rebased onto current `main` `e17fc0f7fe` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `4c5051fc77`; only their base changed.
- The two new upstream commits (`6ca4363a73` information_schema rewritten-column hiding, `e17fc0f7fe` prepared row-rule invalidation) touch `pkg/sql/plan`, `pkg/frontend` production files, and BVT cases with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 19.691s; the focused frontend rollback-classification tests this PR extends (`Test_isErrorRollbackWholeTxn`, `TestStaticRollbackSetIsInfrastructureOnly`, and the surrounding rollback roots) — passed in 2.152s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 9.078s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `60e84f43df`
Rebased onto current `main` `c4a210802d` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `8e5c8b3b53`; only their base changed.
- The four new upstream commits (`5652252431` window hash partitioning, `959d12d3b9` Starlark NULL boundary, `838bf5d1f8` docs MO-scan branch, `c4a210802d` Iceberg adapter module tidy) have no file overlap with this PR's source or test files; the Iceberg commit's workflow change is upstream-owned and untouched here.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 18.864s; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.837s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `cd2c40fd52`
Rebased onto current `main` `a53390c57d` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `60e84f43df`; only their base changed.
- The two new upstream commits are `ec7a910a02` (TIME assignment bounds for external LOAD) and `a53390c57d` (BuildJsonPlan statistics snapshot race). The LOAD commit also touches `pkg/sql/compile/compile.go` in the extern-scan region; the rebase auto-merged it with this PR's `NewCompile`/`clear` flag changes, and both `skipIndexTaskRegistration` resets are verified present on the exact head (compile.go:161 and compile.go:571).
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 14.119s (includes `TestCompileClearResetsSkipIndexTaskRegistration` and `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy`); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 7.801s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `f796e46fb0`
Rebased onto current `main` `071a79b77f` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `cd2c40fd52`; only their base changed.
- The single new upstream commit `071a79b77f` (preserve row rewrite rules through CTAS) touches `pkg/sql/compile/ddl.go` (`populateCreatedTable`, CTAS INSERT privilege region) and `pkg/sql/compile/sql_executor.go` (rewrite-option attachment in `txnExecutor.Exec`), both outside this PR's hunks; the rebase auto-merged and all three `skipIndexTaskRegistration` sites are verified present (compile.go:161, compile.go:571, sql_executor.go:618).
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 16.696s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.558s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `ad74f1e810`
Rebased onto current `main` `5a0570ea70` after the PR was reported behind again.
- `git range-diff` confirms all eleven PR commits are patch-equivalent to the prior head `f796e46fb0`; only their base changed.
- The three new upstream commits (`2e139d84bf` Kafka Connect recovery qualification harness, `ac98d7bd1f` scalar DESCRIBE view reflection coverage, `5a0570ea70` docs/skills template validation) are test/documentation changes with no file overlap with this PR.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — passed in 23.443s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — passed in 8.945s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Review update and current exact head: 173bf86f72
Addresses aptend's test-reliability P2 from the deep re-review of `ad74f1e810e2d1b6c360129e326155dc3fa4875c` (that review closed the previous P1 pool-leak blocker and substantiated no further production blocker). The P2: the new pool-handoff regression asserted `sync.Pool` pointer identity, which the pool's documented contract and the race runtime do not support — `Put` drops values with probability 1/4 under the race detector — so the canonical `-race -count=100` validation could fail randomly on a correct implementation (19/100 on the reviewer's run, reproduced locally at compile_test.go:203).
This cycle adds one commit, test-only. At commit time `main` was unchanged (`5a0570ea70083c9365719009a5ed8d7618f9ed91`); it advanced to `55a019f0b0` during validation, so this commit was then rebased before pushing - see the rebase section below for the patch-equivalence record.
- `TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy` is now a drop-tolerant, policy-based oracle. Each of 16 rounds seeds the exact leak payload through the real boundary — private executor `Compile` with its executor-set policy, `Release` (`Compile.clear` then `sync.Pool.Put`) — and requires the ordinary registration policy on the frontend `Compile` constructed next by the public `NewCompile`, whichever object the pool returns. Pointer identity is only logged; a legitimate pool drop can never fail the root. Drops cannot mask a leak: inheritance requires a `Put` the pool kept, every kept seed is asserted on the immediately following construction, and with both reset layers present the root is green by construction.
- Non-masking is verified by mutation: with both the `clear()` reset and the `NewCompile` init removed, the root fails deterministically without `-race` at round 0, and fails all 3 invocations with `-race -count=3`; with the resets present, the canonical race command is fully green. The `clear()` reset layer keeps its deterministic, pool-free probe `TestCompileClearResetsSkipIndexTaskRegistration` (removing only the `clear` reset still fails it).
- Exact-head revalidation: `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS 8.500s (100/100); the same command without `-race` — PASS (7.344s); full `./pkg/sql/compile` package - PASS 18.046s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Rebase onto current main: `173bf86f72` (`173bf86f7228cfc5c3ac604294e2581803ee4294`)
`main` advanced from `5a0570ea70` to `55a019f0b0` during the validation above, so the branch was rebased before pushing.
- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the new drop-tolerant handoff test) are patch-equivalent to the pre-rebase head `01fb35bb3a`; only their base changed.
- The three new upstream commits (`944b721d1b` JOIN reset buffers across execution generations — `pkg/sql/colexec/{dedupjoin,hashjoin,indexjoin,loopjoin}`, `821250ea88` recursive-CTE test cases, `55a019f0b0` canonical collation admission tests) have no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation after the rebase: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 18.046s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 8.500s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 18.363s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `2990b63c36` (`2990b63c36c8cd5d6c652f8927503af2a95361cd`)
Rebased onto current `main` `b2e8bc4789` after `main` advanced again while the previous section was being pushed (`55a019f0b0` -> `b2e8bc4789`).
- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the drop-tolerant handoff test) are patch-equivalent to the prior head `173bf86f7228cfc5c3ac604294e2581803ee4294`; only their base changed.
- The single new upstream commit `b2e8bc4789` (remap reused CTE readers after projection pruning) touches `pkg/sql/plan/{cte_reuse.go,query_builder.go}` plus CTE test cases, with no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 25.422s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 8.389s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 8.846s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head.
### Current exact head after latest rebase: `0ed0f79634` (`0ed0f79634b20a0f8b8c74d525f91999dc4cd3f1`)
Rebased onto current `main` `fab7b5c043` after the behind event (head `2990b63c36` was reported behind `main` advanced `b2e8bc4789` -> `fab7b5c043` shortly after the previous cycle's push).
- `git range-diff` confirms all twelve PR commits (the eleven prior patches plus the drop-tolerant handoff test) are patch-equivalent to the prior head `2990b63c36c8cd5d6c652f8927503af2a95361cd`; only their base changed.
- The single new upstream commit `fab7b5c043` (preserve join predicate ownership during reordering, #30056) touches `pkg/sql/plan/associative_law.go` plus a plan regression test, with no file overlap with this PR; the rebase auto-merged.
- Exact-head revalidation: `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s ./pkg/sql/compile` — PASS in 14.853s (includes both pool-boundary regression tests); `.agents/skills/mo-dev/scripts/mo-cgo-test -race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` — PASS in 10.348s, no failure in 100 runs; `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=600s -run '^TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation$' ./pkg/tests/issues` — PASS in 7.680s (first invocation of this root during the cycle aborted with `[build failed]`: the Go linker could not reopen cached cgo objects after a build-cache eviction; the identical command was rerun and passed in 7.680s, so the abort was a toolchain cache eviction, not a test failure).
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `16023e02d6` (`16023e02d691abaa1e46fc0481d40cc0509c1c2e`)
Rebased onto current `main` `51300cbd01` after the behind event (head `0ed0f79634` was reported behind; `main` advanced `fab7b5c043` -> `51300cbd01`).
- The single new upstream commit `51300cbd01` (prevent table rename from bypassing role row filters, #29186) is the first upstream commit during this PR's life that also modifies this PR's main production file: `pkg/sql/compile/alter.go` (+183 — new `checkRoleRuleRenameAdmission*` admission gates at the `Scope.RenameTable` entry and the rename-action path of `Scope.AlterTable`, plus new `role_rule_lifecycle.go`), `alter_test.go`, `types.go` (new `Scope.roleRuleRenameAdmissionChecked`), frontend rename/rewrite-rule files, and two `pkg/tests/issues` roots.
- The rebase auto-merged. Semantic integration verified: the rename admission is orthogonal to this PR's ALTER COPY lifecycle — it runs for user rename statements/actions, while `alterTableCopy` publication (broad gate -> endpoint name pins -> source locking/revalidation -> private-replica replace) is untouched by the upstream hunks. Upstream's insertion anchor `reconcileAlterCopyAutoIncrement` is pre-existing `main` machinery from #26197, not part of this PR. `git range-diff` shows eleven commits patch-equivalent and commit 1 (`fix(alter): avoid global lineage gate during physical copy`) with only its import-hunk context shifted by upstream's import additions; no patch content changed.
- Exact-head revalidation, run over the full affected package set because upstream added tests inside the same packages this PR touches: `./pkg/sql/compile` - PASS 13.688s (includes both this PR's lifecycle/pool regression roots and upstream's new rename-admission roots); `./pkg/frontend` - PASS 34.112s (includes upstream's rewrite-rule/authenticate roots and this PR's whole-transaction rollback roots); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 18.887s, no failure in 100 runs; full `./pkg/tests/issues` - PASS 413.353s (includes upstream's new/updated issue_29133/issue_29095 roots and this PR's issue_29400/issue_277xx roots).
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `cb0ded487f` (`cb0ded487f49a9ad3113c654ccf1404949eec24a`)
Rebased onto current `main` `fd4767e488` after the behind event (head `16023e02d6` was reported behind; `main` advanced `51300cbd01` -> `fd4767e488`).
- The single new upstream commit `fd4767e488` (exclude fake primary key from LAST_INSERT_ID, #30004) touches `pkg/incrservice` and its test cases only, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record above remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `16023e02d691abaa1e46fc0481d40cc0509c1c2e`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 14.348s (includes both pool-boundary regression tests); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 8.890s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 8.838s; the upstream-changed `./pkg/incrservice` package - PASS 5.350s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `a9d969890c` (`a9d969890c8a2e9076840237c163af588bce19fb`)
Rebased onto current `main` `a33dcfb2e5` after the behind event (head `cb0ded487f` was reported behind; `main` advanced `fd4767e488` -> `a33dcfb2e5`).
- The single new upstream commit `a33dcfb2e5` (perf: reduce wide-schema work and redundant gossip fixture startup, #30200) touches `pkg/sql/plan/{default_binder.go,build_show_util.go,types.go}` plus plan/logservice tests, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `cb0ded487f49a9ad3113c654ccf1404949eec24a`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 21.080s (includes both pool-boundary regression tests and exercises upstream's plan-binder change through the normal compilation paths); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 7.788s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 7.968s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `7f086296db` (`7f086296db9f32e3ebcd1d59ef36da325bd20fd9`)
Rebased onto current `main` `b1a6da4e16` after the behind event (head `a9d969890c` was reported behind; `main` advanced `a33dcfb2e5` -> `b1a6da4e16`).
- The single new upstream commit `b1a6da4e16` (fix(parser): reject overflowing type lengths and scales, #30176) touches `pkg/sql/parsers/dialect/mysql` plus tests, with no file overlap with this PR and no interaction with the ALTER COPY preparation/publication lifecycle; the rebase auto-merged and the prior role-filter reconciliation record remains the current one.
- `git range-diff` confirms all twelve PR commits are patch-equivalent to the prior head `a9d969890c8a2e9076840237c163af588bce19fb`; only their base changed.
- Exact-head revalidation: `./pkg/sql/compile` - PASS 13.528s (includes both pool-boundary regression tests); the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 9.102s, no failure in 100 runs; focused `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation` in `./pkg/tests/issues` - PASS 9.154s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run. For the record, the prior head `a9d969890c`'s CI had already passed SCA Linux/arm64, UT Coverage on Ubuntu/x86, and the PROXY BVT compose before this rebase superseded it; its remaining checks were still queued/in progress and are replaced by the new run.
### Current exact head after review fix and rebase: `f0840a56e0` (`f0840a56e0d382b3219b449a69a84a53bc957dbe`)
Handles the shared P1 from aptend's thread and XuPeng-SH's mo-bot review (timestamp-only snapshot rewind after workspace-owned advancement), plus the behind event, in one cycle.
- Rebase: `main` advanced `b1a6da4e16` -> `bdbbd17792` (19 upstream commits: parser/plan/aggregate/function fixes, fileservice ENOSPC handling, race-UT runtime reduction, Sirius update; zero file overlap with this PR's delta). The rebase auto-merged; `git range-diff` confirms all twelve prior commits patch-equivalent.
- P1 fix (new commit `fix(alter): retain workspace-owned snapshot on copy return`): `alterTableCopy` no longer rewinds only the transaction timestamp after the pre-copy `databranchutils.AdvanceLineageSnapshot` workspace advancement. The rewind defer reintroduced by this PR's first commit was the exact defect main's #29539 removed; after `Workspace.AdvanceSnapshot` relocates transaction-local tombstones, a timestamp-only rewind leaves the workspace and snapshot in different generations and resurrects relocated deletes of earlier uncommitted DML. The workspace-owned advanced snapshot is now retained on every return path, matching the publication-side advance and the other owners; the duplicated `isTemp`/non-temporary advance branches collapsed into one mode-gated call. The design doc records the ownership rule and its #29539 lineage.
- New tests: `TestAlterCopyRetainsWorkspaceAdvancedSnapshotOnEveryReturn` (pessimistic-RC `Scope.AlterTableCopy`; any `SetSnapshotTS` rewind fails the test; retention asserted across the workspace-advance-failure and post-advance physical-copy-failure returns; mutation-verified in both directions) and `TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn` (real cluster: uncommitted in-memory DELETEs survive a forced DN flush and the ALTER COPY return inside the same pessimistic-RC transaction and after commit).
- Exact-head validation: full `./pkg/sql/compile` - PASS 14.987s; the canonical race command `-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile` - PASS 7.286s, no failure in 100 runs; both new roots - PASS; full `./pkg/tests/issues` - PASS 329.117s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's green CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `ebda98e960` (`ebda98e960e398f4436338f6353f1064d5009161`)
Rebased onto current `main` `501c85ecdd` after the behind event (head `f0840a56e0` was reported behind; `main` advanced `bdbbd17792` -> `501c85ecdd`). No code change in this cycle.
- The single new upstream commit `501c85ecdd` (perf(test): shorten embed and isolated race process lifetimes, #30249) touches `Makefile`, `optools/run_ut.sh`, and `optools/ut_embedded_schedule_test.go` only — test-infrastructure files with zero overlap with this PR's delta; the rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the prior head `f0840a56e0d382b3219b449a69a84a53bc957dbe`; only their base changed.
- Exact-head validation: full `./pkg/sql/compile` - PASS 13.871s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 6.486s, no failure in 100 runs; focused issue roots in `./pkg/tests/issues` (`TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn`, `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation`, `TestIssue29400IndependentCopyAltersProgressInPessimisticRC`) - PASS 9.997s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `9c2e6a6257` (`9c2e6a62574f0b34881fb14a48561ebe4cd054dd`)
Rebased onto current `main` `f2093ae4b3` after the behind event (head `ebda98e960` was reported behind; `main` advanced `501c85ecdd` -> `f2093ae4b3`). No code change in this cycle.
- The two new upstream commits — `f2093ae4b3` (fix(json): reject wildcard and range paths in JSON_KEYS, #28328) and `bb2b725d0a` (fix(shardservice): preserve immutable read cache snapshots, #30187) — touch `pkg/common/moerr/error.go`, `pkg/container/bytejson`, `pkg/shardservice`, `pkg/sql/plan/function` JSON files, and BVT cases, with zero file overlap with this PR's delta. The rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the approved head `ebda98e960e398f4436338f6353f1064d5009161`; only their base changed, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`) and the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), both recorded on `ebda98e960`, and the amended-design PASS (issuecomment-6186238709) review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 14.281s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 9.351s, no failure in 100 runs; the upstream-adjacent `./pkg/common/moerr` - PASS 0.492s; focused issue roots in `./pkg/tests/issues` (`TestIssue29400CopyAlterKeepsRelocatedWorkspaceDeletesAfterReturn`, `TestIssue29400OrdinaryIndexedCreateRegistersTasksAfterCopyPreparation`, `TestIssue29400IndependentCopyAltersProgressInPessimisticRC`) - PASS 8.902s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's terminally green CI run (38688137369, CI Required SUCCESS) is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `ce9ed59493` (`ce9ed594933ffe3cf2ea8403b561956d1c833eac`)
Rebased onto current `main` `461bc8e349` after the behind event (head `9c2e6a6257` was reported behind; `main` advanced `f2093ae4b3` -> `461bc8e349`). No code change in this cycle.
- The two new upstream commits — `461bc8e349` (fix(plan): omit overwritten implicit fulltext ordering, #30189) and `b5a4d5c795` (fix(frontend): enforce Starlark OUT and INOUT parameter types, #30134) — touch `pkg/sql/plan` fulltext-index files, `pkg/frontend` Starlark files, and embed/config tests, with zero file overlap with this PR's delta. The rebase auto-merged.
- `git range-diff` confirms all thirteen PR commits patch-equivalent to the approved head `9c2e6a62574f0b34881fb14a48561ebe4cd054dd`; only their base changed, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`), the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), and the amended-design PASS (issuecomment-6186238709) continue to review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 15.167s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 7.856s, no failure in 100 runs; the upstream-modified `./pkg/frontend` (includes both this PR's whole-transaction rollback roots and upstream's new Starlark roots) - PASS 28.287s; focused issue roots in `./pkg/tests/issues` (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers) - PASS 9.759s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The prior head's in-flight CI run is superseded by this push; the new head produces a fresh CI run.
### Current exact head after latest rebase: `a0e40253d0` (`a0e40253d0488e9c9f0b96752dec0724296df85d`)
Rebased onto current `main` `c46b893f61` after the behind event (head `ce9ed59493` was reported behind base `461bc8e349`, then conflicting while `main` advanced `461bc8e349` -> `83222fa837` -> `c46b893f61`). No PR-side behavior change in this cycle.
- The base hop through `83222fa837` picks up `8795f3699b` (revert: restore fulltext planner before #30189, #30285), upstream's fix for the CI blocker that failed the previous head's run `38703760162`: #30189's widened `tryApplyCoveredFulltext2` missed the stale call site at `apply_indices_fulltext_snapshot_test.go:180-182` and broke the `pkg/sql/plan` test build, failing SCA Linux/arm64, UT Coverage Ubuntu/x86, and UT Test Ubuntu/x86, blocking the Coverage merge at its `Verify coverage prerequisites` step, and turning the `CI Required` gatekeeper red — one verified root cause, pre-existing on `main`, with this PR contributing zero lines to `pkg/sql/plan`. The current base additionally contains the properly re-landed fulltext work `e8b3ed7f21` (fix(plan): integrate fulltext ordering and covered score limits, #30289); `mo-cgo-test -run '^$' ./pkg/sql/plan` passes on this head, so the defect is gone from the merge result.
- The rebase required a semantic interleave in two hunks where upstream `b6789851ca` (#30222) added the statement-retry `lastInsertIDBaseline` to the exact `Compile` flag block this PR extends: `types.go` now declares both upstream's `lastInsertIDBaseline uint64` (with its retry-restore comment) and this PR's `skipIndexTaskRegistration bool`, and `clear()` resets both (`c.lastInsertIDBaseline = 0` upstream; `c.skipIndexTaskRegistration = false` this PR, beside the other per-statement flags). Upstream's compile2.go save/restore pair is untouched and this PR's pool boundary is unchanged. Upstream `a85d90efc9` (#30334) also added cross-CN `SYNCCOMMIT` fences to its own `TestIssue29400CopyAlterRetainedGatePromotionFastFails` root inside `pkg/tests/issues/issue_29400_test.go`; the merged file keeps those fences and this PR's roots. The whitespace part of the resolution was folded into commit 10, preserving the clean 13-commit stack.
- `git range-diff` shows eleven PR commits patch-equivalent; commits 10 and 11 differ only by the interleaved upstream field/reset inside their existing hunks — every line the PR itself adds is unchanged, so the aptend implementation APPROVE (`PRR_kwDOFEPiGM8AAAABSZFhbw`), the mo-bot approve (`PRR_kwDOFEPiGM8AAAABSZQRVg`), the design-first PASS (issuecomment-6141109182), and the amended-design PASS (issuecomment-6186238709) continue to review exactly this code.
- Exact-head validation: full `./pkg/sql/compile` - PASS 34.197s (includes this PR's lifecycle/pool roots and upstream's new retry-baseline and calendar-interval roots); full `./pkg/frontend` - PASS 21.086s (includes upstream's show-metadata/authenticate changes and this PR's whole-transaction rollback roots); `./pkg/sql/plan` build check - ok 1.443s; the canonical race command (`-race -tags matrixone_test -count=100 -timeout=120s -run '^TestCompilePoolHandoffClearsPrivateIndexRegistrationPolicy$' ./pkg/sql/compile`) - PASS 4.120s, no failure in 100 runs; focused roots in `./pkg/tests/issues` (relocated workspace-delete retention, ordinary indexed-CREATE registration, indexed independent pessimistic-RC publishers, plus upstream's re-fenced retained-gate root in the shared file) - PASS 11.945s.
- `gofmt -l`, `git diff --check`, the protected-scope check, and the clean-tree check passed on the exact head. The previous head's red run `38703760162` (verified upstream-caused) is superseded; this push produces a fresh CI run for the new head.
### Current exact head after latest rebase: `2f4f928170` (`2f4f928170cb614dd8570ff6f4151f98dc1d4821`)
Rebased onto current `main` `76deafc806` after the behind event (head `a0e40253d0` was reported behind; `main` advanced `c46b893f61` -> `76deafc806`). No code change in this cycle.
- The single new upstream commit `76deafc806` (fix: report SELECT division-by-zero warnings, #30314) touches `pkg/sql/compile` expression/remoterun protocol files plus new division-warning test roots, `pkg/sql/plan/function/arithmetic.go` plus new plan test roots, rege…
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
issue #30164
What this PR does / why we need it:
A MATCH filter followed by explicit vector-distance or other-key ordering can retain an inner relevance Sort whose order is discarded. Propagate an ancestor-order proof through pure projections and filters, and omit that implicit Sort only before any observing consumer. Classical FULLTEXT, ordinary FULLTEXT2 and covered INCLUDE FULLTEXT2 share the decision.
Default relevance order, explicit relevance ordering, projected scores, score thresholds, nested LIMIT/OFFSET and stateful/volatile consumers remain protected. All qualifying hits still reach the explicit outer sort before pagination. The canonical SQL/result regression covers these public result contracts; planner tests detect the redundant Sort itself.
Validation:
e20f62dce4ad496baeb89ff9bc701eeb764652ed, against exact base5a0570ea70083c9365719009a5ed8d7618f9ed91.1056cd63357ead665b132ff2c007f9e4dbcc7579adds onlytest/distributed/cases/fulltext/fulltext_overwritten_order.sqland.result. Its executable SQL equals the validated canonical fixture and its result is byte-identical; only a descriptive SQL comment and repository pathname changed.8d88046aa71f37e79d853b6c2b193fca8db78402has the same tree689b6dfc93be309c1cead1141e9f064d19bd8a09as that final candidate. Only unpublished commit metadata/history was prepared under the verified user identity; production, Go tests and BVT bytes are unchanged..agents/skills/mo-dev/scripts/mo-cgo-test -p1 -vet=all -v -count=1 -timeout=180s ./pkg/sql/planpassed. Repository-pinned golangci-lint 2.14.0 passed on the changed planner package; this is incremental evidence, not full-repository SCA.git diff --checkpassed.maininspected:fab7b5c0430a475bf64ad1619ce4d5249013a138; merge-tree is clean. Evidence above remains bound to its stated base/head, rather than claiming runtime validation of the latest-main integration. Mergify subsequently merged that exact main into the source branch: current integration head540f5aeed806df1e4bfc9d162ecef0d970bcaacd, tree6d6b37496ce334f4136e6b60d83b784f228d0d94. It matches the preflight merge tree, and the six-file issue delta is byte-identical to the original publication delta. Runtime evidence is still bound to the stated developer baseline; integration CI is pending.QA required: yes. This changes planner execution for a public SQL path and removes runtime sorting state. Automation covers deterministic rows, scores, thresholds, pagination, stateful ordering and executed sort counters across the three owners. Independent QA/reviewer acceptance and exact PR integration CI remain pending. GPU, multi-CN, Sirius, ANN execution, production corpus/load, long-running stability and full-repository CI/SCA were not locally validated. The regression uses exact vector-distance sorting of fulltext hits; no ANN index is needed. Keep #30164 open through QA; this PR does not take over other issues.