Skip to content

Antalya 26.8, backport of #124883: read a 64 KiB Parquet footer tail for local files - #2949

Open
ianton-ru wants to merge 4 commits into
antalya-26.8from
backport/antalya-26.8/124883
Open

ianton-ru wants to merge 4 commits into
antalya-26.8from
backport/antalya-26.8/124883

Conversation

@ianton-ru

@ianton-ru ianton-ru commented Nov 23, 2026 •

Copy link
Copy Markdown

Backport of ClickHouse#124883 to antalya-26.8. It is a prerequisite for the Parquet footer-size hint and the reuse of the footer tail, which are split out of #2181 into a separate pull request that goes on top of this one.

antalya-26.8 already reads a footer tail sized to the file (1%, clamped to [128 KiB, 2 MiB]), from the backport of ClickHouse#115686. That saves a round trip on object storage. For a local file a second read is cheap, and the larger tail only costs bytes on every open.

With this change Prefetcher records ReadBufferFromFileBase::isRegularLocalFile, and Reader::readFileMetaData reads a 64 KiB tail when input_format_parquet_footer_read_size is 0 and the file is a regular local file. Object storage, URL and HDFS reads, and an explicit non-zero setting, are unchanged. Upstream measured SELECT count() over 100 ClickBench Parquet files at 6.55 MB of footer tails instead of 140.7 MB.

It is a cherry-pick of two commits of that pull request: 5a58f229ecb0 (the change and the test) and 6fbb4e7e880b (the precise wording of the setting description and of the history reason). Compared with upstream, the history row of input_format_parquet_footer_read_size is in SettingsChangesHistory.cpp on 26.8 instead of inline in FormatFactorySettings.h, so the reason text is changed there, and the test is the 26.8 05385_parquet_footer_read_size instead of 05025_....

Tests: 05385_parquet_footer_read_size now checks that a default read of a local file reads the same number of bytes (65536) as an explicit input_format_parquet_footer_read_size = 65536. It fails on the base binary (131072 for the default) and passes with the change. All 204 stateless tests with parquet in the name pass, as do 03999_stateless_settings_history, 02326_settings_changes_system_table and 04652_system_documentation_settings_history after the second commit. This was run in the Praktika functional job on a local aarch64 build; PR CI has not run yet.

Related: ClickHouse#124883
Related: #2181

Changelog category (leave one):

  • Performance Improvement

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

