Repository navigation
fix(spill): retain cleanup ownership across removal errors - #30099
Ariznawlll wants to merge 57 commits into
Conversation
Retry transient file removal for JOIN and GROUP spill. Preserve failed bucket and writer ownership for later cleanup, and propagate JOIN cleanup errors. Cover normal, transient, and persistent failure paths with focused tests.
fengttt
left a comment
There was a problem hiding this comment.
This seems to the the wrong fix.
Spill should spill to local disk, and local file clean up should always be open, immediately delete, until close. If we want to rotate file descriptor, we add delete in the operator close time. spill clean up should not be a queue/backgroup job etc.
We do not support/use spill to remote or S3 yet. Even when spilling to S3, should be cleaned up by operator close.
The exception could be a mo-service is CRASHED/KILLED (if we rotate file descriptor). In this case, there should be a "delete all temp spill files" when CN restarts. That is it ...
queue for delete of temp file is an fragile, over design.
Resolve HashBuild Prepare conflict by retaining direct-input validation before prior-generation spill cleanup. Cover valid and invalid direct-input configurations alongside failed removal ownership.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Incremental review of exact head 505a1abb7acbf46080511512ca17c135638edc1f (base 9f873692e0efa869c64c4d1c84e212c5a8a3272a). The new commit changes only docs/design/spill_cleanup_owner_v1.md; it clearly records that revision 3 is a design-only response and that approval is still pending. It also explicitly says the existing #30099/#30102 implementation is not certified by this document.
The prior design gate therefore remains unresolved: the decision table still marks the process-wide capacity/tenant blast radius, four-worker/hung-I/O behavior, in-process service/root reuse, fail-closed startup/rollback, and observability/rollout as requiring owner decisions before approval. This update documents the alternative local-lifecycle direction, but it does not implement that replacement or approve the existing queue-based code in this PR. Keeping the existing CHANGES_REQUESTED gate is appropriate; this COMMENT records review of the new revision only.
Validation boundary: I inspected the exact-head commit and design text. This workspace has no MatrixOne checkout or Go toolchain, so I did not run local Go or runtime tests. The visible checks are Connector/J Pool Reset E2E (in progress) and Iceberg Connector E2E (success); neither is spill-cleanup validation. No issue changes made; related issue #30097 remains open and assigned to Ariznawlll.
|
已根据 fengttt 的反馈更新并正常推送设计响应 505a1ab:revision 3。旧 revision 2 的后台删除队列、全局 16,384-file admission 和四 worker 已明确列为被替代的提案,不再作为推荐交付方向。 替代范围收敛到本地 open → unlink → 持有 FD → close,以及必要的具名文件 operator-close 和进程退出后启动清扫。文档列出 creation/unlink 失败、pathname reopen/FD rotation、root/service replacement、错误/取消/拒绝 handoff/Reset/Free/pool release 的具体待审闭环和最小确定性验证。建议以 #30099 为最终统一实现载体,保留 #30102 不重复的 JOIN/HashBuild 反例。 本轮仅同步文档及 PR 状态,两个分支文档完全一致,UTF-8/LF 和 diff checks 通过。替代实现尚未交付、设计尚未通过,原实现 CR 保留;旧队列的 UT/CI 不作为替代方案通过证据。没有合并或关闭 PR。 |
|
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: 505a1abb7acbf46080511512ca17c135638edc1f
Assessment: request_changes
The design gate remains open. Revision 3 supersedes the background cleanup queue, but the complete PR still delivers that implementation. Retaining spill-file ownership is necessary; the replacement lifetime and failure contracts must be settled before implementation approval.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
docs/design/spill_cleanup_owner_v1.md:52: Merging this candidate includes the superseded queue implementation, although revision 3 explicitly says replacement design approval is pending.
Impact: The PR introduces process-wide admission and cleanup ownership across GROUP, HashBuild and JOIN without an accepted delivery design. Close the replacement's unlink-failure, pathname/FD-rotation and service/scratch-root lifecycle decisions, obtain design approval, then align the implementation and its validation with that design.
Evidence: Document lines 3–5 and 18–21 supersede the queue approach; lines 33–43 leave replacement failure and lifecycle decisions pending. Nevertheless, pkg/common/spillcleanup/queue.go retains the 16,384-file cap, four workers and global terminal queue (lines 29–34 and 101–112), and production spill owners still enqueue cleanup callbacks. Frozen maintainer review 5567086544 rejects background deletion; the supplied evidence contains no subsequent replacement-design approval. This is a demonstrated design-contract failure, not an allegation of an observed runtime failure.
Validation:
-
Static check passed: check-run --timeout 60 -- python3 audit_scope.py verified the exact head/base, clean source, supplied patch correspondence, diff whitespace, all 33 changed files and seven documented test anchors. Command/source/exit receipt: /home/xupeng/.local/state/mo-bot/jobs/a98c1c3174b0ef7a14157bb4/attempt-1/checks/1792771165590739152-4.json; matching retained output: scope-audit.log and scope-audit.json in the same attempt directory.
-
The frozen exact-head CI snapshot reports successful UT, SCA, coverage, shared-build, multi-CN BVT and CI Required checks. Historical coverage failures were not carried forward.
-
Static reconciliation found corresponding repairs for earlier GROUP discarded-bucket/retained-operator ownership and JOIN scatter-cleanup concerns. Detailed evidence is retained in review-audit.json.
Limitations:
-
Exhaustive implementation, test-quality and runtime approval is deferred at the design gate. The applicable mo-self-review skill states: “An upstream design/range/artifact blocker may stop downstream review.” Skill: /home/xupeng/.local/state/mo-bot/slots/0/source/.agents/skills/mo-self-review/SKILL.md.
-
No local Go/native tests or performance measurements were run. local_validation is empty; raw CI execution logs and separate linked-issue bodies were not supplied. CI statuses and source reconciliation are not claimed as independent runtime verification.
Replace the superseded retry design with anonymous unlink-before-publish, synchronous named cleanup, sticky root exclusion and terminal disk abandonment. Preserve distinct GROUP and JOIN/HashBuild ownership oracles in focused regressions. Revision 4 was explicitly approved by the task owner. This is a local implementation checkpoint: final post-edit race/static validation and push remain blocked by insufficient local disk space, as recorded in the verification document.
|
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: 8980d414396686842035ac0bd38bc9c1a16be161
Assessment: approve
The approved synchronous cleanup and restart-only recovery design addresses the prior ownership, accounting, and retention concerns. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a1869d-820c-7212-9788-aecfb86a4141 · slot 0 · generation 2
Validation:
-
Reviewed the complete delta, linked issues, and all 21 discussion entries; saved review-plan.md and discussion-assessment.json.
-
Focused Linux normal and race checks passed across 11 packages: 152 passing test events per mode, without skips.
-
Six concurrency and lease tests each passed 100 race-instrumented repetitions.
-
Reused supplied successful build, UT, coverage, static-analysis, and multi-CN BVT results.
-
validation-summary.json matches retained logs to successful receipts, verifies native inputs, and confirms the frozen source is unchanged.
Limitations:
-
No local whole-CN crash/restart, SQL fault-injection, or performance campaign was run.
-
Raw CI and author-reported Darwin validation logs were not available for independent inspection.
结论本轮本地测试通过。已正常推送 关键证据
待解决点推送触发的自动 CI 正在运行,尚未声明全部通过;仍需相关 reviewer 复审原有 CHANGES_REQUESTED。真实 SQL/BVT、Linux 运行时、整 CN 故障/重启恢复与性能验收未在本机执行。本轮未手动触发 CI、部署或共享环境测试,未 force push、合并/关闭 PR、approve、dismiss review 或解决评论线程。 |
|
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: f25faa6e0120fa517299e35f1cf2f530e49af955
Assessment: approve
The approved synchronous lifecycle reuses existing cleanup owners and accounting. Root fencing, leases and terminal abandonment preserve exclusive ownership and truthful disk charges without a retry queue. Historical concerns are closed; no actionable defect remains.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 38 changed files, affected callers, four linked issues and all 24 discussion entries; saved the review plan and discussion assessment.
-
Verified the revision-4 design artifact matches its recorded approval.
-
Runtime preflight passed. Source-extracted probes passed five roots in normal and race modes; two concurrency roots passed 100 race repetitions each, with zero failures or skips.
-
All 35 changed Go files passed syntax/format checks; git diff --check passed.
-
Reused supplied exact-head successful build, UT, SCA, coverage, proxy and multi-CN BVT statuses.
-
Reconciled receipts, logs and source provenance in validation-audit.json. The frozen checkout remains clean.
Limitations:
-
Local MatrixOne package tests did not run because compatible native prerequisites were missing; Go 1.27.1 bootstrap also timed out. Local probes used Go 1.26.6 with documented adapters.
-
CI and author evidence lacked raw logs. No local SQL fault-injection, whole-CN restart or performance run is claimed.
|
Tick the box to add this pull request to the merge queue (same as
|
aunjgr
left a comment
There was a problem hiding this comment.
Re-review of 62128360b4942dfaa62bcf59a29cd5a7050b8cf7.
The original cleanup-owner design objection is resolved. Revision 4 has an exact-artifact approval record and the implementation replaces the process-wide retry queue with synchronous terminal-owner cleanup, sticky root fencing and exclusive startup leases. Named-file rotation is retained; unsuccessful removal does not refund surviving disk bytes or retain ended queries/callbacks.
Checked Q1 ownership, Q2 admission/control-path independence, and Q3 retained-state bounds. The accepted design does not promise an OS unlink deadline. No remaining code blocker found.
Evidence scope: I code-reviewed this head and the corresponding #30102 integration. Their common spill-owner code matches, but their complete trees differ. I reused source-qualified prior author evidence; the supplementary Linux component/race checks were executed on #30102 at 080249f, not independently on this SHA. No fresh whole-CN restart, SQL/BVT, performance acceptance or current-head CI pass is claimed.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30097. Fixes #30098. Fixes #30100. Fixes #30103.
What this PR does / why we need it:
Consolidated candidate for #30099 and #30102. Both branches carry the same implementation, including the distinct JOIN/HashBuild regression oracles; they are not independent fixes.
Anonymous spill descriptors are published only after successful unlink. Named GROUP/HashBuild/JOIN files keep FD rotation and are deleted synchronously by their terminal owner. A removal failure fences further spill creation for that root and preserves conservative disk charges without retaining ended queries or background retry callbacks. Recovery requires old owners to stop, successful startup cleanup and a fresh CN process.
The directing user approved design revision 4; the approval record identifies the exact artifact and availability tradeoff. This is not an assertion of approval by GitHub maintainers; the prior reviews remain for human re-review.
Updated to main
9e29011e7313a57962adc00963baa659d1e81e37without rewriting history. Follow-up0fc9b99adf:moerrconstructors while preserving distinct error sentinels and cleanup causes; retain main's index-cache shutdown alongside spill-root shutdown.Validation
Local Darwin/arm64, Go 1.27.1, repository-controlled native build and provenance with verified pinned dependencies:
go vet,make err-check, gofmt and diff checks pass. Configured incremental SCA completes with Go 1.27.1-built pinned tools; golangci-lint v2.14.0 reports 0 issues under the unchanged repository configuration. Molint emits non-failing diagnostics in two unchanged main files (disk_cache_async.go,window.go).Limits
No Linux runtime, whole-CN restart, SQL/BVT, shared-cluster/production fault injection or performance acceptance was run locally. Private lease tests do not certify whole-CN recovery. Push-triggered CI is separate from local evidence; no workflow was manually dispatched, and pending or skipped checks are not claimed as passes.