Repository navigation
[4.2-dev] fix: stabilize DDL atomicity during logtail reconnect - #31571
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: 603ee7b2efe0671f02d91fcc2522e90ba5adbc49
Assessment: approve
Reviewed the complete six-file delta and discussion. The fixture split preserves existing DDL outcomes while adding explicit whole-transaction rollback/retry coverage. Callback synchronization preserves reentrant invocation outside the mutex. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Normal owning-package runs passed 1,985 top-level tests; one unrelated existing test was skipped.
-
Full disttae and isolated-test race suites passed 384 top-level tests. Four focused race tests also passed.
-
Adaptive race checks passed: callback registration 100 repetitions; SQL recovery and existing callback consumer two repetitions each.
-
Verified native build provenance, unchanged DDL statements and golden outcomes, formatting, clean source, and complete discussion coverage.
-
Receipts and logs reconciled in /home/xupeng/.local/state/mo-bot/jobs/d595ff9dc5b9fb405348aaea/attempt-1/validation-manifest.json. Initial executor-omission setup failures were excluded; corrected isolated runs passed.
Limitations:
-
Linux Compose BVT and the author's two-CN validation were not independently rerun; frozen substantive CI remained queued.
-
The recovery test uses one CN and a simulated lock-conflict result with real SQL and disconnect; it does not reproduce a natural multi-CN lock race.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #31542
What this PR does / why we need it:
ddl_atomicityexpects its ordered DDL statements to succeed, but it also injects random logtail receive failures. A reconnect can legitimately abort the active transaction: when it interrupts the internalmo_index_updateDELETE inDROP DATABASE, the drop rolls back and subsequent assertions cascade.Keep the existing DDL outcomes, remove the random fault from this success case, and clean up
db1at entry and exit. Replace the fault coverage with a deterministic real-SQL test that parks the DROP's catalog PK check, triggers a real logtail disconnect, and verifies the 20634 error, complete rollback and successful fresh retry for autocommit and explicit transactions. The test simulates the lock-conflict result; it verifies that the parked transaction belongs to the DROP session. Synchronize the existing test-only reconnect callback with its existing mutex and invoke it outside the lock. The admission fence and transaction retry policy are unchanged.Validation on darwin/arm64, Go 1.26.4:
ddl_atomicitymo-tester comparison twice on one SQL- and ISCP-ready two-CN cluster, using a round-robin TCP proxy: 96/96 statements passed each time, withdb1absent on both CNs after each run; connections reached both CNs.-race. The fulldisttaepackage passed normally and under-race; the callback race test passed 100 repetitions and the existing callback consumer passed two repetitions.go vet,molint, and configuredgolangci-lintpassed, with zero golangci-lint issues. Molint printed eight existing diagnostics in unchanged files while returning exit 0; none were on this delta.err-check, gofmt and diff checks passed.The deterministic recovery test is single-CN and uses an injected lock-conflict result with a real disconnect; it does not claim a naturally occurring lock race. Linux CI remains separate.