Reading Parquet files from the local filesystem fetches a 64 KiB footer tail by default instead of a tail sized to the file, which cuts the bytes read when opening many files (ClickHouse#124883 by @groeneai )

Documentation entry for user-facing changes

The description of input_format_parquet_footer_read_size now states the default for local files.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

The adaptive footer read (`clamp(file_size / 100, 128 KiB, 2 MiB)`, backported from 115686) saves a round trip on object storage, but for a local file a second read is cheap and the larger tail only costs bytes on every open. `Prefetcher` now records `ReadBufferFromFileBase::isRegularLocalFile`, and `Reader::readFileMetaData` reads 64 KiB when `input_format_parquet_footer_read_size` is 0 and the file is a regular local file. Other sources and an explicit non-zero setting are unchanged.

Cherry-picked from 5a58f22; the setting description and the test follow the 26.8 layout (`05385_parquet_footer_read_size`).

ClickHouse#124883
Related: ClickHouse#124673
Related: #2181
@ianton-ru
ianton-ru marked this pull request as draft November 23, 2026 16:06
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [93dcb8f]

@ianton-ru ianton-ru changed the title Backport: read a 64 KiB Parquet footer tail for local files Antalya 26.8, backport of #124883: read a 64 KiB Parquet footer tail for local files Nov 23, 2026
…m master.

The setting description of `input_format_parquet_footer_read_size` now says the 64 KiB tail applies when the file is read directly from the local filesystem (the reader's buffer reports `isRegularLocalFile`). Reads through a file descriptor or a wrapping buffer keep the adaptive size. The `SettingsChangesHistory` reason no longer says that `0` keeps the adaptive behavior.

Cherry-picked from 6fbb4e7; on 26.8 the history reason is in `SettingsChangesHistory.cpp`, so it is changed there.

ClickHouse#124883
Related: #2181
@zvonand

zvonand commented Nov 26, 2026

Copy link
Copy Markdown
Member

@blau-ai

@blau-ai

blau-ai commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

CI analysis for head b5cd583

Verdict: none of the failures are caused by this PR. There are 5 failing check groups: 0 caused by the PR, 2 pre-existing, 1 flaky (the job timed out), 1 process (DCO). The main praktika suite (result_pr.json) is all OK: every build, stateless, integration, stress, fuzzer and unit test job that ran passed. That includes the new/updated 05385_parquet_footer_read_size.

Check Classification Caused by this PR?
RegressionTestsRelease / Swarms Pre-existing: same 3 scenarios fail on antalya-26.8 No
RegressionTestsRelease / Iceberg (2) Flaky/infra: timed out on rerun; passed on attempt 1 with the same SHA No
Grype Scan (keeper, server-alpine) Pre-existing: image CVEs, fails on base too No
DCO Process: commits have no Signed-off-by No (no code involved)

1. Swarms: pre-existing

✘ 1m 51s    [  Fail  ] /swarms/feature/node failure/check restart swarm node
✘ 5m 3s     [  Fail  ] /swarms/feature/node failure/cpu overload
✘ 5m 7s     [  Fail  ] /swarms/feature/node failure/cpu overload all swarm nodes
  File ".../swarms/tests/node_failure.py", line 108, in run_long_query
    assert result.exitcode in expected_exitcodes, error(

The same three node failure scenarios fail in the antalya-26.8 MasterCI nightly runs for 2026-11-25 (base has one more failure on top) and 2026-11-24. They also failed on attempt 1 of this PR's run. These tests kill or overload swarm nodes and check the exit codes. They don't read Parquet footers, and the PR only changes the footer read size for local files.
Next step: nothing to do on this PR.

2. Iceberg (2): job timeout on rerun, flaky/infra

Job (run attempt 2): the suite started at 22:33, printed no failures (it runs with --output new-fails), and was cancelled by the 210-minute job timeout:

2026-11-26T01:58:40Z ##[error]The operation was canceled.

Evidence it's not the PR:

  • On attempt 1 of the same run (same SHA b5cd583), Iceberg (2) passed in 1h53m. The commit status Regression release iceberg_2 is green with 1923 scenarios (1851 ok, 53 skipped, 19 xfail).
  • On other antalya-26.8 PRs the same evening, Iceberg (2) took between 1h45m and 2h20m and passed.
  • Iceberg tests read mostly from MinIO/S3/Glue. For those sources the PR leaves the footer read unchanged. It only switches regular local files from the adaptive size to 64 KiB, and the second footer read path that this can trigger is already covered by 05385.

Next step: safe to re-run the job.

3. Grype scans (keeper and server -alpine): pre-existing

Both images report the same 5 High CVEs: CVE-2026-107493, CVE-2026-107494, CVE-2026-121482, CVE-2026-124709, CVE-2026-84786. Both Grype jobs also fail in the antalya-26.8 nightlies (2026-11-24 and 2026-11-25) and on other open PRs (for example run 45692500834). The CVEs come from the image's base layers, and this PR doesn't touch Docker or dependencies.
Next step: nothing to do on this PR. The fix is an image or base-layer update on the release branch.

4. DCO: process

Neither commit (068bf8422e, 131e924cb5) has a Signed-off-by: trailer, which is what the DCO app checks. It has nothing to do with the code. If DCO is enforced for this branch, someone needs to add sign-offs. That means rewriting the commits and force-pushing, which I'm not allowed to do, so the author would have to do it. Otherwise, it can be waived the usual way.


Evidence: praktika report PRs/2949/b5cd583…/result_pr.json (all OK), Actions run 45637521601 (attempts 1 and 2), base-branch MasterCI runs linked above. I didn't run anything locally; everything here comes from the CI evidence.

@ianton-ru
ianton-ru marked this pull request as ready for review November 27, 2026 17:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants