Repository navigation
Iceberg manifest files compaction - #98178
Conversation
|
Workflow [PR], commit [4166c57] Summary: ✅
AI ReviewSummaryThis PR adds experimental Missing context / blind spots
Findings❌ Blockers
Final VerdictChanges are not ready to merge. The manifest-only rewrite still has a live partition-summary gap, and the new catalog failure path can expose an uncommitted snapshot to some readers. |
…e used with manifest option
|
Your PR was poisoned by the test |
| { | ||
| auto catalog_filename = path_resolver.resolveForCatalog(generated_metadata_info.path); | ||
| const auto & [namespace_name, table_name] = DataLake::parseTableName(table_id.getTableName()); | ||
| if (!catalog->updateMetadata(namespace_name, table_name, catalog_filename, new_snapshot.snapshot)) |
There was a problem hiding this comment.
writeMetadataFileAndVersionHint can already publish the new metadata/vN...json and update version-hint.text before this catalog step runs, but the cleanup lambda above only deletes the rewritten manifest files and the new manifest list. For a non-transactional catalog like Glue, if updateMetadata throws or returns false here, direct path readers can advance to the new replace snapshot while the catalog still points at the old one.
That breaks the atomic "commit or no-op" contract for OPTIMIZE TABLE ... MANIFEST. Please either defer the version-hint update until after the catalog pointer succeeds, or extend cleanup to remove the new metadata file and restore the previous hint on catalog failure.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 273/869 (31.42%) · Uncovered code |
…anifest_files Iceberg manifest files compaction
…talya_26_6 Antalya 26.6: Backport of ClickHouse#98178 Iceberg compaction using optimize
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support iceberg manifest file compaction resolves #95174
Documentation entry for user-facing changes
Note
Medium Risk
Adds a new OPTIMIZE code path that rewrites Iceberg metadata/manifest files in object storage, so failures could impact table snapshot consistency if edge cases aren’t handled. Guarded behind
allow_experimental_iceberg_compactionand a new threshold setting to reduce unintended runs.Overview
Adds
OPTIMIZE TABLE ... MANIFESTto trigger manifest-only compaction for Iceberg tables, including parser/AST support, interpreter validation (disallowingFINAL/PARTITION/DEDUPLICATE/CLEANUP), and a newIStorage::optimizeManifestFiles()virtual wired throughStorageObjectStorageto Iceberg metadata.Implements Iceberg manifest consolidation by reading the current (HEAD) snapshot, regrouping live data files by partition, writing per-partition consolidated manifest files plus a new manifest list/metadata and updating the version hint; compaction is skipped when below a new setting threshold
iceberg_manifest_min_count_to_compact(default30). Adds integration tests covering correctness, time-travel, no-op behavior, and option incompatibility errors.Written by Cursor Bugbot for commit 7df98d3. This will update automatically on new commits. Configure here.
Version info
26.7.1.1025(included in26.7and later)