Repository navigation
Serialize iceberg metadata log content lazily - #110437
alexey-milovidov merged 23 commits into
Conversation
insertRowToLogTable took the content as an eagerly built String, so every call site serialized to JSON even when iceberg_metadata_log_level (default none) discarded the row. Related: ClickHouse#105823 Related: ClickHouse#104169
|
Workflow [PR], commit [feaf306] Summary: ✅
AI ReviewSummaryThis PR makes Iceberg metadata-log serialization lazy with respect to Findings
Final VerdictNeeds changes before merge: the performance test cleanup path is still broken for failed runs. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 33/44 (75.00%) · Uncovered code |
There was a problem hiding this comment.
Am I right that the reason in this if statement?
There was a problem hiding this comment.
Yes, in the other approach, this check was added to every call site, which seemed worse than keeping it here.
There was a problem hiding this comment.
Pull request overview
This PR optimizes Iceberg metadata logging by making the metadata payload generation lazy, so expensive JSON serialization is only performed when iceberg_metadata_log_level actually admits the requested log row level.
Changes:
- Updated
insertRowToLogTableto accept a callable that produces the metadata content string, and only invoke it after the log-level check passes. - Updated all Iceberg call sites to pass lambdas instead of eagerly-built strings.
- Added a performance test intended to exercise manifest entry processing overhead.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/performance/iceberg_manifest_entries.xml | Adds a performance benchmark for Iceberg manifest entry processing. |
| src/Storages/ObjectStorage/DataLakes/Iceberg/StatelessMetadataFileGetter.cpp | Switches metadata-log insertion to lazy payload generation for manifest list metadata and entries. |
| src/Storages/ObjectStorage/DataLakes/Iceberg/ManifestFileIterator.cpp | Switches metadata-log insertion to lazy payload generation for manifest file metadata and entries. |
| src/Storages/ObjectStorage/DataLakes/Iceberg/IcebergMetadata.cpp | Switches metadata-log insertion to lazy payload generation for overall Iceberg metadata. |
| src/Interpreters/IcebergMetadataLog.h | Changes insertRowToLogTable API to accept a callable (lazy content). |
| src/Interpreters/IcebergMetadataLog.cpp | Implements lazy content evaluation after log-level gating. |
No performance test exercised the Iceberg metadata path before. The test creates a local Iceberg table whose single snapshot has 100000 manifest entries (one row per data file) and measures a query whose filter matches nothing, so planning over manifest entries dominates. Locally, the measured query takes ~27ms with lazily serialized log content versus ~1.2s when every entry is serialized to JSON, which is what happened eagerly before insertRowToLogTable took a closure. Co-Authored-By: Claude Fable 5 <[email protected]>
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
|
👋 Hey @scanhex12! I see this was added and then removed from the merge queue. Is there anything else we're waiting for on this? Was it just because of the test flake that we're holding this? |
|
@scanhex12 bump on this |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 33/44 (75.00%) · Uncovered code |
|
@scanhex12 looks like we finally got a green build |
21c106a
Backport #110437 to 26.7: Serialize iceberg metadata log content lazily
Backport #110437 to 26.6: Serialize iceberg metadata log content lazily
Backport #110437 to 26.3: Serialize iceberg metadata log content lazily
Alternative approach to #105823, where instead of hoisting this check to each call site, have callers provide a function to get the row if it passes the level check. This prevents callers from inadvertently regressing here if they miss adding this level check.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Avoid eager JSON serialization of Iceberg manifest entries when iceberg_metadata_log_level is below the call site's threshold.
Version info
26.7.7.7,26.6.5.21,26.3.33.40