Repository navigation
fix(compile): preserve canonical COPY ALTER publication and rollback - #28418
VioletQwQ-0 wants to merge 21 commits into
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
GPT-6 medium deep review at exact head b3b000b.\n\nP1 — mandatory design approval remains unresolved. docs/design/20260911-copy-alter-publication-review.md:18 explicitly states that the conditional handoff is not maintainer approval, and the requirement remains open. The change affects snapshot boundaries, transaction retry generations, and deferred index lifecycle ownership across frontend/compiler/plugins; the mandatory design gate therefore cannot pass.\n\nP1 — required workload/performance acceptance evidence remains open. docs/design/20260911-copy-alter-publication.md:237 requires the original nightly workload and paired baseline/head measurements at 1/2/4/8 workers, with throughput, latency, regression, and timeout criteria. These measurements are still absent despite green ordinary CI.\n\nPlease obtain traceable approval of the exact design revision and attach the required workload/performance evidence.
|
@fengttt You were right to call out the re-review request. My earlier “Addressed the CR” update mixed your questions with conflict and validation details, then requested review again five seconds later. That was premature. Here is the direct answer. What COPY ALTER means here It is the existing The problem in #28319 is that expensive preparation holds the shared lifecycle/publication protection and serializes ALTERs on otherwise independent tables. The proposed change moves copying and synchronous index preparation outside the global publication critical section for eligible automatic-commit pessimistic-RC operations, while retaining source protection and revalidation before publication. Explicit transactions and other unsupported modes retain the existing path. Which SQL and assertions exercise it At current head alter table t algorithm=copy, add primary key(id);
alter table t algorithm=copy, drop primary key;It checks rows returned through the existing view, subsequent AUTO_INCREMENT insertion, historical snapshot reads, rollback, primary-key metadata, and foreign-key metadata. These are SQL correctness checks, not proof of the concurrency/performance benefit. The separate embedded SQL regressions cover independent-table progress, same-table serialization, and publication waits that reuse preparation rather than copying again. What has actually run, and what remains open
This comment clarifies the original questions; it does not declare your review resolved or request another review. The PR description still contains stale head/Draft/CI wording; the current-head evidence above supersedes that old status text. |
aunjgr
left a comment
There was a problem hiding this comment.
Design-gated re-review at b3b000b.
The required design decision and acceptance evidence remain open. This is a cross-subsystem transaction/snapshot/retry/lifecycle refactor, not merely moving one lock. I read the complete current publication design, its handoff record, and the review/author history. docs/design/20260911-copy-alter-publication-review.md explicitly says its conditional handoff is not maintainer approval and leaves the blocking design decision unresolved.
The design also explicitly requires the original nightly ADD/DROP workload and paired baseline/head measurements at 1/2/4/8 workers before merge, with copy-count, throughput/P95, <=10% single-worker regression and no unexpected timeout/connection-failure criteria. No completion evidence for those gates was found. Current CI is green, but does not replace the specified workload acceptance.
Please record a traceable maintainer decision on the exact current design and provide the required workload/performance evidence or a policy-owner decision changing those acceptance conditions. The executable ALGORITHM=COPY BVT is now present; I am not repeating the historical missing-syntax finding. This is a design/acceptance gate review, not a fresh full implementation approval or a claim of a newly reproduced runtime bug.
|
Revision 2 is pushed at Addressed in this head:
Fresh local evidence for this head is recorded in the PR body: focused issue regressions, affected package tests, targeted and owning-package race tests, CGo-aware build/vet, and |
|
Updated at exact head
Please review the exact revision-3 protocol and decide whether the focused merge-before performance scope is acceptable; no reviewer re-request is being made by this update. |
# Conflicts: # pkg/frontend/mysql_cmd_executor.go # pkg/frontend/types.go # pkg/sql/compile/alter.go # pkg/sql/compile/alter_test.go # pkg/sql/compile/compile.go # pkg/sql/compile/sql_executor.go # pkg/util/executor/options.go # pkg/util/executor/options_test.go # pkg/util/executor/types.go
|
@cpegeric @LeftHandCold — please make an explicit design decision on revision 4, before production repair or implementation re-review. The exact revision-4 design is published at Please approve this coupled protocol, or identify the specific changes required:
The decision record, assertion matrix and runner preparation distinguish proposed work from execution. The successful personal Ubuntu run tested old This decision request addresses the design obligations in aptend's thread, XuPeng-SH's first design thread, and the repeated design thread. All remain open until their approval/acceptance requirements are actually met. The two race-budget threads also remain open; no current-head timing is claimed. Please bind the decision to revision 4 / |
|
I am withdrawing the production publication/retry protocol in this PR. Current main has its own COPY ALTER preparation, publication and refresh mechanisms; this is not a claim that the old protocol received design approval or that #28319 has passed performance acceptance. The regression-only draft #32395 carries independent ADD/DROP PRIMARY KEY SQL scenarios and the historical-read/View/allocator/FK/rollback BVT. Its executor observer demonstrates the stated SQL boundaries; physical write overlap and complete physical-copy/retry counts remain open. The old specialized fixture and gossip network-family changes are recorded as separate candidates and are not included in the new PR; the old performance runner and measurements remain historical experiment material. For the earlier question about the SQL: COPY ALTER is existing The fixed B/M performance comparison, three distributed nightly replays, cleanup and QA remain to be tracked under #28319. I have replied separately to the five outstanding inline threads. I am closing this old implementation in favor of the regression draft; the issue stays open. |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28319. Draft: the concurrency/performance issue is not accepted as fixed. QA required: yes.
What this PR does / why we need it:
Current phase: revision-4 design decision (2026-10-15)
Published design-only head:
56a4c48def089624f2dc1572ec8ea616399db843. Executable production/test/runner files are unchanged fromf7903a01aa528bb05b5662d6b2bdd859cf4212f5. Inspected main:8795f3699b40504376343fa1acda8b4619f0c76e. Current conflicts are not resolved by this documentation commit.The revision-4 protocol supersedes the old late-exclusive-publication proposal. It proposes a narrow ordinary ADD/DROP PRIMARY KEY fast path using main's scalar replacement admission: shared C/G/D plus exclusive source K/T held through the transaction. Copying avoids global exclusive admission. Complex/unsupported tables and enabled persistent View refresh remain broad. Any fresh broad retry is bounded to one and must occur before copying; ordinary contention does not recopy. No SQL, catalog, wire or user setting is added.
Maintainer approval is PENDING. The decision record identifies the explicit protocol/barrier/fallback questions for @cpegeric and @LeftHandCold. Production repair, main conflict integration and new-head remote acceptance follow that decision. No implementation re-review is requested yet.
Validation of this update: four Markdown documents only; local links, fenced blocks, pinned replay identities and
git diff --checkpass. No executable change and no new runtime/race/BVT result is claimed. The complete PR retains canonicaltest/distributed/cases/ddl/alter_copy_publication.sqland.result; its historical correctness evidence does not prove this new fast path.The current assertion matrix and runner preparation contract require deterministic path/concurrency and failure proof, full paired 1/2/4/8-worker measurements, <=45.55s per changed top-level race test in Ubuntu CI, three serial equivalent fixed reconstructed nightly runs with the original topology/error contract, and deployment QA. All repaired-head runtime gates remain NOT_RUN/PENDING. Revision 3's reduced 1/2-worker acceptance proposal is withdrawn.
The already successful personal Ubuntu run
c105-20261015T081332Z-a9617dcompared old base8a4c84f4516d5098de9eef50b8afecc7524f37a2with old head5be67e3694712bc208e42c8db4c6032a2d896f65. It establishes a reusable runner lifecycle, not performance of the current PR. The new generation needs Go 1.27.1, rebuilt native artifacts and shared/exclusive-mode observations. Accepted nightly reconstruction does not imply current image/topology/admission or runtime acceptance.Remaining review comments: the three design/acceptance threads (aptend r4001780128; XuPeng-SH r4008474122 and r4009643127) still need traceable maintainer approval and required acceptance. The two XuPeng-SH race threads (r4008474132 and r4009643130) still need actual per-test Ubuntu/CI timings on the repaired head. Each remains open independently; no review is represented as resolved.
Historical f790 maintenance and validation record — superseded status/plan wording
The following is retained for provenance. Its revision-3 proposals, old current-main/status wording and unsent-comment status are historical. The revision-4 section above is authoritative for the current phase; the design decision request is being published separately.
This maintenance normally merges actual main
fcad62a8ff06000e682824802f1155cbeea02a2finto the previously published0f24cded0f6f85d3f8c5b9ef09943675143896cd, preserving both histories. The main COPY changes preserve live source definition/version validation, wide-column replay context and source FK identity; CREATE VIEW lifecycle admission also comes from main. The sole merge conflict was a compiler test executor: resolution retains both the PR's statement-option observation and main's CREATE context/error tracking. The earliertypes.goformatting correction remains intact.Actual merged dependency #30111, commit
f14a1fa9ee813529b7bde89ecc74dddca420dc00, is in the main ancestry. The earlier main integrations175a645a85994f2c95992d3aa8d6dacb6d9e167fand5c959556431225711a33d1af5fe9a5b6d4060122are retained. This update does not inherit the closed/unmerged #30110 alternative or require an unmerged EXPLAIN fix.Fresh review found a shared embedded-test fixture defect:
RunActiveborrowed an initialized cluster while bypassingRun's exclusive callback admission and failure quarantine. Both now use the same owner. A borrow never initializes an inactive generation, waits for an independent callback, rejects nested/closed/sealed use, and registers generation-bound failure cleanup. Callback failure, panic and late test failure seal/retire the fixture; stale cleanup cannot close a replacement. Three new regressions fail on the prior source and pass after repair; the mutual-exclusion regression waits for the second entry before its negative observation. This is test-fixture lifecycle repair, not a COPY publication protocol redesign.The full PR retains canonical C/G/D admission before source locks, retained-owner FastFail, source identity/re-resolution, atomic replacement, allocator/FK maintenance and synchronous index/task publication. Admission already retains the broad snapshot lock when delayed-publication eligibility is evaluated, so ordinary pessimistic RC COPY rejects the split and uses the existing fallback through transaction completion. The shortened publication critical section, concurrent independent-table preparation and performance benefit are not delivered. Existing peer tests run sequentially and fallback tests do not establish split preparation or split retry/reuse. The
NewPluginIndexespreparation/publication-set consistency identified during review must also be reconciled before activating that currently unreachable split path. Revision3 is still a proposed design requiring a maintainer decision; this maintenance neither removes the canonical lock nor infers approval.Current candidate
f7903a01aa528bb05b5662d6b2bdd859cf4212f5, tree03d87ac5f2718a59769d51eefab00cc26cc5fcca, is validated against merged mainfcad62a8ff06000e682824802f1155cbeea02a2f. The latest observed main5d971d07a7c5a52a71f2c10390b109cebf5c0825, #29994, is not merged or represented as tested here. Its six changed paths do not intersect this PR's final 42 paths. Independent review traced its production changes to indexed CASCADE DELETE/self-REPLACE; the selected COPY execution paths do not trigger them. Its additional self-FK COPY BVT is adjacent coverage not included in these results. The frozen maintenance validation remains applicable without claiming the later fixes.Validation uses Darwin arm64, Go1.27.1, CGo enabled,
GOEXPERIMENT=simd,MO_CL_SIMSIMD=0:git diff --checkand configured incremental golangci-lint over the affected package directories pass.^TestIssue28319on f790 passes 36 RUN/24 top-level tests, and retained-gate FastFail passes 18 RUN/1 top-level test. Current combined-raceselection passes 70 RUN/47 top-level tests with no race reports, covering both the shared fixture and public COPY tests. These local results do not satisfy the requested Ubuntu timing gate.make build-with-prebuilt-nativepasses on f790. Actual service SHA256:dd8553a168eab3d5d96221cb577a253ace45e83a07450ac0f930ed48940d16fb. Native provenance is verified; execution observes the ownedlibmoloader path and matching native hash. Earlier service binaries are not represented as this build.test/distributed/cases/ddl/alter_copy_publication.sqland.resultpass 31/31 twice on that service, zero failed/ignored/abnormal statements. Formal ISCP startup is observed. Database and global snapshot absence are checked before repetition and after execution; all owned service and tester process groups are absent, cleanup COMPLETE. This exercises existing COPY syntax, ADD/DROP PRIMARY KEY, historical rows, views, allocator/FK preservation and rollback without golden regeneration.pkg/logservicebytes are unchanged. It is reused only for that fixture scope. Earlier broad package totals, binaries and performance-driver results remain historical and are not promoted to current-head whole-package results.Original failures remain recorded. The first current public invocation failed before SQL assertions because Darwin rejected the long Unix-socket path; an actual long/short socket control justified the new owned short TMPDIR, followed by the current PASS. The first canonical run completed both31/31 but its wrapper exited during a transient post-termination process-group permission check; independent process inventory and ESRCH observations established recovered cleanup. That initial wrapper remains FAIL. The corrected bounded cleanup wrapper was independently frozen/reviewed and the subsequent R2 execution supplies the final runtime PASS. Testers own separate process groups; timeout and final cleanup cannot silently omit Java descendants.
Fresh result-blind Astra Stage A inspected the complete initial production/test diff and raw issue contract, excluding author design/review narratives until Stage B. It independently identified the unchanged original acceptance gaps and the borrowed-fixture defect. The same reviewer then checked the actual repair, red/green mappings, current execution, original comments/threads and latest-main delta. The final change map contains 42 paths. Author self-review is separate. The review supports scoped maintenance publication while the original full-function gates remain unmet; this is not a Ready declaration.
QA required: yes. Local correctness and cleanup do not establish the original workload, deployed lifecycle/cache behavior or design acceptance.
Remaining requirements: named maintainer decision on the exact revision3 protocol reconciled with actual main admission; original nightly runner/tool/data/timeout identity; paired baseline/head ADD/DROP at 1/2/4/8 workers with observed copy counts, throughput/P95 and <=10% single-worker median regression; three equivalent original-nightly runs without unexpected timeout/connection failure; current Ubuntu <=45.55s per-test race-budget evidence; full QA and reviewer acceptance. Candidate-only diagnostic workloads and Darwin timings do not substitute for these contracts. The same versioned acceptance matrix is retained.
The latest review refresh still contains 12 formal reviews and five unresolved threads, with no revision3 approval found. Existing syntax and canonical correctness tests do not close the missing optimization/performance contract. Responses are prepared UNSENT; no comments, resolutions, re-review requests, remote experiments or CI reruns were sent. This PR remains Draft.