Skip to content

Fix flaky 03632: use mark-selection path for skip index logging - #100987

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

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

Conversation

@bacek

@bacek bacek commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

use_skip_indexes_on_data_read=1 routes reads through the data-read path where filterMarksUsingIndex is never called, so addSkipIndexAccessInfo is never invoked and query_log.skip_indices is always empty. The test must use use_skip_indexes_on_data_read=0 (mark-selection path) for the skip indices to actually appear in the log.

Also set auto_statistics_types = '' on all three tables to prevent auto-created minmax column statistics from shadowing the minmax skip index during granule evaluation, which was the other cause of flakiness.

Changelog category (leave one):

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

`use_skip_indexes_on_data_read=1` routes reads through the data-read path
where `filterMarksUsingIndex` is never called, so `addSkipIndexAccessInfo`
is never invoked and `query_log.skip_indices` is always empty. The test
must use `use_skip_indexes_on_data_read=0` (mark-selection path) for the
skip indices to actually appear in the log.

Also set `auto_statistics_types = ''` on all three tables to prevent
auto-created `minmax` column statistics from shadowing the `minmax` skip
index during granule evaluation, which was the other cause of flakiness.

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 [2f1ddb0]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_debug, parallel) failure
04039_skip_index_query_log_actually_applied FAIL cidb
Stateless tests (amd_tsan, parallel, 1/2) failure
04039_skip_index_query_log_actually_applied FAIL cidb
Stateless tests (amd_msan, WasmEdge, parallel, 1/2) failure
04039_skip_index_query_log_actually_applied FAIL cidb

AI Review

Summary
This PR stabilizes 03632_skip_indices_logged_in_query_log by forcing the mark-selection path (use_skip_indexes_on_data_read=0) where skip-index usage is actually logged, and by disabling auto-created statistics (auto_statistics_types='') that could shadow explicit skip indexes. The change is narrowly scoped to test fixtures/reference output and is correct for the stated flaky behavior. I did not find correctness, safety, or performance issues in the proposed test-only adjustments.

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

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Mar 28, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

use_skip_indexes_on_data_read=0

But it is not the default. Which means the feature is rendered useless. Should we revert the feature instead?

@bacek

bacek commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor Author

use_skip_indexes_on_data_read=0

But it is not the default. Which means the feature is rendered useless. Should we revert the feature instead?

It's above my pay grade.

OTOH, there is chicken and egg problem with 03632 and 04039 being flaky. I raised 2 different PRs (this and 100988), but they are dead locked on each other flakiness.

We can either:

  1. Remove use_skip_index_on_reads feature and this test.
  2. Fold both PRs into one.

@bacek

bacek commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

Apparently it was reverted.

@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