Repository navigation
Bound the metadata-log of Iceberg tables on write - #128702
Conversation
Every commit into an Iceberg table appended an entry to `metadata-log` and nothing ever removed one, so long-lived tables accumulated tens of thousands of entries and multi-megabyte `metadata.json` files that every query has to read and parse. A write now keeps at most `write.metadata.previous-versions-max` entries, like the Java implementation, and drops the oldest ones first. When the table does not set the property, the new setting `iceberg_metadata_previous_versions_max` (default 100, the default of the property) is used. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [77cc9e1] Summary: ❌
AI ReviewSummaryThe PR bounds the Iceberg Missing context / blind spots
Findings
|
…tor.cpp` CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=128702&sha=9c0cce9d73fd1c6b8c9920040d51e524150136c7&name_0=PR&name_1=Build%20%28arm_tidy%2C%201%2F4%29 PR: #128702 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes10 object files changed (+40.26 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units59 translation units recompiled, 452 s compile time in total, 59 of them have a recent master baseline. |
…g-limit # Conflicts: # src/Storages/ObjectStorage/DataLakes/Iceberg/Compaction.cpp # src/Storages/ObjectStorage/DataLakes/Iceberg/MetadataGenerator.cpp
- Keep `iceberg_metadata_previous_versions_max` previous metadata files in `metadata-log` in addition to the entry of the file being written, so a limit of one still references the previous file. - Trim the log in place when a single entry is over the limit instead of rebuilding the array on every commit. - Append to and bound the log in `ALTER` schema changes and `expire_snapshots`, which previously bypassed it. - Carry the table properties, including `write.metadata.previous-versions-max`, through the metadata rebuilt by full compaction. - Document that the setting has no effect on catalogs that write the metadata files themselves, such as a REST catalog. #128702 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ms` of `ALTER` - With an older `compatibility` the setting `iceberg_metadata_previous_versions_max` is `18446744073709551615`, and adding one for the entry being written wrapped the limit to zero, so every write removed the whole `metadata-log`. Compare the number of previous versions against the limit instead. - Schema changes appended a `metadata-log` entry with the current time but kept the old `last-updated-ms`, which Iceberg Java rejects with `Invalid update timestamp`. Advance `last-updated-ms` to the commit timestamp. #128702 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ttings history Master is now 26.12, so the style check `settings_changes_history` requires the record of the new setting under that version. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=128702&sha=cfbf28ba63c574356561d126431e13c72fa01a09&name_0=PR&name_1=Style%20check PR: #128702 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-log` entries The setting is now the maximum number of entries that a write keeps in the `metadata-log`, including the entry of the metadata file it writes, so a value of N leaves exactly N entries. Before, it was the number of previous versions, and the log kept one entry more. The table property `write.metadata.previous-versions-max` keeps the meaning of the Java implementation: the number of previous metadata files, at least one, so the log keeps one entry more than its value. #128702 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Introduce a setting that can limit metadata-log field. It will prevent increasing size of the metadata file
Workflow [PR]
Sync PR [sync-upstream/pr/128702]
Version info
26.12.1.317-master(included in26.12and later)