Repository navigation
test(disttae): guard catalog replacement across lineage snapshot advance - #30602
Conversation
Main already advances lineage snapshots through the workspace owner. Add a deterministic regression for the catalog consumer behind issue matrixorigin#30541: real DROP/rename, TN catalog flush, shared lineage refresh, exact replacement ID, and the next real Delete without an intervening statement boundary. Reuse EnginePack with minimal catalog state and register resource cleanup immediately. Keep production behavior and the strict cardinality guard intact. Related to matrixorigin#30541.
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. |
|
mo-bot review · Commit: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 732297f741f133582d96011cd4cabcd8f61dbf5e
Assessment: approve
Reviewed the complete 91-line test addition and surrounding snapshot, catalog, SQL-executor and cleanup paths. The test appropriately reuses the engine integration harness, preserves the critical no-statement-boundary window, and verifies replacement identity plus the real deletion guard. Cleanup is sound, coverage is distinct, and production execution costs are unchanged. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
Verified frozen head/base, clean source, complete patch, formatting and matching native inputs. Missing native prerequisites were rebuilt through the repository owner in the diagnostic directory; provenance verification passed.
-
Focused test passed twice normally (0.63 seconds each) and once with the race detector (0.77 seconds), using the supplied isolated executor.
-
An overlay negative control bypassing workspace tombstone transfer failed at the intended assertion: both replacement and original table IDs became visible. Candidate source remained unchanged.
-
Full pkg/vm/engine/test suite passed in 162.518 seconds: 167 top-level passes, zero failures, and two existing skips (TestCCPRSyncProtectionRetry and Test_MultiTxnRollbackStatementS3).
-
Reconciled commands, source fingerprints, exit receipts and retained logs in /home/xupeng/.local/state/mo-bot/jobs/65445d9e14bf7231fb522533/attempt-1/receipt-reconciliation.json; reconciliation receipt 1792407181587510658-4.json exited successfully.
Limitations:
-
Validation covers the engine-level regression, not the complete Matrixflow upgrade incident or public SQL ALTER scheduling. Issue #30541's body was not supplied; its relevant contract was assessed through the frozen PR description and source.
-
Local race validation covered the focused test, not the full package. Pending frozen CI and author claims without retained execution artifacts were not counted as passing validation.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review: APPROVE recommendation; no blocking findings.
Reviewed the complete 91-line addition at 732297f against main d0e7f9a, including the existing snapshot owner, ALTER COPY callers, catalog delete guard, internal executor and fixture cleanup. No subagents were used for this review.
The design is appropriate: main already contains the production corrections from #29539 and #29754. This PR adds the missing catalog-consumer regression while retaining workspace ownership of snapshot advancement and tombstone relocation. No redundant state machine, execution path, production hook or runtime cost is introduced.
The test exercises real DROP/rename, synchronous TN catalog flush, the shared lineage helper, exact replacement identity and the next real Delete. The critical interval contains no statement boundary that could repair the stale tombstone before verification. Inspected mutation artifacts show that raw operator advancement exposes both catalog rows and triggers the original deleteTable panic. Existing tests independently cover repeated advancement, statement rollback, subsequent merge, partial transfer I/O failure and cancellation; duplicating those fixtures here would add cost without distinct coverage.
Unhappy paths and cost: immediate cleanup releases query results before active transactions and the engine pack, including assertion-failure paths. Existing context-aware flush and snapshot wait owners are reused. Setup is bounded to one database, two table identities and zero user data rows; the new test body takes roughly 0.7 seconds.
Evidence verified and reused: frozen-candidate owning-package normal and race runs each have 167 top-level passes and two existing skips; the exact new test passed 37 race repetitions; vet, molint and incremental lint passed. All 18 upstream overlay files and the new test were verified byte-for-byte against the current merged head; focused normal/race validation of that content passed. Full-package results apply to the frozen candidate, not a newly executed full-package run on the merged head. Latest GitHub UT/SCA checks were still pending when reviewed.
Comment disposition: no inline review threads exist; the existing completed review has no actionable findings. The paused/interrupted bot notices are operational status messages.
Scope: this PR satisfies the missing regression-coverage goal. The original Matrixflow/MOI upgrade workload has not been rerun, so the complete issue #30541 end-to-end acceptance remains open.
Submitted as COMMENT because the authenticated account is the PR author; the code-review recommendation is APPROVE.
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30541. Production fixes are already present on main through #29539 and #29754; the release-branch correction is #30576.
What this PR does / why we need it:
Add the missing deterministic catalog regression for COPY ALTER's DROP/rename window. Existing main tests cover transferred data deletes and replacement keys, but do not check the same-name catalog replacement and the next real
txnDatabase.Deletesingleton guard.The test commits an original table, creates its transaction-local replacement, drops and renames through the real engine APIs, synchronously flushes
mo_catalog.mo_tableson TN, and advances through the shared lineage helper. It then requires exactly the replacement table ID and successfully executes the next real Delete.There is no statement boundary between flush and verification: a normal boundary could repair the stale tombstone and hide the original defect. Setup reuses EnginePack with long checkpoint scanning, one PK column, two table identities, and no user data rows. Pack, setup/RC transactions and query results register cleanup immediately. No production hook, state, guard relaxation or runtime change is introduced.
Validation on Go 1.27.1 / Darwin arm64 CPU, with matching native provenance:
./pkg/vm/engine/testpasses normally (162.995 s) and with race (226.079 s): 167 top-level passes in each mode; two existing tests remain skipped and are not claimed as executed.delete table failed: query failedpanic fromdb.Delete. The mutation is not delivered.d0e7f9a552f, the exact regression also passes normally and with race using an external overlay of the complete upstream delta. Full-package results above apply to the frozen8732827base; the overlay check is focused compatibility evidence.go vet, repository-pinned molint and configured incremental golangci-lint against873282742714436bff407dfcdbbe879147162bd3pass; formatting and diff integrity pass.Commands:
This is regression coverage for the existing main fix, not a new production fix. It does not claim deterministic public SQL scheduling of a mid-ALTER flush, execution of the original Matrixflow upgrade workload, crash recovery, or a workload performance improvement.