Repository navigation
fix(load): preserve safe parallel splits for long CSV records - #31515
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? |
ab3575c to
7f1ac84
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: 7f1ac84220670931b69abecafbd4ab3529ad0a1d
Assessment: request_changes
Complete delta and discussion reviewed. One confirmed regression bypasses boundary verification at exactly 256 KiB, causing silent field-byte loss or rejecting valid multiline CSV. The frozen base passes identical probes.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P1
pkg/sql/colexec/external/external.go:803: A strict suffix probe reads exactly 262144 bytes before real EOF and returns a candidate before file end. The expanded reader can accept this candidate where the old capped reader failed, but the strict greater-than comparison leaves verification disabled.
Impact: Parallel LOAD can silently strip an internal field's UTF-8 BOM or split inside a quoted record. Include equality in the verification trigger and add exact-threshold multiline/BOM regressions.
Evidence: Public SQL probes show parallel LOAD succeeding while shortening a field from 6143 to 6140 bytes; serial LOAD and the frozen base preserve every byte. A multiline variant instead returns Error 20301 on the candidate. Adding two bytes triggers verification and both variants pass. Logs and matching receipts are indexed in /home/xupeng/.local/state/mo-bot/jobs/020698b25455fa452a22ca3d/attempt-1/validation-manifest.json.
Validation:
-
Selected maintained strict-probe tests and all seven existing LOAD scenarios passed; additional review probes caused the candidate commands to fail.
-
Identical public SQL probes passed at the clean frozen merge-base; adjacent size controls passed on both revisions.
-
Isolation preflight, native provenance, formatting, source integrity and receipt/log reconciliation passed. Discussion ledger saved.
Limitations:
-
SQL probes use the existing file-specific fanout admission hook with small fixtures; parser, planner and execution paths are real.
-
No additional full-suite, race or throughput campaign was performed after confirming the regression. Frozen green CI does not cover these counterexamples.
63af17e to
3db81d9
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: 3db81d9d8d19dbf7a93208ca4959fb6f93661f55
Assessment: approve
The prior exact-256-KiB verification bypass is resolved, with BOM and multiline regressions covered. Boundary verification, shared budgets, cancellation, and fallback preserve the reviewed contracts. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Reviewed all five changed files, parser and compiler consumers, linked issues, and every discussion item.
-
Reused frozen successful build, UT, SCA, coverage, and applicable BVT results; author reports external-package and ten strict-load SQL scenarios passing.
-
Source integrity, patch equality, whitespace, and five-key discussion audit passed. Receipt checks/1793205311704325968-4.json matches review-audit.console.log.
Limitations:
-
No local Go tests or benchmarks were run; detailed execution logs were not supplied.
-
The earlier validation commit was unavailable locally, so its claimed rebase equivalence was not independently verified. Current-head CI provides fresh evidence.
-
Prefix verification may consume approximately 384 MiB per attempt and reduce fanout when its budget is exhausted; throughput gains remain unmeasured.
🚫 Left the queue20 min in the queue, with no time running CI. So far
Reason Pull request #31515 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
Hint You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Merge conditions: 2 of 3 metThis pull request
The batch, tested in place
Tick the box to put this pull request back in the merge queue (same as
Times in UTC · dashboard · how the merge queue works |
…bde910758fab5408771a081b443bc8c3bd61818
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
Follow-up to merged #31387, which bounded bad-CSV planning probes, suppressed speculative conversion reports and added cancellation. Its 256 KiB cap can also merge a valid long-record file into one effective reader.
Keep 256 KiB as a soft stopping threshold and derive a checked hard budget from the execution parser's record-size limit and CSV tokens. An initial fragment and the next candidate can complete. Suffix probing and optional verification share that byte allowance and at most 256 parser calls.
When physical probing reaches the former cap, verify each proposed boundary exactly from FileStartOff, including subsequent boundaries. Reject unsafe multiline and BOM restart boundaries, retaining earlier ranges and merging the tail. Each acquired stream closes before another opens, with cancellation and close-error precedence preserved.
Validation at
3db81d9d8d19dbf7a93208ca4959fb6f93661f55(Go 1.27.1, darwin/arm64):192158edb79f3b8e6c1364303b4d2b7ab83b1490after the first rebase; reused after the final Python-only main update (Go, native and test inputs unchanged): the complete external package and ten strict-load SQL scenarios with-vet=all, including seven threshold unit variants and three public equality scenarios. Exact serial/parallel values, retained fanout and safe fallback are asserted.reader_arrow_test.go; that file and the diagnostic's inputs match the frozen base. Independent design/final review is reused for the identical complete PR patch; the delivery artifact checks pass.The authoritative
CSVConfigForLoadmapping and main's parallel-worker isolation remain integrated. The prior short-probe allocation diagnostic was about 88 KiB, confirming the hard cap is not preallocated. The earlier unrelated UT cleanup timeout is tracked in #31545.CI refresh: the two PR commits were replayed onto official main
8f9bcd29ed8c236ec55c13bb9b88267a3a2a79ea. All five PR files and the complete PR patch remain identical. Run 40672111550 failed when the single planner race process reached its cumulative 40-minute package timeout; the active case had just started, and no race report or compilation failure was logged. Main now includes #31593's bounded planner scheduling change. This authorized rebase triggers new CI with that change; it does not establish that the timeout is fixed. The superseded run is not rerun.Verification may reread a prefix. Its shared hard cap is about 384 MiB per attempt with the default record limit; distant targets or prefixes with many short records can still reduce fanout. No throughput improvement percentage is claimed. The issue remains open for reporter verification after merge.