Repository navigation
fix: bound CN spill runs by materialized bytes - #32188
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? |
5c9963a to
d7f1230
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: d7f12309d30aeed1b11281d993df27b791ec3cd9
Assessment: approve
The byte budget, block layout, cleanup ownership and reconnect handshake are coherent. Added accounting reuses existing vector, sinker and workspace capabilities; no actionable defects remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0
Validation:
-
Isolation preflight and native build from frozen inputs passed.
-
46 focused tests and 1,291 tests across seven complete race suites passed.
-
Twelve concurrency tests each passed 100 race repetitions. Reconnect integration passed normally and twice with race detection and scoped coverage.
-
Independent base/head writer controls confirmed the budget in four modes. Isolated SQL validation passed 34 statements and 14 expected result sets.
-
go vet, formatting and whitespace checks passed. Claims reconcile with 28 receipts and retained logs in review-validation.json.
Limitations:
-
Captured CI was still running.
-
Author-reported performance and peak-memory benchmarks were not independently repeated.
-
The logical budget permits a single oversized row and excludes total pipeline, arena and process memory.
-
Validation used one CN. Cancellation requires FileService cooperation; terminal unbound cleanup failure may leave orphaned objects.
967fa03 to
cfd32c6
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: cfd32c6aabb8ec8b28d41bdf097cde7044bb8f8c
Assessment: approve
No actionable findings. Byte accounting and cleanup state preserve block layout and publication ownership while reusing existing sinker, pool and workspace mechanisms. Reconnect and sequence error selection are coherent.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 35 changed files, linked issue #32146 and all 13 discussion entries.
-
Compared prior reviewed revisions and reused applicable spill/reconnect package, race, SQL and performance reports for unchanged paths.
-
Preflight, Go 1.27.1 bootstrap, frozen-input native build, formatting and source-integrity checks passed.
-
Five sequence regressions passed normally and under race; each also passed 100 individual race repetitions.
-
All 14 local receipts and retained logs reconcile in validation-ledger.json.
Limitations:
-
Captured current-head CI remained pending. Full package, SQL and workload runs were reused from supplied reports rather than independently repeated.
-
The soft budget permits an oversized row and excludes total pipeline, arena and process memory. Cancellation requires filesystem cooperation; dropping a failed unbound cleanup owner can orphan objects.
-
Existing SQL evidence covers one CN; crash recovery and multi-CN behavior are not established.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32146
What this PR does / why we need it:
CN spill could admit a row-count block much larger than its byte target before serialization, increasing compression scratch and memory use. Bound ordinary CN data and tombstone runs by a conservative materialized-byte charge before copying. Close each run on a row boundary, keep a single oversized row intact, and preserve the existing object/block format and result handoff.
The rebase integrates the transaction workspace's existing admission, publication and asynchronous cleanup ownership: source entries remain until their replacement is recorded, transaction-bound failures hand names to the workspace, and unbound writers retain their own retry responsibility. Batched cleanup confirms each name if a file service reports a missing member; writer rebinding replaces both the old capacity hook and cleanup owner. Preserve generic sinker behavior on sort failures and propagate impossible compression scratch allocations as errors.
Investigation of the coverage CI failure in
TestPKCheckReconnectRollsBackAndFreshTxnSucceedsidentified a separate, pre-existing reconnect race: the receiver can signal the connector before it is ready to receive, so the connector's nonblocking resume can be lost. A cancellation-aware per-resume acknowledgement now makes the connector wait until the receiver has resumed. A controlled execution of the old code reproduced the lost wakeup and CI's matching log signature; the CI trace alone cannot prove the exact scheduling interleaving.A later UT failure exposed another pre-existing sequence retry bug: an expiry decision could select a stalled sequence while the compiler returned the current pending error for a different sequence. Preserve the selected identity and its cause through arbitration and subsequent allocations, while retaining cancellation, publication and no-prober fallback behavior. The probe now uses the query context so cancellation of a finished pipeline alone cannot abort the decision.
Validation against
main@9e67b078, Go 1.27.1 and source-matched native libraries:objectio,objectio/ioutil,colexec,deletion,insert,multi_update,disttaeand TAE logtail packages passed normal and race runs. The CI-named reconnect test passed under race and separately under partialdisttaecoverage. Focused race repetitions covered early resume, cancellation, sibling drains, shared-pool teardown and workspace ownership. Incremental gofmt, vet, molint and golangci-lint passed for the affected package/consumer closure.pkg/sql/compile,pkg/sql/plan/functionandpkg/vm/process. The CI-named test passed 100 normal and 100 race repetitions with a virtual clock; controlled tests for the arbitration and stamped-terminal paths fail on the unmodified base and pass with the fix. Existing sequence SQL cases passed 98/98 checks on a single-CN service (result metadata ignored).The merge was checked against the then-current
main; CI for the updated head is still pending. A FileService that ignores cancellation can delay in-flight work, a final unbound cleanup failure can leave orphaned objects if its retry owner is dropped, and existing shared compression arenas may retain scratch across reuse until the arena is discarded or idle-reaped. The tests do not establish crash recovery or multi-CN behavior.Rebased onto
mainat781ebc03d905d646c38a1699488cb80e3288ecb1. The upstream stamped sequence identity handling is retained, along with the PR's compiler expiry arbitration; the equivalent upstream regression replaces the duplicate test extension. On the rebased source, the function, compiler and process packages passed race tests, the affected sequence controls passed in normal mode, and incremental gofmt, vet, molint and golangci passed for the 10 changed Go packages.One initial local compiler race run on a small
/tmptmpfs failed a group spill budget check; the full package passed when rerun with its temporary files on the larger root filesystem. The isolated test passed on either filesystem, so the trigger for that particular spill was not established. New-head CI must run separately.