Skip to content

Disable the query condition cache in the Paimon tests that count the files read - #131696

Merged
murphy-4o merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-paimon-tests-qcc-repeated-runs
Nov 16, 2026
Merged

murphy-4o merged 1 commit into
ClickHouse:masterfrom
groeneai:fix-paimon-tests-qcc-repeated-runs

Conversation

@groeneai

@groeneai groeneai commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #131576

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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

Not required.

Description

03714_paimon_partition_pruning and 05137_paimon_boolean_type fail from their second run on the same server: Stateless tests (arm_asan_ubsan, azure, targeted) repeats them up to 50 times with --no-random-settings, and every run after the first reads fewer files than the reference (10 becomes 5, 3 or 1).

Both tests assert EngineFileLikeReadFiles for queries over the fixed paimon_all_types fixture. The query condition cache keys a data lake file by its path, so repeating a query with the same settings skips every file that the previous run found to have no matching row; in the query log the skipped files (ObjectStorageQueryConditionCacheSkippedFiles) are exactly the missing ones. The cache is correct, the tests assumed it was cold. Other jobs randomize use_query_condition_cache and settings that are part of its key, so a repeat there practically never gets the same key.

The change sets use_query_condition_cache = 0 on every query whose files are counted, the pruned and the unpruned one of each pair, as 05473_paimon_date32 and 05763_iceberg_cluster_partition_pruning_reads already do. Pinning only the unpruned query is not enough: a repeat then gets the pruned count from the cache even with pruning disabled. The other tests asserting EngineFileLikeReadFiles already disable the cache or read a table or path created per run.

Validation (master debug build, local MinIO, one server): before the change run 1 passes and runs 2-3 fail with the CI diff; after it each test passes 50/50 without randomization and 50/50 with it; removing the setting from one query brings the failure back; disabling pruning on a pruned query fails every run.


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

Version info

  • Merged into: 26.11.1.2467-master (included in 26.11 and later)

…files read

`03714_paimon_partition_pruning` and `05137_paimon_boolean_type` assert
`EngineFileLikeReadFiles` for queries over the fixed `paimon_all_types`
fixture. The query condition cache keys a data lake file by its path, so
when the same query runs again with the same settings on the same server,
every file the previous run found to have no matching row is skipped and
the file count drops (10 -> 5, 3, 1). `Stateless tests (arm_asan_ubsan,
azure, targeted)` repeats the selected tests up to 50 times with
`--no-random-settings`, so every run after the first failed; other jobs
randomize `use_query_condition_cache` and settings that are part of the
cache key.

Set `use_query_condition_cache = 0` on every counted query, the pruned and
the unpruned one of each pair (with only the unpruned one pinned, a repeat
gets the pruned count from the cache even when pruning is broken), as
`05473_paimon_date32` and `05763_iceberg_cluster_partition_pruning_reads`
already do.

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

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 0 findings) plus a separate cold review (0 findings).
Nothing to adjudicate.

Session id: cron:clickhouse-review-slot-9:20261114-221300

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @JiaQiTang98, could you review this? The two Paimon tests that count EngineFileLikeReadFiles failed on repeated runs in the new azure targeted job: the query condition cache keys data lake files by path, so a repeat skipped the files the previous run found empty. The tests now set use_query_condition_cache = 0 on every counted query.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. Local MinIO + master debug build, one server: clickhouse-test 05137_paimon_boolean_type 03714_paimon_partition_pruning --no-random-settings --no-random-merge-tree-settings --test-runs 3 --jobs 1. Run 1 passes, runs 2 and 3 fail with the CI diff.
b Root cause explained? The query condition cache keys a data lake file by its path. Repeating a query with the same settings on the same server skips every file that the previous run found to have no matching row, so EngineFileLikeReadFiles drops by exactly ObjectStorageQueryConditionCacheSkippedFiles (measured in system.query_log). The new azure targeted job repeats tests up to 50 times with no randomized settings, so the key repeats.
c Fix matches root cause? Yes. use_query_condition_cache = 0 on exactly the queries whose files are counted; the reference is unchanged, no bound widened, no tag added.
d Test intent preserved / new tests added? Yes. With pruning disabled on a pruned query, both tests fail on every run including repeats. Pinning only the unpruned query would have let the cache mask that on repeats (measured), so both queries of each pair are pinned. Test-only change, no product change.
e Both directions demonstrated? Yes. Before: runs 2-3 fail. After: each test 50/50 without randomization and 50/50 with it. Removing the setting from an unpruned query brings the failure back.
f Fix is general across code paths? Yes. All 9 tests asserting EngineFileLikeReadFiles were checked: the other 7 already disable the cache, run in clickhouse-local, or read a table or path created per run.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test-only fix of a dependence on cache state). The randomized 50/50 run covered the settings space.
h Backward compatible? (maintainer-approved exception only) N/A (no setting default, format or behaviour change).
i Invariants and contracts preserved? Yes. Query rows and .reference files are unchanged; only the cache setting of the counted queries changes.

Session id: cron:clickhouse-impl-slot-7:20261114-215800

@clickhouse-gh

clickhouse-gh Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8358a5c]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_debug, parallel) FAIL
03634_autopr_output_bytes_estimation FAIL cidb IGNORED

AI Review

Summary

PR #131696 disables use_query_condition_cache on all ten queries whose EngineFileLikeReadFiles counts are asserted in the two affected Paimon tests. This removes dependence on cache state across repeated runs while preserving the partition-pruning checks and expected results. Reviewed commit 8358a5cc1be20083f28b1a8bcce3d80c1d3643d4, the full diff, surrounding code, prior discussion, and the linked CI failure. No actionable findings. Runtime validation relies on the author's documented repeated-run and mutation checks; tests were not rerun locally.

Final Verdict

✅ Approve

@clickhouse-gh clickhouse-gh Bot added pr-ci can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). labels Nov 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - 8358a5c

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (amd_debug, parallel) / 03634_autopr_output_bytes_estimation flaky, not from this PR (it changes only 03714_paimon_partition_pruning and 05137_paimon_boolean_type): query_10 output estimate 142149 vs 362202, the sampled state-size under-estimate seen on master (12 runs) and on 26 other PRs since 2026-11-13 #131697 (ours, open)

Session id: cron:our-pr-ci-monitor:20261115-013011

@JiaQiTang98

JiaQiTang98 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

@groeneai track the CI bugfix PR, when the PR merged, merge master and fix CI

@JiaQiTang98 JiaQiTang98 self-assigned this Nov 16, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

Will do. The only red check here is Stateless tests (amd_debug, parallel) / 03634_autopr_output_bytes_estimation, which this PR does not touch; #131697 fixes it. When #131697 merges, I will merge master into this branch so CI re-runs with the fix.

@murphy-4o

Copy link
Copy Markdown
Member

@groeneai, please investigate the CI failures in this PR (commit 8358a5c) and fix them, or link existing fixes.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=131696&sha=8358a5cc1be20083f28b1a8bcce3d80c1d3643d4&name_0=PR

Failures without a known issue:

  • 03634_autopr_output_bytes_estimation in Stateless tests (amd_debug, parallel) (history)

@murphy-4o
murphy-4o added this pull request to the merge queue Nov 16, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

The only failure, 03634_autopr_output_bytes_estimation, is not caused by this PR (it changes only the two Paimon tests). The existing fix is #131697 (open).

Merged via the queue into ClickHouse:master with commit 9005321 Nov 16, 2026
568 of 572 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 16, 2026
@clickhouse-gh clickhouse-gh Bot added comp-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. 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-datalake Data lake table formats (Iceberg/Delta/Hudi) integration. pr-ci 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