Repository navigation
fix: reduce streaming export spool payload residency - #31409
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 discussion changed before publication; a fresh contextual review is queued. |
iamlinjunhong
left a comment
There was a problem hiding this comment.
Reviewed the complete 21-file diff at head 7535e32dff23423c693d5df9192f3a480463fe80 against dispatched base 9e29011e7313a57962adc00963baa659d1e81e37, including full-read routing, cache isolation, spool snapshots, allocation provenance, source staging and final-reference cleanup. Scope remains the spool-residency change related to #30575; this review does not establish closure of the original production report.
The previous Copy/UnionBatch descriptor invalidation and Window-source findings are addressed by the current source-preservation/COW ordering and covered by passing targeted tests. No current P0/P1 finding was confirmed.
[P2] Preserve the allocation-free sort/compact path for leased varlen results — pkg/container/vector/vector.go:10296–10297.
InplaceSortAndCompact() still restores compacted descriptors with appendList(v, newCol, nil, nil) after setting v.length = 0 (vector.go:12001–12006, 12320–12322). For a vector with a leased area, the new alias guard invokes withClonedBytes with a nil mpool, which returns an error. The sorter ignores that error and leaves an empty vector marked sorted. The new COW check in extendWithBitmaps also requires a pool, so simply bypassing this alias guard would not restore this caller's contract.
Exact-head reproducer, using ordinary TEXT values without provenance sidecars:
- Append
[b×64, a×64, a×64]to an off-heap source and populate an empty destination withCopyWithReadonlyArea. - Call
destination.InplaceSortAndCompact(). - Expected: two sorted rows
[a×64, b×64]. Actual:Length() == 0,GetSorted() == true, with no returned error.
The previous owned UnionBatch materialization returns the expected two rows. A manually installed area lease also works with the baseline vector implementation loaded through a read-only Go overlay. Both controls finish with zero mpool balance. This is introduced by the changed append/COW behavior and is exposed by the new leased full-read representation. Keep descriptor compaction compatible with this no-pool API, or provide an explicit fallible materialization boundary before clearing length; add duplicate-value leased TEXT/array coverage. This is P2 because the inspected production sort/compact callers currently construct owned or deserialized vectors; this review did not establish a SQL path passing a leased scan result directly to this method.
Validation on the dispatched head:
- Passed targeted normal tests in
vector,pSpool,objectio,objectio/ioutil, andblockio, covering the new readonly mutations, writer/encoder failures, Window sources, cache isolation, queued snapshots and block routing. - Passed targeted
-racetests for readonly mutation/snapshot cases invectorand retained reader payloads inpSpool. - Executed the additional sort reproducer and owned/baseline controls above. Source files remain unchanged. Diff whitespace and Loom PR artifact checks passed.
- Built the required CGo libraries locally. The broader
make cgoinvocation was stopped during an unrelated ONNX Runtime download after a network timeout; it is not reported as a successful full native build. No cluster/BVT, production-topology export or current-head performance benchmark was run locally. - Dispatch CI: all 29 checks completed (13 success, 14 skipped, 2 neutral);
CI Requiredsucceeded. GitHub reports mergeable, behind main.
Read the previous reviews, both supplied inline threads and PR conversation. The previous reviews contained P1 findings, with no prior P2/P3 author-reply disposition to apply. The remaining P2 above is newly reported, so the event is COMMENT (one P2; no P0/P1/P3).
|
mo-bot review · Commit: Review discussion changed before publication; a fresh contextual review is queued. |
iamlinjunhong
left a comment
There was a problem hiding this comment.
Reviewed the complete 23-file diff at head 7da8dd0bea535834a5316184ddfab1c19206aacd against base 21991b38274208798e67e14d4b2dfc4743048572. No current findings were confirmed. APPROVE.
The previous descriptor invalidation and Window-source findings remain addressed: overlapping sources are preserved before COW, and materialization precedes descriptor references and capacity admission. The last review's sort/compact issue is also addressed: varlen compaction publishes the existing descriptor prefix through SetLength, retaining the payload lease without a fallible no-pool append. Added regression coverage checks duplicate and unique TEXT/array values, retained snapshots, backing identity and allocation counts.
All previous reviews, three inline threads and the supplied PR conversation were checked. No explicit author replies to those findings appear in the supplied data; repair commits were not counted as replies. The findings are resolved in the current code, so none remain subject to the outstanding minor-finding reply rule.
Validation: read the full diff and relevant read/cache/spool, mutation, allocation-account and terminal-cleanup call chains. Local git diff --check and the Loom PR artifact check passed; source remains unchanged. Reused the exact-head CI results and inspected the UT job's checkout, race-mode invocation and successful step status. Individual new regression names were not visible in that job log, so no independent case-level execution claim is made. Local package/race tests and cluster/performance runs were skipped because source inspection disclosed no remaining uncertainty requiring another execution; author-reported local results were not treated as newly executed reviewer tests.
Dispatch CI is complete but not all 29 checks are successful: 13 success, 14 skipped and 2 neutral; none failed or pending. CI Required succeeded, as did UT, SCA and the enabled proxy/pessimistic multi-CN BVT checks. This scoped review does not establish closure of the original production report in issue #30575 or reproduce its two-CN x86 export measurements.
aunjgr
left a comment
There was a problem hiding this comment.
Approved for this scoped optimization. I checked the private reader materialization, retained payload ownership, copy-on-write and alias handling, allocation provenance, partial-failure cleanup, and the relevant spool/Vector/storage tests. I found no blocking issue. Passing CI and the documented author validation were reused; I did not reproduce the original 24-producer production environment, so this approval does not claim that issue 30575 is fully resolved or that all workloads improve.
|
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: 7da8dd0bea535834a5316184ddfab1c19206aacd
Assessment: approve
Reviewed the complete 23-file delta and ownership consumers. The earlier descriptor, Window-alias and sort/compact defects are resolved. No actionable findings remain; the scoped residency-versus-copy-cost tradeoff is acceptable.
Model: gpt-6-astra / xhigh
Session: 01a1869d-999c-7481-b340-ae4a63e8cee4 · slot 1 · generation 2
Validation:
-
Source audit passed: frozen head/base, unchanged checkout, matching patch, diff whitespace, all 17 discussion dispositions and preserved SQL/result oracles. Receipt: checks/1793329872185117086-2.json; log: source-validation-final.log.
-
Reused supplied exact-head CI and prior review evidence: 13 successful checks, 14 skipped, 2 neutral; prior review records UT/race execution inspection.
-
Saved review-plan.md, discussion-assessment.json, review-notes.md and validation-evidence.json; reconciled both audit receipts and retained logs.
Limitations:
-
No Go tests or SQL BVT were run locally in this attempt; raw CI logs and the external design document were not bundled.
-
Original two-CN DOP24 production behavior was not reproduced. Approval does not establish incident closure or universal performance improvement.
🚫 Left the queue5 min in the queue, with no time running CI. So far
Reason Pull request #31409 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 |
What type of PR is this?
Which issue(s) this PR fixes:
Related to #30575. This PR does not claim closure of the original production report.
What this PR does / why we need it:
Accept exact-capacity spool buffers without weakening allocation-provenance checks.
Materialize full, non-appendable reads into private query-owned varlen payloads before publication, then retain those immutable payloads through the existing spool lease path instead of copying the whole area again. Descriptors and mutable metadata remain independent; the last reference frees the original allocation without capturing a reusable source Vector.
Preserve cache isolation, destination allocation accounts/modes, COW and partial-failure cleanup. Retire empty owned scratch before admitting a new private payload. Selected-row, TopN and appendable/MVCC materialization keep their existing path; DOP and pipeline/wire/storage protocols are unchanged.
Preserve overlapping Vector/raw/JSON/array inputs before COW or growth; admit writable backing before payload writes. Opaque writers/encoders keep original inputs alive until their synchronous callback completes, with admission before user code and no replacement backing committed on failure. Fixed and varlen aliases are rejected before issuing a selected-batch preflight proof.
Sort and compact already-private varlen descriptors directly, retaining the readonly payload lease; the no-pool path does not clear length and then call fallible append/COW.
Reviewed design: v1, exact pre-implementation revision. SHA-256:
4916aed9d16864307c78f14456b3dc0f668259d1aee350e20c45bef6181d581e. The developer approved this direction before ownership implementation; the archive preserves the reviewed document verbatim.Validation
7da8dd0bea(base21991b3827): removed the forbidden unsafe import from the new regression test without weakening backing-address assertions or adding check exceptions. CI-configured molint source35bd4d9a4055reproduced the checkunsafe failure before the fix and passed afterward; vector UT/vet/race, the 90-scenario regression race ×100 and incremental golangci-lint passed locally. Post-push CI was not monitored.2cc731ffc2(base7597f979e7): formally rebuilt native dependencies after the target Makefile change and verified provenance; full UT, race andvet=allpassed for eleven owning/consumer packages, including readutil, partitionprune and ivfflat, on Darwin/arm64 with Go 1.27.1. Incremental golangci-lint: 0 issues. The latest 90-scenario sort/compaction regression passed race ×100, preserving payload/descriptor/lease identity and allocation counts. Changed executable-line coverage: 100% for the latest fix, 89.87% for the complete PR. Earlier source/COW/preflight/admission regression cases remain in the owning-package suites.861a2c4cb6plus this patch): eight owning/consumer packages passed full UT/race on Darwin and Linux arm64; a small persisted TEXT/vector SQL smoke passed two independent same-instance mo-tester comparisons (14/14 each).Limits / review focus