Skip to content

Tag 05339_parquet_top_k_string_statistics as no-parallel - #128565

Merged
arsenmuk merged 1 commit into
ClickHouse:masterfrom
groeneai:tag-05339-parquet-top-k-string-statistics-no-parallel
Nov 9, 2026
Merged

arsenmuk merged 1 commit into
ClickHouse:masterfrom
groeneai:tag-05339-parquet-top-k-string-statistics-no-parallel

Conversation

@groeneai

@groeneai groeneai commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #124827

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):

...

Description

05339_parquet_top_k_string_statistics (added in #124827) sometimes prints t_05339_s3: the read populates the cache without use_query_condition_cache_for_top_k: 0 instead of 1 (arm_asan_ubsan, targeted; no failures on master).

The test checks hits in the server-wide query condition cache while running in parallel with other tests. In the failing run the server log shows the read storing its entry, then 05213_timeseries_metric_families_target dropping the inner tables of a TimeSeries table in an Ordinary database a few milliseconds before each of the two probes. A MergeTree table without a UUID calls Context::clearCaches() on drop and rename, which also clears the query condition cache. One DROP of a TimeSeries table clears it three times in about 220 ms, so the second attempt that the test already had did not help.

The test is now tagged no-parallel, like the other tests that check hits in this cache (04498_query_condition_cache_local_files, 05316_top_k_primary_key_skip_query_condition_cache), and the retry is removed. Test-only change, reference unchanged.

Validation on a master debug build: SYSTEM CLEAR QUERY CONDITION CACHE before the probe gives the CI diff 5/5; a concurrent create and drop of a MergeTree table in an Ordinary database fails 10/10 (Atomic: 0/10). Next to 160 runs of 05213 with -j 16, the test failed 1/40 before the change and 0/40 after it, now in the sequential group. 50/50 randomized runs pass.


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

Version info

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

The test asserts hits in the server-wide query condition cache. In the
parallel phase another test can clear that cache between the read that
writes an entry and the probe that reads it: a MergeTree table without a
UUID (Ordinary database) calls Context::clearCaches() on drop and rename,
which also clears the query condition cache. In a failing
`Stateless tests (arm_asan_ubsan, targeted)` run,
05213_timeseries_metric_families_target dropped the inner tables of a
TimeSeries table in an Ordinary database right before both probes of
t_05339_s3_written. One such DROP clears the cache three times in about
220 ms, so the second attempt did not help.

Run the test in the sequential group, as the other tests checking hits in
this cache do (04498, 05316), and drop the retry.

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

groeneai commented Nov 2, 2026

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 my own cold review (1 nit).

# Sev Finding Verdict Evidence / action
1 💡 The test now runs in the sequential group, so its runtime moves to the serial part of each stateless job AGREE, noted, not blocking Every configuration that runs it has a sequential job; the other tests that check hits in this cache already run there

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding.

Session id: cron:clickhouse-review-slot-8:20261102-005900

@groeneai

groeneai commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. SYSTEM CLEAR QUERY CONDITION CACHE before the _written probe gives the CI diff 5/5; a concurrent create and drop of a MergeTree table in an Ordinary database fails 10/10 (Atomic: 10/10 OK).
b Root cause explained? A parallel test drops a MergeTree table without a UUID, MergeTreeData::dropAllData calls Context::clearCaches(), which empties the server-wide query condition cache between the populating read and the probe, so the probe sees 0 hits. Seen in the failing job's server log (05213_timeseries_metric_families_target).
c Fix matches root cause? Yes. The cause is concurrency with tests that clear server-global state; no-parallel puts the test in the sequential group. No bound widened, no setting pinned, no data reduced.
d Test intent preserved / new tests added? Yes. Every query, log_comment and reference line is unchanged; the three positive-hit assertions stay. Test-only change.
e Both directions demonstrated? Yes. Next to 160 runs of 05213 with -j 16: 1/40 FAIL before, 0/40 after (sequential, starts after the last 05213 run ends). 50/50 randomized runs pass.
f Fix is general across code paths? 44 of the 49 tests that read QueryConditionCacheHits are already no-parallel; the other 4 assert only things a cache clear cannot break. This was the only untagged one asserting a hit.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test scheduling fix). The File, S3, S3 glob and Iceberg arms all stay.
h Backward compatible? (maintainer-approved exception only) N/A (no setting, format or behaviour change).
i Invariants and contracts preserved? Yes. The test creates no MergeTree table, so nothing clears the cache while it runs alone.

Session id: cron:clickhouse-impl-slot-7:20261102-001400

@groeneai

groeneai commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator Author

cc @rschu1ze, could you review this and add the can be tested label so CI runs? The test asserts hits in the server-wide query condition cache, which a parallel test clears by dropping a MergeTree table in an Ordinary database (Context::clearCaches()), so it is now no-parallel like 04498 and 05316.

@clickhouse-gh

clickhouse-gh Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [47b5409]

Summary: ✅


AI Review

Summary

This PR runs 05339_parquet_top_k_string_statistics sequentially to prevent concurrent tests from clearing the server-wide query condition cache, and removes the retry. The cache-hit assertions and expected output are preserved. No actionable findings.

Missing context / blind spots
Final Verdict

Status: ✅ Approve.

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

rschu1ze commented Nov 9, 2026

Copy link
Copy Markdown
Member

@arsenmuk You're good with that one?

@arsenmuk arsenmuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a solid flaky fix, and a cleanup of parallel-supporting code

@arsenmuk
arsenmuk added this pull request to the merge queue Nov 9, 2026
Merged via the queue into ClickHouse:master with commit 0587f5b Nov 9, 2026
530 of 532 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 9, 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. 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