Skip to content

Respect iceberg_metadata_staleness_ms in metadata parsing - #124113

Merged
scanhex12 merged 1 commit into
masterfrom
iceberg-persistent-components-respect-staleness
Oct 6, 2026
Merged

scanhex12 merged 1 commit into
masterfrom
iceberg-persistent-components-respect-staleness

Conversation

@scanhex12

@scanhex12 scanhex12 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Respect iceberg_metadata_staleness_ms in metadata parsing


Workflow [PR]
Sync PR [sync-upstream/pr/124113]

Version info

  • Merged into: 26.10.1.1630-master (included in 26.10 and later)
  • Backported to: 26.9.12.6, 26.8.19.8, 26.7.23.8

…zePersistentTableComponents`

`initializePersistentTableComponents` always forced fetching the latest metadata file,
so every query through an Iceberg table function (and every `createWithDeserialization`
on cluster workers) listed the whole `metadata/` directory even when
`iceberg_metadata_staleness_ms` allowed using the cached latest version. The listing
is paginated by 1000 keys and includes manifests and manifest lists, so on tables with
many objects it turns into dozens of sequential S3 `LIST` requests.

The persistent components (format version, location, table UUID, compression method)
do not depend on the current snapshot, and the snapshot itself is resolved by
`getRelevantState`, which already respects the staleness setting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [537ce95]

Summary: ✅


AI Review

Summary

This PR makes IcebergMetadata::initializePersistentTableComponents honor iceberg_metadata_staleness_ms instead of unconditionally forcing a latest-metadata lookup, so repeated Iceberg table-function and deserialized worker opens can reuse a fresh cached metadata pointer and avoid redundant metadata/ listings. The change is narrow, the added stateless regression test checks the intended stale-vs-fresh S3ListObjects behavior directly, and I did not find a remaining correctness or consistency issue in the current code.

Final Verdict
  • Status: ✅ Approve

LLVM Coverage Report

⚠️ No coverage measurement for commit 537ce95: incomplete coverage measurement: 1 of 21 shard profiles are missing: LLVM_COVERAGE_FILE_it_8.profdata.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Oct 6, 2026
@scanhex12 scanhex12 added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Oct 6, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. label Oct 6, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 537ce95fe with master a2e4282a1 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

7 translation units recompiled, 25 s compile time in total, 7 of them have a recent master baseline.

Job report

@scanhex12
scanhex12 added this pull request to the merge queue Oct 6, 2026
Merged via the queue into master with commit 59c4d18 Oct 6, 2026
294 of 295 checks passed
@scanhex12
scanhex12 deleted the iceberg-persistent-components-respect-staleness branch October 6, 2026 07:17
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 6, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 6, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 6, 2026
Backport #124113 to 26.9: Respect `iceberg_metadata_staleness_ms` in metadata parsing
clickhouse-gh Bot added a commit that referenced this pull request Oct 6, 2026
Backport #124113 to 26.8: Respect `iceberg_metadata_staleness_ms` in metadata parsing
clickhouse-gh Bot added a commit that referenced this pull request Oct 6, 2026
Backport #124113 to 26.7: Respect `iceberg_metadata_staleness_ms` in metadata parsing
strtgbb pushed a commit to Altinity/ClickHouse that referenced this pull request Oct 6, 2026
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 9, 2026
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Oct 9, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Oct 16, 2026
@clickhouse-gh clickhouse-gh Bot added comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... and removed comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-iceberg Apache Iceberg tables: reading and writing Iceberg metadata (snapshots, manifests, schema evoluti... pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants