Repository navigation
fix(load): restore large CSV rows and preserve LOCAL upload errors - #31300
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? |
7a65752 to
cf00a37
Compare
cf00a37 to
325ed6e
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: 12f2fb5cf5361bb5f58db67bc26b81dba258d817
Assessment: approve
The complete nine-file review remains valid for the unchanged candidate. Admission, framing and cleanup stay with their existing owners. Both earlier findings are resolved: interrupted frames force retirement, and doubled quotes are fully charged. No actionable defect remains.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Attempt 3 verified unchanged sources, patch, behavioral contract, discussion and CI outcomes. Retained commands, source fingerprints, exit receipts and logs were audited; no product tests were repeated.
-
Exact-head evidence: isolation preflight and 192 native input hashes passed; parser package passed 149 RUN events; twelve lifecycle tests passed 779 individual race repetitions.
-
Verified 275 additional framing race repetitions against unchanged frontend semantics.
-
Frontend race execution recorded 7,406 passing events and no race reports, with one environment failure disclosed below.
-
Frozen current-head CI reports successful build, UT, coverage, static analysis and multi-CN BVT.
-
Parser benchmarks measured median overhead of 10.4% ordinary, 11.3% backslash-escaped, 12.4% doubled-quote and 2.8% empty-field workloads, with unchanged allocation counts.
-
Recovery audit passed. All six nonempty discussion items are assessed; the empty approval is recorded separately. Evidence and discussion assessments are saved under /home/xupeng/.local/state/mo-bot/jobs/1ea2afba5e73ad429ed93022/attempt-3. Source remained unchanged.
Limitations:
-
The full frontend race command exited 1 because unchanged Test_openNewFile_nilCtx attempted to write into the read-only checkout. This is an environment diagnostic, not a passing full-suite result or an introduced defect.
-
No fresh live large-file SQL restore or named multi-CN integration rerun; unverified author-only execution claims were excluded.
-
Benchmarks measure parser batches, not end-to-end throughput. The 64MiB record weight is not a heap-memory cap; failure draining can retain resources for up to 30 seconds.
-
The linked issue body was absent; the frozen PR contract and production callers established the reviewed requirements.
Merge Queue Status
This pull request spent 57 minutes 29 seconds in the queue, with no time running CI. ReasonThe merge conditions cannot be satisfied due to failing checks
Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. Waiting for any of
All conditions
Requeued — the merge queue status continues in this comment ↓. |
…ssue matrixorigin#30640) - csvparser: configurable MaxRecordSize (default 64MiB via CN largest-entry-limit), counting raw content + 1 per framed field; fixes hidden per-fragment readUntil limit and misleading txn-entry-size-limit message - frontend: interrupt in-flight load-local I/O on cancel and drain the finite client stream to protocol EOF so the statement error reaches the client on a reusable connection; bounded by per-read/total-wait/byte budgets wip: authored by two prior writers; verification in progress
…atrixorigin#30640) An ordinary (non-cancel) error surfacing through readThenWrite — e.g. the parser retiring the pipe after rejecting an over-budget record mid-upload — still returned early and let the cleanup defer disconnect the client (2013), while the bind-change flavor already drained. Route it through the same bounded drainOnExit drain so the SQL error answers on a reusable connection. Adds TestProcessLoadLocalDrainsOrdinaryPipeErrorToEOF (focused+race green).
…ose owner/watcher ordering races (matrixorigin#30640) - MysqlProtocolImpl now proxies InterruptLoadLocalIO / ClearLoadLocalIOInterrupt / ReadLoadLocalPacketWithTimeout to its Conn, so the production MysqlResp -> *MysqlProtocolImpl -> *Conn chain is drain-capable; a compile-time guard pins the contract. Previously every drain assertion on the real protocol failed, cancellation fell back to Disconnect, and the 65MiB over-budget upload became 2013. - The drain's total budget is now an absolute deadline installed on every network read of a packet, so one trickled header or payload can no longer outlive the total wait one byte at a time. - A pending cancellation interrupt is serialized with every deadline install (loadLocalMu): the old check-then-arm window could no longer overwrite the interrupt and pin a silent read for the session timeout. - processLoadLocal joins the cancellation watcher before lifting the interrupt and draining: a late InterruptLoadLocalIO can no longer retire a freshly armed drain (live matrixorigin#30640: drain killed 251us after the statement error -> 2013) or reach into the next command on a reused connection. - Deterministic UTs (no sleeps/scheduling assumptions): the stroke gate pins join-before-clear; a gated net.Conn forces the exact arm window for header, partial-header and partial-payload silent reads; the real MysqlResp -> MysqlProtocolImpl -> Conn chain drains to protocol EOF and serves the next command. Focused 12-name UT rc=0 and -race rc=0 (mo-cgo-test). Real mo-service binary: 65MiB over-budget upload returns ERROR 20301 (csv record size ... exceeds max record size ...) on the same CONNECTION_ID, then SELECT 1 and a small LOAD LOCAL succeed on that connection; no 2013/2006/packet/reconnect.
…tracts with failure-safe gates (matrixorigin#30640) - interrupt gate parks the cancellation watcher between CloseWithError and the socket interrupt; one-shot release via sync.Once-backed cleanup so a Fatal path never leaves the watcher or arm goroutine parked. - gatedReadDeadlineConn forces the check-then-arm window at the real SetReadDeadline boundary; interrupt execution is awaited through a barrier so side effects provably happened inside the window (RED evidence: red_fix8_b.log rc=1 with joinWatcher/arm-lock reverted, deterministic). - owner/watcher test asserts the fixed order contract (join before clear, drain to protocol EOF, connection reusable). - trickle drain budget restore is t.Cleanup-based.
…nc coordinator rebuilds The multi-CN CI periodically deadlocked: the continuous ISCP executor's mo_iscp_log job-state update transactions race the manual alter reindex force_sync issued from the second coordinator CN, forming a lock cycle on the shared job row. The embedded multi-CN fixture hosts the executor on exactly one CN; discover that CN, pause its executor before the manual rebuilds, and resume it only after the leftover subtest transactions are rolled back and the SQL sessions are released (LIFO cleanup ordering), keeping all cross-CN index/generation/rollback assertions intact. Same quarantine shape as the temporary-table fixture (matrixorigin#31288); production retry ownership is unchanged. Fixes matrixorigin/matrixone CI instabilities seen on PR matrixorigin#31300 suite.
…oundary is unknown (matrixorigin#30640) An interrupted LOAD DATA LOCAL upload read that consumed only part of a frame (partial header, a complete header whose payload was never read, or a partial payload) leaves the next unread byte off the packet boundary. A drain starting a fresh packet read there can re-frame file bytes as the empty upload EOF packet, falsely authorizing connection reuse and leaving the frame remainder to be decoded as subsequent commands. The connection now credits every consumed byte toward the frame — including the (n > 0, err != nil) shape a single net.Conn Read may legally return — and exposes a sticky LoadLocalFramingBroken state that neither an interrupt clear nor connection teardown revives. MysqlProtocolImpl proxies the state through the production chain. drainLoadLocalUpload refuses to resync when the boundary is unknown, so the owner retires the connection; drains at a clean boundary, the watcher join-before-interrupt-clear ordering and the per-read/byte/wall drain budgets are unchanged. Deterministic regressions drive partial-header and partial-payload interrupts plus a single read that returns file bytes together with its error through the real MysqlResp -> MysqlProtocolImpl -> Conn chain, and pin both the retire decision and the safe-boundary reuse controls, with failure-safe owner and watcher joins.
… the record bound (matrixorigin#30640) A doubled quote inside a quoted field is two input bytes folding into one decoded quote, but the parser appended only the folded byte to recordBuffer and priced it at one: encoded content up to roughly twice the configured limit bypassed the pre-unescaping whole-record weight (four doubled pairs at 8 raw bytes passed MaxRecordSize=5). The record now carries a per-record surcharge for consumed input bytes the stored representation folded away — today the second byte of every doubled-quote pair — and recordWeight prices stored representation plus folded raw delta plus field framing, resetting with the other per-record accumulators. Decoded values are untouched; the escaped-pair path already charged both consumed bytes and is unchanged, as are delimiter and field- framing semantics. Regressions pin exact thresholds across block sizes 1/4/65536, escaped parity, back-to-back in-budget records on one parser, shared multi-field budgets including framing, and Reset reuse, all through the real parser Read/Reset entry points.
After e941ab2 the plan always uses the HNSW scan for exact-ordered reads, so the delta-checksum wait only proves ISCP published the model; the CN serving the connection may still return the previous generation (CI failures EXPECT 2001 / ACTUAL 777). Wait for the serving view itself (boolean wait_expect probing the real vector index scan result), and keep probe + assertions inside one transaction: the proxy refuses tunnel migration while a transaction is open (pkg/proxy doc.go rule 3 / tunnel.go inTxn gate), so the assertions cannot land on a CN that has not loaded the generation.
Merge Queue Status
This pull request spent 26 minutes 6 seconds in the queue, with no time running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #30640
What this PR does / why we need it:
largest-entry-limitconfig remains the server-wide default and the bound stays enforced — oversize records are rejected with a largest-entry-limit error ([Bug]: mo-dump CSV reports success for valid 12 MiB row but generated LOAD DATA cannot restore it #30640).CI BVT stability fix (test): vector_hnsw_delete_insert now waits for the HNSW serving view — a bounded wait_expect probing a real vector-index-scan result — before its exact assertions, and keeps probe + assertions inside one transaction so the proxy cannot migrate the session between probe and assertion (pkg/proxy doc.go rule 3 / tunnel.go inTxn gate).
Validation (local, 2-CN + PROXY topology; NOT the GitHub Docker Compose CI):