Repository navigation
fix: fail dump exports on source row iteration errors - #57
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b7d882e26
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
XuPeng-SH
left a comment
There was a problem hiding this comment.
APPROVE at 8b2000c (base 324c33d).
Complete production/test review found no remaining material blocker. Row iteration errors reach the CLI failure path; cleanup owns the reserved connection, closes the physical MySQL socket before unread rows can drain, and returns healthy connections normally. Pre-result ErrBadConn retries are bounded and never extend across a returned result set. Both buffers reset/return on every exit. The connection reservation is limited to the ownership boundary that needs independent failure cleanup.
The earlier bad-reserved-connection review comment is fixed and resolved. Deterministic connector tests and the real-driver protocol fixture prove separate contracts; the fixture never supplies EOF to rescue the failure path. Both exact tests pass 100 repetitions under race. Owning-package normal/race runs each have 52 passing test/subtest events, with only the two independently base-confirmed CSV assertion failures. Build/vet/gofmt/diff checks pass. Existing author KILL QUERY evidence remains applicable to the unchanged post-result path; this review does not claim it was rerun on latest main.
Merge coordination with #63 is required: preserve both Rows.Err() propagation and the new buffered CSV writer's final Flush() error. Their current main.go/main_test.go merge conflicts need semantic resolution and combined tests. This approval is for this exact head. No subagents or source edits.
…trip-305xx Resolve cmd/mo-dump/main.go conflicts against main's bufio-based CSV writer (#57/#59) and the #30638 INSERT-header fix (#62), and harden the #30587 sql_mode pin: - imports: keep strconv/math for the float overflow/-0 CAST path (#30598); main's regexp/encoding-csv removals retained. - toCsv tail: take main's r.Err()+w.Flush(), which already covers the #30628 final-flush error; drop the csvWriter.Error() alternative. - showLoad: keep plain-name CSV reference (#30481), sqlStringLiteral quoting of path/delimiter (#30590) and the explicit Close() error check (#30628). - sql_mode pin (#30587): emit once at the top of the script instead of inside the per-database all-tables block. A multi-database dump previously overwrote @MODUMP_SAVED_SQL_MODE with the already-stripped mode, so the end-of-script restore restored the wrong value; -tbl dumps skipped the pin entirely. - sql_mode strip: remove NO_BACKSLASH_ESCAPES from a comma-wrapped list via TRIM(BOTH ',' FROM REPLACE(CONCAT(',',mode,','),',NO_BACKSLASH_ESCAPES,',',')) so it cannot leave an invalid empty token ('X,' / ',X' / 'X,,Y') at any position of the mode.
Summary
Fixes matrixorigin/matrixone#30574.
SQL export treated
Rows.Next() == falseas normal EOF without checkingRows.Err(). Canceling the source query could therefore produce a truncated dump, exit 0, and appendMODUMP SUCCESS.ErrBadConnretries: release the failed reservation and reacquire a connection, for at most three query attempts. Never retry after receiving a result set.Already-emitted partial output is not rolled back; an interrupted export now fails instead of certifying that output as complete. This does not change cross-table snapshot behavior.
Validation
On macOS arm64, using Go 1.23.0 and this checkout's native build:
mo/mainat0ed6f92, preserving CSV fixes from fix: csv dump corrupts literal \N and NULL text values (matrixorigin/matrixone#30568) #63, BIT encoding from fix: encode BIT dump values as hexadecimal SQL literals #54, and the oversized-row INSERT-header fix from fix: drop unflushed INSERT header for oversized rows in SQL dump mode #62. Their regression tests and the full package pass in normal and race modes.Rows.Close → readUntilEOFblocking oncde3588.8b7d882. It checks recovery after one/two bad connections, wrapped errors, the three-attempt limit, physical connection replacement/cleanup, unchanged SQL, and exact output. Non-retryable query errors and row-iteration errors (includingErrBadConn) are not retried.-race.go vet, incremental configured lint, formatting, andmake buildpass.KILL QUERYA/B on an isolated single LOG/TN/CN instance, after INSERT output starts and the source SELECT is confirmed active (evidence from8b7d882, reused for its normal-sized INT/VARCHAR workload, which does not reach the merged BIT/oversized-row changes):context canceled, no success marker.SUM(id)=20000100000and total payload length is 40,000,000 bytes. Test databases and the test-owned service were cleaned up.The integration server binary was built at MatrixOne
9dfe5c1be9, not the issue's original server revision. No remote CI result is claimed from these local checks.