Repository navigation
fix(iceberg): reclaim unused append file metadata budget - #33646
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 ↓. |
|
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: 5db33ca4e5cfa84d7bb8e9ff0d236407c7dd5966
Assessment: request_changes
The change reduces retained append metadata and the focused budget and cancellation checks pass. A file-cardinality limit remains under the default budget, leaving the linked issue's size-independent append requirement unresolved. This is a pre-existing limitation that the PR improves, not a regression introduced by it.
Model: gpt-6.1-terra / max
Session: 01a2350e-851d-7031-94fc-615272373c71 · slot 2 · generation 20
- P2
pkg/sql/iceberg/dml_replacement_writer.go:130: Append 1,800 rows to an 18-column Iceberg table partitioned by a distinct identity value for each row, using the default 256 MiB budget and default fanout settings.
Impact: The append fails before commit because retained file-metadata reservations exhaust the budget, even though each partition contains only one row. Issue #32514 asks for default-budget appends of any size, so the reported 22-million-row, two-partition success does not close this distinct file-cardinality case.
Evidence: Each completed file retains at least 150,528 bytes before dynamic metadata. A coordinator-boundary probe with a fake object writer failed after 1,723 files at the default budget; a 10-partition control passed, and the same 1,800-row writer completed with a 512 MiB budget. See many-partitions-final.log and checks/1796199146859101906-3.json. The base retained a larger per-file reservation, so this remains an existing issue requirement. Handle file metadata and recovery information within the hard budget, or obtain a product-owner decision defining the supported file-count scope.
Validation:
-
Private /tmp and loopback preflight passed: preflight.log and checks/1796192887946208011-3.json.
-
Focused metadata settlement, rejection, rotation, and cancellation tests passed: focused-budget.log and checks/1796196591212359586-3.json.
-
The cancellation and orphan-recovery subtest passed 100 race-enabled repetitions: race-cancel.log and checks/1796196711132427828-3.json.
-
Both affected Iceberg packages passed their full race-enabled test runs: race-packages.log and checks/1796198080104814092-3.json.
-
The targeted capacity probe failed at the default budget while both controls passed: many-partitions-final.log and checks/1796199146859101906-3.json.
-
Native provenance and git diff --check passed: native-provenance-local.log with checks/1796196329279051618-4.json, and diff-check.log with checks/1796198189393823676-3.json.
-
The review plan and discussion assessment exist in the diagnostic directory; all three discussion_index keys are covered exactly once.
Limitations:
-
The capacity probe exercises the runtime coordinator with a fake object writer; it is not an end-to-end SQL or object-store run.
-
The author's reported 22-million-row Darwin/MinIO/Nessie run was not independently repeated, and the supplied local_validation list has no matching retained run.
-
The default Go proxy failed during toolchain bootstrap; the alternate proxy succeeded and subsequent tests used Go 1.27.1.
-
All relative log and receipt paths are under /mnt/nvme/mo-bot-55-live/state/jobs/20e0af71b46947f3180b6d6e/attempt-1.
|
The 1,800-partition coordinator probe identifies a real file-count limit. The exact base and head use the same 256 MiB limit and retain a descriptor for every successfully uploaded file until commit or abort. The base charges 740,352 bytes per file for this 18-column, one-partition-field schema. That charge alone would exhaust the budget by the 363rd file. The reviewed head settles each published file to a 150,528-byte structural charge plus dynamic metadata, which is consistent with the later failure observed in the probe. Base reservation · Head settlement The “any size” sentence in #32514 specifies the default-budget problem in terms of data volume and file rotation for one or two partitions. Its QA follow-up defines the remaining acceptance case as a single 22-million-row, 18-column, two-partition append, with failed-write atomicity and orphan recovery. The review probe adds a different requirement: support a growing number of one-row partition files within the same hard budget. Under the PR scope rule for existing limitations and additional functionality, that requirement belongs in separate work on bounded commit metadata and recovery state. The high-file-count limit remains unresolved. Original issue · QA acceptance · 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: 5db33ca4e5cfa84d7bb8e9ff0d236407c7dd5966
Assessment: approve
The new discussion changes the prior assessment. The 1,800-file default-budget limit is real and remains unresolved, but it predates this change. The author has scoped this PR to reducing retained metadata for the reported large append; the linked QA case specifies a 22-million-row, two-partition workload. No independent contract was identified that makes bounded metadata for the separate high-file-count case a merge requirement for this scoped fix. The existing budget and recovery owners are reused.
Model: gpt-6.1-terra / max
Session: 01a23504-137d-7f93-9b91-fd29f7f60fa2 · slot 1 · generation 42
Validation:
-
Reused exact-head focused settlement, rejection, rotation, and cancellation checks: prior job 20e0af71b46947f3180b6d6e, checks/1796196591212359586-3.json and focused-budget.log.
-
Reused 100 race-enabled cancellation repetitions and full race runs for both affected Iceberg packages: checks/1796196711132427828-3.json and checks/1796198080104814092-3.json, with matching logs in the prior job.
-
Reconciled the prior high-file-count probe and its passing controls with checks/1796199146859101906-3.json and many-partitions-final.log. The latest target advance contains no changes under either affected Iceberg package.
-
The author reports a successful 22-million-row single-CN append with MinIO and Nessie, plus low-budget failure and recovery checks.
Limitations:
-
The original issue’s “any size” wording is broader than the demonstrated workload. This assessment does not establish unlimited file-count support or decide whether the issue should be closed.
-
The author’s 22-million-row deployment run was not independently repeated, and its raw execution artifacts were not supplied.
…c127ef3e8a0fc65d0091001d55c649c49458789
🚫 Left the queue · pull request manually updatedLess than a minute in the queue, with no time running CI. So far
Reason The pull request #33646 has been manually updated Merge conditions not met when it left the queue
Tick the box to put this pull request back in the merge queue (same as
2 merge conditions met
Times in UTC · dashboard · how the merge queue works |
What type of PR is this?
Which issue(s) this PR fixes:
What this PR does / why we need it:
#32523 preserved actionable Iceberg budget errors and constrained active writer peaks by rotating files under pressure. Closed Parquet files still retained their worst-case column statistics reservation until commit. Those reservations accumulated and caused a single 22 million-row append into an 18-column table to exceed the default 256 MiB budget.
Once a nonempty append file has uploaded successfully, charge its frozen metadata and release the unused reservation. Keep the active writer, upload buffers, and manifest construction subject to the shared hard budget. The adjustment examines column and partition metadata once per file and reduces the charge retained across file rotations.
Validation on this PR
Historical QA and pending CI
The previous Linux QA run with an 8 GiB memory+swap cap reproduced the original 22 million-row failure twice. This PR's scale results cover the local single-CN deployment. Repository CI results are pending.