Skip to content

Add integration tests for wide-row parquet memory over s3() - #119300

Merged
alexey-milovidov merged 4 commits into
ClickHouse:masterfrom
cloudquery:parquet-wide-rows-memory-repro
Sep 23, 2026
Merged

alexey-milovidov merged 4 commits into
ClickHouse:masterfrom
cloudquery:parquet-wide-rows-memory-repro

Conversation

@erezrokah

@erezrokah erezrokah commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Related: #120027
Related: #120028
Related: #120029

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

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

Not required.

Documentation entry for user-facing changes

Not applicable.

What this PR does

Adds integration tests that read and copy a wide-row parquet object over s3() under a memory limit, and measures what removing the Arrow-based reader in #100949 costs those queries. Three cases pass on 26.2 and fail on 26.8, so the tests are red and this is a draft.

The fixture is 20 rows with one String column of about 12 MB each, so about 240 MB in one object, written both as a single row group and as one row group per row. reader is the value of input_format_parquet_use_native_reader_v3, obsolete on 26.8. Each max_memory_usage sits between the two readers' peaks on 26.2. Peaks in brackets come from system.query_log under an 8 GiB limit, as a range where repeated runs differ.

operation source reader max_memory_usage 26.2.19.43 26.8.2.7
read 240 MB, 1 row group arrow 1 GiB OK (715 MiB) FAIL (1.25 GiB)
read 240 MB, 1 row group v3 1 GiB FAIL (1.25 GiB) FAIL (1.25 GiB)
read 240 MB, 20 row groups arrow 512 MiB FAIL (608 MiB) OK (258-321 MiB)
read 240 MB, 20 row groups v3 512 MiB OK (257-321 MiB) OK (225-337 MiB)
insert 240 MB, 1 row group arrow 1 GiB OK (717 MiB) FAIL (1.34 GiB)
insert 240 MB, 1 row group v3 1 GiB FAIL (1.28 GiB) FAIL (1.41 GiB)
insert 240 MB, 20 row groups arrow 720 MiB OK (609 MiB) FAIL (872 MiB)
insert 240 MB, 20 row groups v3 720 MiB FAIL (871 MiB) FAIL (872 MiB)

Running it

tests/integration/test_storage_s3/wide_rows_memory_matrix.sh 26.2:v26.2.19.43-stable 26.8:v26.8.2.7-lts

What this PR does not do

It does not fix anything, and does not say where the memory is held.


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

Version info

  • Merged into: 26.10.1.555-master (included in 26.10 and later)

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 10, 2026
@erezrokah
erezrokah force-pushed the parquet-wide-rows-memory-repro branch from 907f0d4 to c92b70f Compare September 11, 2026 07:40
@erezrokah
erezrokah marked this pull request as ready for review September 11, 2026 07:43
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@maxknv maxknv removed the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Sep 11, 2026
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Sep 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [e7e1c89]

Summary: ✅


AI Review

Summary

This PR adds wide-row Parquet memory coverage to test_storage_s3 and a helper script that replays the same cases against pinned release tags and reader configurations. I did not find a remaining correctness issue in the current head; the previously raised reproducibility and reporting problems in wide_rows_memory_matrix.sh appear fixed in the code now on the branch.

Final Verdict

✅ No blocking or major findings.

@clickhouse-gh clickhouse-gh Bot added the pr-build Pull request with build/testing/packaging improvement label Sep 19, 2026
@erezrokah
erezrokah force-pushed the parquet-wide-rows-memory-repro branch from d8c9bc6 to d11e59b Compare September 21, 2026 11:24
Reads and copies a ~240 MB payload out of one bucket object, laid out
both as a single row group and as one row group per row, under memory
limits taken from the two readers' measured peaks on 26.2.19.43.

On 26.2 the arrow reader meets the limit for the single-row-group read
and for both inserts; on 26.8 nothing does, and the exception names
ParquetV3BlockInputFormat even with
input_format_parquet_use_native_reader_v3=0. Reader v3 is the cheaper
path for reading many row groups, which the third case covers.

wide_rows_memory_matrix.sh runs the tests against several released
versions, each at its own tag, since an older binary rejects a newer
programs/server/config.xml and never starts.
The script appended its test block only when the file did not already contain it, so a
checkout left over from an earlier run kept the tests it was first given. It also
discarded the runner's exit status and picked the newest result JSON in ci/tmp, which
can belong to a previous run.

The test file is now reset before the block is appended, only results written after the
run started are read, and a runner that exits non-zero without producing results is
reported instead of passing silently.
@erezrokah
erezrokah force-pushed the parquet-wide-rows-memory-repro branch from d11e59b to 0170565 Compare September 21, 2026 11:27
…te reader split

The helper pulled the server binary from the floating `clickhouse/clickhouse-server:26.2`
tag while checking the source out at `v26.2.19.43-stable`, so it paired an old tree with
whatever binary that alias points at today. It now derives the exact release from the tag
and caches the binary under that exact version.

Its cleanup removed every container whose name contains `praktika`, including jobs of
other worktrees on the same host; it now removes only containers mounted from its own
checkout. Its default work directory was a single host-global path, so two checkouts
shared one results file and one binary cache; it now defaults under the checkout.

`report` printed the leaf rows and dropped the run's own status, so a run that broke
after writing some rows read as a shorter but valid matrix. It now adds an explicit row
whenever the status is neither OK nor FAIL.

`input_format_parquet_use_native_reader_v3` is obsolete on master, so parametrizing the
in-tree tests over it ran the same reader twice and doubled their cost for no coverage.
The tests keep the one supported reader; the comparison moves to the matrix helper, which
runs each release under both readers, where the setting still selects between them.
…ner exit row

On `v26.8.2.7-lts` `input_format_parquet_use_native_reader_v3` is already `MAKE_OBSOLETE`,
so its `arrow` and `v3` rows ran the same reader twice and made the matrix look like a
cross-reader comparison it was not. The helper now reads the tag's
`src/Core/FormatFactorySettings.h` and runs the release once when the setting is obsolete.

The `(no result file from this run)` note matched the label check that guards the
`(runner exited N, see log)` row, so a broken run lost its exit code and log path. The
guard now counts only test rows, not the script's own parenthesised notes.
@alexey-milovidov

Copy link
Copy Markdown
Member

They are green :)

@alexey-milovidov alexey-milovidov self-assigned this Sep 23, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 23, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

Thank you!

Merged via the queue into ClickHouse:master with commit 95535aa Sep 23, 2026
176 checks passed
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 23, 2026
@clickhouse-gh clickhouse-gh Bot added comp-parquet-reader-v3 Issues related to the native Parquet reader. and removed comp-testing Test content only (no production code). labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-parquet-reader-v3 Issues related to the native Parquet reader. external Author is not a member of the ClickHouse organization pr-build Pull request with build/testing/packaging improvement 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