Repository navigation
fix: synchronize index builds with concurrent writes on 4.2-dev - #32346
Conversation
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? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: d3e9fffa3dcc384cce3366cf9f2742cc3367fec5
Assessment: request_changes
The implementation reuses existing lock, barrier and workspace owners. The backport leaves a test helper undefined and omits coverage of stale UPDATE admission after index publication.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
-
P1
pkg/tests/issues/issue_28928_28931_test.go:222: Compiling the pkg/tests/issues test package.
Impact: issue27487DSN is called here and at line 224 but has no declaration in the frozen package. This prevents both new regressions and existing package tests from compiling.
Evidence: The declaration probe inspected all 45 package Go files and found only these two references (helper-probe.log; checks/1794051401068239892-2.json, exit 1). Reuse an existing connection helper, such as openIssue29715DB, or include the missing dependency, then compile and run the package. -
P2
pkg/tests/issues/issue_28928_28931_test.go:151: An UPDATE compiled against the old definition is admitted after CREATE INDEX publishes its new write target.
Impact: This side of the definition-fence contract remains uncovered. Both new UPDATE cases pause CREATE INDEX, commit UPDATE first, then resume backfill; they cannot establish that a later stale writer rebuilds and maintains the new index.
Evidence: Closing issue #32244 requires both admission orders and base/hidden-key consistency. Existing issue_29715 tests cover index removal. Add a deterministic two-CN stale-UPDATE schedule crossing index publication, verify hidden-key consistency and UNIQUE rejection, and execute the affected tests with the required concurrency/race validation. No matching completed SQL execution is supplied.
Validation:
-
Reviewed the complete five-file delta, affected owners and consumers, closing issue and both discussion entries; saved review-plan.md and discussion-assessment.json.
-
Isolation preflight passed: preflight.log; checks/1794051224789684495-2.json, exit 0.
-
Isolated AST probe confirmed the absent helper; existing-helper control passed. This was a declaration check, not a MatrixOne package build.
-
Source audit confirmed the assigned HEAD, clean checkout and passing git diff --check: source-audit.json/log; checks/1794051689759201485-2.json, exit 0. gofmt reports compile2.go.
Limitations:
-
No MatrixOne package, SQL or race tests were executed locally. Supplied local_validation is empty and relevant CI remains in progress.
-
No older-release binary validation was supplied for the legacy logtail fallback; supported mixed-version combinations were not inferred from protocol numbers.
0018a18 to
b6db5ab
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 71e8377fb743a74a90ade8c608d0ad6218efd341
Assessment: request_changes
The pessimistic-RC repair appropriately reuses existing locks, barriers and workspace handling, but the CN-local capability gate still breaks index DDL against an old TN during supported rolling coexistence. Earlier approvals are superseded by the controlled mixed-version evidence; the earlier helper and stale-writer test concerns are resolved.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P1
pkg/sql/compile/ddl.go:2666: A new CN starts at default protocol 11 against a v4.2.6/v4.2.7 TN and runs non-temporary pessimistic-RC CREATE INDEX or ALTER ADD INDEX.
Impact: The CN sends an unsupported ReadBarrier request and propagates failure instead of using the legacy path, breaking index-DDL availability during the accepted rolling-upgrade interval. Select the barrier using relevant TN capability or a compatible floor guaranteed before admission across startup/restart, and add old-TN/new-CN CREATE/ALTER regression coverage.
Evidence: runtime.go:60-61 defaults the CN to protocol 11; role_grant_graph.go:106-113 checks only that local value. ddl.go:2673-2679 propagates barrier errors. The current logtail client sends field 4 without peer selection; pinned v4.2.6/v4.2.7 schemas and dispatch lack it. Discussion 4509717802 reports old-TN failure with passing base and floor-10 controls; all six changed files match its original fa2469e head. Source audit and release fingerprints: source-evidence-audit.json, checks/1794272109633270824-3.json.
Validation:
-
Read the complete six-file delta, affected owners/consumers, linked issue #32244 and all 17 discussion entries; ledger covers each key once.
-
Bounded static source/evidence audit passed (checks/1794272109633270824-3.json); logs, commands, fingerprints and exits reconciled in validation-ledger.json. Source remains unchanged.
-
Compared pinned v4.2.6/v4.2.7 unsupported TN dispatch with the v4.2.8 capability control and the current CN startup/request/error path.
Limitations:
-
No fresh Go, SQL, race or mixed-binary execution. Supplied historical test and mixed-binary reports lack raw logs; they are attributed, not claimed as local passes.
-
Dependent index implementation polishing and execution stopped at the compatibility blocker. SI/optimistic and mixed-mode failures reported on baseline, partition exclusions and historical baseline package failures are not introduced findings.
-
Frozen UT, SCA, build, coverage and Go analysis remain in progress; upgrade checks are skipped.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: ce0bf0eb9a9ae6d61a92a3e3271d21c71cd58494
Assessment: request_changes
The existing mixed-version DDL regression remains. The repair reuses existing owners appropriately, but its CN-local protocol gate does not establish TN capability.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
- P1
pkg/sql/compile/ddl.go:2666: A default protocol-11 CN executes non-temporary pessimistic-RC CREATE INDEX or ALTER ADD INDEX against a v4.2.6/v4.2.7 TN during supported rolling coexistence.
Impact: The unsupported ReadBarrier request fails without selecting the legacy path, breaking index-DDL availability. Select using relevant TN capability or a compatible floor guaranteed before admission across startup/restart, and add old-TN/new-CN CREATE/ALTER coverage.
Evidence: runtime.go:60-61 defaults the CN to protocol 11; role_grant_graph.go:106-113 checks only that local value. ddl.go:2673-2679 propagates barrier errors. Pinned v4.2.6/v4.2.7 TN schemas and dispatch lack ReadBarrier. Discussion 4509717802 reports failure with passing base and floor-10 controls. Relevant source remains unchanged; current audit: checks/1794276793573377480-3.json.
Validation:
-
Verified the complete six-file patch and relevant source are unchanged; only an unrelated spill-test assertion changed upstream. Reconciled all 19 discussion entries and linked issue #32244.
-
Current source/context/released-capability audit passed. Receipts, retained logs and qualified prior evidence are reconciled in validation-ledger.json. Source remains unchanged.
Limitations:
-
No fresh Go, SQL, race or mixed-binary execution; historical execution reports lack supplied raw product logs. Dependent polishing stopped at the compatibility blocker.
-
Baseline SI/optimistic limitations are not introduced findings; partitioned tables remain outside this repair.
-
Frozen build, UT/SCA, coverage and Go analysis remain in progress; upgrade checks are skipped.
|
This pull request is merged. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 25da0f607efa7f0aff2991843b1aa5f5c58a5917
Assessment: approve
Per-stream capability negotiation resolves the prior old-TN DDL regression. The scoped pessimistic-RC repair coherently reuses existing locks, ordered barriers and workspace refresh.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
All 14 focused race tests and adaptive exact-test stress runs passed (N=1–100), including three-CN SQL regressions.
-
Full -race -short packages: morpc 422 passing cases/one skip, disttae 849 passes, logtail service 79 passes, issues 186 passes.
-
Compiler package: 1,339 passing cases; three Parquet failures reproduced at identical assertions with the exact merge-base build overlay.
-
Six production owners passed race build and vet. Frozen source, native provenance, all 22 discussion keys, receipts and retained logs reconciled in validation-ledger.json; final audit receipt: checks/1794338720082812029-2.json.
Limitations:
-
Official mixed-binary/reconnect and benchmark claims lack raw artifacts here; no fresh old-binary or performance execution.
-
Frozen CI remains pending. Legacy peers/protocol below 11 retain prior behavior; SI/optimistic, mixed-mode and partition guarantees remain outside this repair.
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: ed4a41e987e40d87b009c227143451f9da297fde
Assessment: approve
Per-stream capability negotiation resolves the prior old-TN regression while reusing existing lock, barrier and workspace owners. The later CI test fixes preserve their behavioral assertions.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Reviewed the complete delta, affected consumers, linked issue and all 24 discussion entries.
-
Fresh race checks passed: bootstrap regression ×100, full bootstrap package (47 cases), authorization test (11 cases).
-
Both affected test packages passed go vet; formatting and generated-descriptor checks passed.
-
Qualified prior race/build/vet reports reused for unchanged paths. Current receipts and logs reconciled in validation-ledger.json; source unchanged.
Limitations:
-
Historical raw execution artifacts were unavailable; no fresh release-binary or performance runs.
-
Legacy peers retain previous behavior; SI/optimistic and partition guarantees remain outside this repair.
-
Relevant frozen CI remains pending; upgrade checks were skipped.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32244
What this PR does / why we need it:
Backport the CREATE INDEX synchronization from #29235 to
4.2-devand apply the corresponding snapshot handoff to in-placeALTER TABLE ... ADD INDEX. A writer that commits after index DDL planning must be visible to the backfill; a stale writer admitted after publication must replan and maintain the new index. The change takes the existing catalog and base-table definition locks, rebuilds on metadata conflicts, and advances the pessimistic-RC workspace snapshot through the TN's ordered logtail barrier before backfill.For rolling upgrades, the CN checks the capability advertised by its actual logtail peer. If the TN does not advertise the barrier, or the CN protocol is below 11, index DDL keeps the earlier snapshot behavior without an additional HLC wait. Errors or interrupted negotiation do not select this fallback. The barrier-based handoff applies when the peer advertises support and protocol 11 is enabled; a manually pinned lower protocol continues legacy behavior. Existing behavior is accepted while legacy nodes or transactions remain, and an index corrupted before or during that interval needs separate detection and repair. This PR targets production pessimistic RC and does not claim to repair optimistic/SI behavior or partitioned tables.
The existing morpc activity test is also made deterministic by observing responses and using an isolated test socket.
Validation
-racecover concurrent index DDL, CREATE/ALTER, regular and unique indexes, stale UPDATE admission, same-transaction writes, rollback and cancellation. Physical hidden-index keys are compared with base rows.-race -shortowning packages:pkg/sql/compile,pkg/vm/engine/disttae, andpkg/vm/engine/tae/logtail/service; the changed morpc test passed under-race. A deterministic old-peer replacement test passed-race -count=100.gofmt, incrementalgo vet, repository-pinnedgolangci-lintv2.6.2 (zero incremental issues), and pinnedmolintpassed for the affected closure.molintalso reports existingcheckrecoverpositions outside the changed hunks. Generated logtail protobuf is byte-identical to regeneration.-race -count=50, the full authorization parent test under-raceand coverage compilation, and incremental vet and golangci-lint v2.6.2 for both affected test packages passed. The issues package has no instrumented statements, so that local-coverrun is not a full coverage measurement. New CI is pending.