Repository navigation
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed latest (10177e8).
按 correctness、spill/cancel 控制路径、resource lifecycle、unhappy path 和功能闭环看,这轮没有看到新的 merge-blocking correctness、cancellation、cleanup 或状态机问题。
GitHub 不允许我用当前账号 approve 自己的 PR,所以这里留 comment 记录结论:从这轮 review 看是 LGTM。
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review completed on exact head 10177e8.
Conclusion: LGTM — no merge-blocking correctness, cancellation, lifecycle, or bounded-work findings. If this were reviewed from a non-author account, my decision would be APPROVE. GitHub forbids approving or requesting changes on one's own PR, so this formal review is necessarily recorded as COMMENTED.
Reviewed the EOF-to-evaluation transitions in Group, MergeGroup, MergeOrder, and Top; cancellation during bucket/run/chunk spill work; ownership transfer for spill runs/readers and unattached reduction runs; Reset/Free idempotence; partial materialization cleanup; and mock-child reuse semantics. The checks stay at phase/work-unit boundaries and do not add per-row hot-path overhead.
Local validation passed: affected-package full tests; the five focused cancellation/mock tests repeated 10 times; focused race tests; colexec subtree compile; go vet; and git diff --check. Remote CI was still running and was not awaited.
10177e8 to
33e6458
Compare
ck89119
left a comment
There was a problem hiding this comment.
Deep re-review completed on exact head 8a3a50d197b7f058db48ba5700fa834174a28e25 against PR base 6091b418fd529badca4e1855843bd38804de396f.
Conclusion: APPROVE. After the moving-head fixes, the full phase × ownership × terminal matrix has no remaining confirmed merge-blocking correctness, cancellation, cleanup, race, or unbounded-state finding.
Verified closure:
- Group / MergeGroup: EOF and non-EOF cancellation; final spill and respill; wave, group-batch, non-empty-bucket, bucket-flush, and reload-record boundaries; zero/partial/all bucket ownership transfer; streaming intermediate-result publication; and cancel -> Reset -> fresh Prepare -> successful reuse.
- MergeOrder: cached/current batch spill; serialization and pre/post-write boundaries; uncommitted active-run discard; partial reader ownership; non-empty
nextRuns; later read failure; bounded reduction/result materialization chunks; pre-publication cancellation; and Reset/reuse. - Top: non-EOF spill entry; serialization and pre/post-write boundaries; the real 8,192 heap-pop checkpoint; spill read/materialization and pre-publication checks; and Reset/reuse.
- Q1/Q2/Q3: every partial file/batch owner reaches exactly one cleanup path, every reviewed cancellation path terminates at a bounded work-unit boundary, and no new retained state is unbounded.
Fresh local validation on this exact head passed:
- full ordinary and full
-racetests forpkg/sql/colexec,group,mergeorder, andtop; - 26 focused tests under
-race -count=100, plus the heavier Group reload/reuse test under-race -count=93; - full
./pkg/sql/colexec/...and./pkg/sql/compiletests; - package selection, subtree build, subtree vet, coverage, and
git diff --check.
Coverage was 63.2% for colexec, 80.6% for Group, 78.1% for MergeOrder, and 74.8% for Top; the new outputOneBatch path was 91.7% covered.
Remote CI at approval time has all completed checks passing. Ubuntu UT, SCA, coverage UT, Proxy BVT, and Pessimistic BVT are still pending, so CI readiness remains separate from this code approval.
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:request changes,但这次范围已经显著收敛。
基于最新 head 8a3a50d197b7f058db48ba5700fa834174a28e25 相对已刷新的 origin/main@6091b418fd529badca4e1855843bd38804de396f 再看一轮:上一轮我提的 Group/MergeGroup spill write、MergeOrder receiving->spill、Top spill write 这三类取消边界问题,这版基本都补上了;现在只剩 1 个 我仍认为会挡合的生产级取消缺口。
MergeOrder 的 spill reader rollover 仍然可能在取消后继续做下一批 spill I/O。
- 位置:
pkg/sql/colexec/mergeorder/spill.go:615-623、pkg/sql/colexec/mergeorder/types.go:390-419,以及调用它们的pkg/sql/colexec/mergeorder/spill.go:773-815/1046-1175 - 具体失败场景:当一个 spill run 里有 多个序列化 batch 时,某个 reader 正好把当前 batch 的最后一段 rows 复制完,取消在这之后、reader refill 之前到达。此时
advanceSpillReaderByChunk会立刻进reader.readNextBatch(...),而readNextBatch/readSpillBatches都没有任何CancelCheck。如果这次 refill 成功,外层 merge/send loop 也不是每次迭代都重新检查取消(只有rows >= nextSizeCheck时才检查),所以代码仍可能先把下一批 spill 数据读出来、反序列化出来,甚至继续复制一段新 batch 的 rows,然后才把context.Canceled抛上来。 - 为什么我认为这点还没被现有新测试覆盖到:新增 mergeorder 取消用例用的 helper
newCancellationTestSpillRun(...)还是单批 run(order_test.go:2158-2178里写死run.batchCount = 1),所以目前覆盖到的是 EOF/owner-transfer/chunk-boundary;没有命中“同一个 reader 成功切到下一批” 这个 refill 路径。 - 建议:在
advanceSpillReaderByChunk调reader.readNextBatch前补一次取消检查,并且最好把检查再下沉到readNextBatch/readSpillBatches(或至少在 refill 成功后、重新进入 copy loop 前再补一次),把 reader rollover 本身也变成硬边界;同时补一个 multi-batch spill run 的回归用例。
如果这里因为 GitHub 的 author self-review 限制而显示成 COMMENTED,请把这条结论按 request changes 理解;就 latest 这版而言,我现在只剩这个 blocker。
|
最新评论成立,已在最终 head 修复:
回归:
反省:上一轮把 64-row merge chunk boundary 与 serialized-reader rollover boundary 当成了可互相覆盖的取消层级;它们其实是两个独立的 work-unit 轴。更根本的问题是测试 helper 写死单 batch,把 最终验证:
新一轮远端 CI 已由 push 触发。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
结论:LGTM / approve。
基于最新 head 4ce82117ee174e5a65266289869488f9f54da429 相对 origin/main@6091b418fd529badca4e1855843bd38804de396f 再做了一轮 latest deep review:这版把上一轮剩下的 mergeorder spill-reader rollover 取消边界也补上了,readNextBatch 现在在 reader refill 前先观察取消,而且新增测试已经把 refill/read 这条路径补到了。
按 correctness、spill/cancel 控制路径、resource lifecycle、unhappy path 和功能闭环再扫一遍,这轮我没有再看到新的 merge-blocking correctness、cancellation、cleanup 或状态机问题。若不是作者自评限制,我这轮会直接给 APPROVE。
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
No findings. The final head closes the remaining MergeOrder reader-rollover gap with cancellation checks before refill and after synchronous read/unmarshal, while preserving single-owner cleanup. Prior Group, MergeGroup, MergeOrder, and Top cancellation, resource-lifecycle, and reuse concerns are addressed with focused regressions. Diff and formatting checks passed; local test execution was unavailable because the checkout lacks required MatrixOne native libraries and headers.
LeftHandCold
left a comment
There was a problem hiding this comment.
Deep-reviewed on exact head d074a9b0a544 against base 1f8cd465b827. The rebase preserved the reviewed change exactly (stable patch-id matches the pre-rebase head), with no semantic conflict-resolution delta.
Verified closure:
- Group/MergeGroup observe cancellation at EOF, spill wave/batch/bucket, reload-record, and streaming publication boundaries; partial bucket transfers keep a single cleanup owner.
- MergeOrder covers cached/current writes, pre/post I/O, active-run discard, partial reader ownership, multi-pass reduction, bounded materialization chunks, multi-batch reader rollover, and pre-publication cancellation.
- Top covers pre/post spill write, bounded heap/read materialization, cleanup of uncommitted output, and cancellation -> Reset -> fresh Prepare reuse.
- Q1/Q2/Q3: no leak/double-cleanup break, every reviewed cancellation path terminates after a bounded synchronous unit, and no new unbounded retained state. Added checks stay off per-row resident hot paths.
No blocking correctness, cancellation, lifecycle, performance, or compatibility issue found. The current-head CI rerun is still in progress; this approval is the code-review conclusion.
What changed
First-principles contract
Once the process context is canceled, an operator must not begin another expensive spill work unit or publish another result batch. A single synchronous marshal/write or serialized-batch read/unmarshal cannot be interrupted safely, so each is guarded before and after. Subsequent work is bounded to one Group bucket, one MergeOrder chunk (at most 256 rows), one serialized spill batch, or one Top batch write. Result ownership advances only after the publish-boundary cancellation check. Every partial resource has exactly one cleanup owner, and Reset fully terminates generation N before generation N+1 is prepared.
Validation
8a3a50d197and passes on4ce82117eenextRuns, multi-batch rollover, and chunk materialization; and Top pre/post write plus the 8,192-row heap-pop cancellation./pkg/sql/colexec/...and./pkg/sql/compilereadNextBatchis 100% covered and both new cancellation bodies executeGOWORK=offpackage selection, build, and vet pass for all four owning packages-race -count=100origin/main@6091b418fdFixes #26444
Fixes #26446
Fixes #26447
Related: #26563