Repository navigation
Fix Iceberg append memory pressure handling - #32523
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? |
|
Queue requested — the merge queue status continues in this comment ↓. |
|
pkg/iceberg/write/fanout_writer.go:310(WriteBatch):每行写入前后各调用一次 relieveMemoryPressure,只要 dml-max-memory>0(limited=true),即使预算远未吃紧,两个调用点每行也都各自执行一次 AvailableMemory,并遍历全部活跃写入器求和后才做阈值判断。宽分区批量导入下是 O(行数×活跃分区) 的额外开销(如 1e7 行×2000 分区 ≈ 4×10^10 次 map 访问),与是否存在内存压力无关,纯 CPU 代价可观。建议为 active 写入器维护增量 size 计数(写入/轮转时增减),或按块粒度(每次 flush 或每 N 行)检查一次预算,仅在可能越过阈值时才做 LRU 求和与轮转。 本操作由LW授权的MOI智能体提交 |
🛑 Queue command cancelledQueue requested — the merge queue status continues in this comment ↓. |
3375c46 to
6fa3f7f
Compare
🚫 Left the queue · pull request dequeued58 min in the queue, with no time running CI. So far
Reason Pull request #32523 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.
To get back in the queue
Tick the box to put this pull request back in the merge queue (same as
Times in UTC · dashboard · how the merge queue works |
…2326007675bfc89923208ead36cc6dca96e4109
What type of PR is this?
Which issue(s) this PR fixes:
issue #32514
What this PR does / why we need it:
Large Iceberg appends could exhaust the shared write memory budget even when the data could be written across multiple files. Rotate active partition writers under memory pressure while retaining hard budget admission, and preserve actionable memory-limit details across the DML error chain. Failed writes retain the existing cleanup and orphan ownership semantics.
Validation:
8074dfd0fbabe54b20958a3400bcf81fd9f0e7c1against based9190ff6d01d15d60acdfcdc9acd96f807a7ab6a. On this head, Iceberg writer and runtime package tests passed, including shared-budget, partition and factory cancellation cases; 32 focused Iceberg planner tests and five composite-index planner tests also passed.b0641dbf3cb1ed67f90f9e4226f0585ba451abc0: reproduced run 42983922855 attempt 1 failures locally (SCA nilness in fanout close handling; coverage policy forbidding bare error constructors in tests). Simplified the guarded close-error return and usedmoerrin both affected test fixtures. Five focused tests and all tests in./pkg/iceberg/api ./pkg/iceberg/write ./pkg/sql/icebergpassed viamo-cgo-test -count=1 -timeout=240s -cover; configured golangci-lint passed for api/dml/metadata/write/sql-iceberg (0 issues). These are new local Go 1.27.1 Darwin/arm64 checks; earlier integration evidence is reused because this repair preserves behavior.c549a60cdb18d5c5ba54e2007e0401f8d749717a: maintain the saturated sum of active writer sizes incrementally, removing the per-row full map scan while preserving pressure thresholds, LRU selection, cleanup and hard admission. Added accounting/error-boundary and E2E oracle tests, including negative controls and seed-failure cleanup/report finalization. All six related packages passed viamo-cgo-test -count=1 -timeout=240s -short -tags matrixone_test -coverprofile=...(api/dml/metadata/write/sql-iceberg/test-iceberg); final edited owners were retested. Configured lint passed for the six packages (0 issues).79c604b5c2c265427185271ab68629c9a464cbd0) reproduced the failed changed-block gate: 129/230 (56.09%). Applying that parser to new local package coverage gives 181/233 (77.68%, required >75%). This is local Darwin/arm64 Go 1.27.1 evidence, not a new Linux CI verdict.b0641dbf3cb1ed67f90f9e4226f0585ba451abc0, SCA, UT coverage tests and both Compose BVT jobs passed; the coverage merge gate failed as described above. Full repository Linux CI and the standard Docker integration path were not run locally. New CI remains pending delivery; Iceberg E2E Local was skipped.52e6709632323e57c25b22f7de2c29af15d57db1: rebased onto official main74ad90d47c83426604ab895a3faa09b7de3e6cbe. Preserved upstream Parquet compression/options and flush/failure tests alongside pressure/accounting tests; append creation retains both initial hard budget admission and Parquet option validation. No protocol capability or scope expansion.mo-cgo-test -count=1 -timeout=240s -short -tags matrixone_test -coverprofile=...; focused-racetests matchingTestFanout|TestAppendRuntime|TestBuffered|TestReplacementFanoutpassed in write/sql-iceberg. Configured six-package lint passed (0 issues), formatting/whitespace and delivery-artifact checks passed. The same CI parser reports 181/233 changed blocks covered (77.68%, required >75%). Raw profiles/logs remain outside source.c549a60cdb18d5c5ba54e2007e0401f8d749717acompleted run 43003052359 attempt 2 successfully, including UT and CI Required. Earlier public SQL/performance evidence remains historical: no fresh external-service E2E, full low-budget suite, topology or SQL-throughput measurement is claimed after the upstream codec change. New CI will run after this rebase is pushed.3375c46f815cbe1ac0e9fb36cbec3bf85ca76941: manually rebased onto official mainc8accd138bb91144050ff173100afd7a71a02888after Mergify check 130767038469 reported aworkflowspermission denial while updating the branch with main's Python SDK workflow change. All 16 PR patches are unchanged by range-diff; six owning package trees and module/native/lint inputs are byte-identical to head52e6709632323e57c25b22f7de2c29af15d57db1. A fresh dependency check excludes the newly changed planner package from those owning tests. Reuse the prior six-package/race/lint/77.68% coverage evidence and successful Actions attempt 2; no new runtime test is claimed. Formatting/whitespace and delivery-artifact checks passed. This changes no application permissions, protocol capability or product behavior; new CI remains pending the push.6fa3f7fb4095830d89db5df9ed3118e1ebde68f2rebases onto official main4cadd4f2f6ed9444d8bdbf6e13053b5ac741863c. The append runtime test retains both sides of the import conflict. The affected Iceberg fixtures now pass their existing memory pool to the upstreamvector.NewVecAPI and keep their existing assertions.mo-cgo-test -short -tags matrixone_test -count=1 -timeout=240sand coverage. The two changed packages also passed focused fanout, append runtime, buffered and replacement fanout race tests. Configured lint, diff checks and the delivery artifact check passed. The previously pinned CI parser calculated 181/233 (77.68%) changed blocks from the local profiles. External-service SQL E2E and Linux CI were outside this local run.