Skip to content

Fix flaky 04039 test by disabling query condition cache - #100988

Closed
bacek wants to merge 1 commit into
ClickHouse:masterfrom
bacek:bacek/fix-04039
Closed

bacek wants to merge 1 commit into
ClickHouse:masterfrom
bacek:bacek/fix-04039

Conversation

@bacek

@bacek bacek commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

use_query_condition_cache = 1 (randomly enabled by the test runner) pre-filters granules before the skip index loop, leaving total_granules = 0 at mark-selection time. With no granules to evaluate, dropped = 0 for every index, index_dropped_granules stays at zero, and nothing is recorded in query_log.skip_indices.

Adding use_query_condition_cache = 0 pins the setting and ensures the skip index loop always sees the full set of granules, making the test deterministic.

Changelog category (leave one):

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

`use_query_condition_cache = 1` (randomly enabled by the test runner)
pre-filters granules before the skip index loop, leaving
`total_granules = 0` at mark-selection time. With no granules to
evaluate, `dropped = 0` for every index, `index_dropped_granules`
stays at zero, and nothing is recorded in `query_log.skip_indices`.

Adding `use_query_condition_cache = 0` pins the setting and ensures the
skip index loop always sees the full set of granules, making the test
deterministic.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@bacek

bacek commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

@grantholly-clickhouse fyi

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Mar 28, 2026
@clickhouse-gh

clickhouse-gh Bot commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [183002b]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_asan_ubsan, targeted) failure
04039_skip_index_query_log_actually_applied FAIL cidb
Stateless tests (amd_asan_ubsan, flaky check) failure
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
12 more test cases not shown
Stateless tests (amd_tsan, flaky check) failure
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
11 more test cases not shown
Stateless tests (amd_msan, flaky check) failure
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
6 more test cases not shown
Stateless tests (amd_debug, flaky check) failure
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
7 more test cases not shown
Stateless tests (amd_binary, flaky check) failure
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb
9 more test cases not shown
Stateless tests (amd_asan_ubsan, distributed plan, parallel, 1/2) failure
04039_skip_index_query_log_actually_applied FAIL cidb
Stateless tests (amd_debug, distributed plan, s3 storage, parallel) failure
04039_skip_index_query_log_actually_applied FAIL cidb
Stateless tests (amd_tsan, s3 storage, parallel, 1/2) failure
03632_skip_indices_logged_in_query_log FAIL cidb
Stateless tests (arm_binary, parallel) failure
03632_skip_indices_logged_in_query_log FAIL cidb
04039_skip_index_query_log_actually_applied FAIL cidb

AI Review

Summary

This PR makes a targeted CI-stability fix for 04039_skip_index_query_log_actually_applied.sql by forcing use_query_condition_cache = 0 in two SELECT statements, so skip-index behavior is not affected by randomized query-condition cache settings. The change is small, test-only, and consistent with similar deterministic patterns in stateless tests. I did not find correctness, safety, performance, or compatibility issues in the diff.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ➖
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
Final Verdict
  • Status: ✅ Approve

@bacek

bacek commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

Closing this PR as the underlying feature PR #99793 was reverted from master. The flakiness fix () should be included when the feature is re-landed.

@bacek bacek closed this Mar 28, 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 pr-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants