Skip to content

Add no-parallel-replicas tag to 02845_join_on_cond_sparse#101023

Draft
alexey-milovidov wants to merge 9 commits intomasterfrom
fix/02845-join-on-cond-sparse-flaky
Draft

Add no-parallel-replicas tag to 02845_join_on_cond_sparse#101023
alexey-milovidov wants to merge 9 commits intomasterfrom
fix/02845-join-on-cond-sparse-flaky

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

The test depends on exact INSERT visibility: the second SELECT must see the freshly inserted row (0, 1). Under parallel replicas the reading is distributed across replicas, and the fresh part may not be included in the coordinator snapshot, causing the SELECT to return empty.

Found in: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100573&sha=540a0ab7b9db7f85d22143f2857ba15d2bd93304&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29

Changelog category (leave one):

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

The test depends on exact INSERT visibility: the second SELECT must see
the freshly inserted row `(0, 1)`. Under parallel replicas the reading
is distributed across replicas, and the fresh part may not be included
in the coordinator snapshot, causing the SELECT to return empty.

Found in: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100573&sha=540a0ab7b9db7f85d22143f2857ba15d2bd93304&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Mar 28, 2026

Workflow [PR], commit [f5d3d55]

Summary:

job_name test_name status info comment
Stateless tests (amd_msan, flaky check) failure
02845_join_on_cond_sparse FAIL cidb
Integration tests (amd_llvm_coverage, 2/5) failure
test_overcommit_tracker/test.py::test_user_overcommit FAIL cidb
Stress test (arm_msan) failure
MemorySanitizer: use-of-uninitialized-value (STID: 1003-358c) FAIL cidb, issue

AI Review

Summary

This PR updates tests/queries/0_stateless/02845_join_on_cond_sparse.sql to add the no-parallel-replicas tag so the test is not executed under parallel replicas, where read visibility timing makes it flaky. The change is narrow, consistent with the PR motivation and linked CI evidence, and I did not find correctness, safety, or maintainability issues that require changes.

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 alexey-milovidov marked this pull request as draft March 28, 2026 17:36
@alexey-milovidov
Copy link
Copy Markdown
Member Author

I also found this strange. Would you mind telling exactly why it didn't work with parallel replicas?

alexey-milovidov and others added 3 commits March 28, 2026 23:47
…parse`

The flaky check showed that this test also fails with randomized
MergeTree settings (e.g. `min_bytes_for_wide_part 0`, large
`index_granularity`, `enable_index_granularity_compression`, etc.)
even without parallel replicas. Since this is a sparse serialization
regression test that depends on specific table-level settings, prevent
randomized MergeTree settings from interfering.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101023&sha=519b560776151364a61af63d857ff479ecc8f0c0&name_0=PR&name_1=Stateless%20tests%20%28amd_msan%2C%20flaky%20check%29

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -1,3 +1,5 @@
-- Tags: no-parallel-replicas, no-random-merge-tree-settings
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The new -- Tags line also adds no-random-merge-tree-settings, but the PR description only justifies no-parallel-replicas.

Please either:

  1. drop no-random-merge-tree-settings to keep test coverage broader, or
  2. add a concrete failure mode showing why random MergeTree settings make this test nondeterministic.

We try to add no-* tags only when they are strictly necessary.

alexey-milovidov and others added 4 commits March 30, 2026 02:02
The random MergeTree settings injector in `ClientBase::addMergeTreeSettings`
skips settings already present in the CREATE TABLE statement, so the test's
explicit `ratio_of_defaults_for_sparse_serialization = 0.1` is not overridden.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rse`

The flaky check CI proves this tag is needed: the random MergeTree setting
`ratio_of_defaults_for_sparse_serialization = 1.0` overrides the table-level
setting of `0.1`, disabling sparse serialization which this test specifically
exercises. This causes the SELECT to return empty results.

Evidence:
- https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101023&sha=be1a25bec699d8788154004531cdd5475d6bcae1&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20flaky%20check%29
- https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=101023&sha=be1a25bec699d8788154004531cdd5475d6bcae1&name_0=PR&name_1=Stateless%20tests%20%28amd_binary%2C%20flaky%20check%29

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The table-level SETTINGS (`ratio_of_defaults_for_sparse_serialization`)
are not overridden by random session-level MergeTree settings, so the
tag is not strictly necessary. Keep only `no-parallel-replicas` which
is justified by the INSERT visibility issue.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant