Skip to content

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

Closed
alexey-milovidov wants to merge 13 commits into
masterfrom
fix/02845-join-on-cond-sparse-flaky
Closed

alexey-milovidov wants to merge 13 commits into
masterfrom
fix/02845-join-on-cond-sparse-flaky

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Mar 28, 2026 •

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
#100573

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) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Mar 28, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [88b1ff4]

Summary: ⏳

job_name test_name status info comment
Stress test (arm_msan) failure
Server died FAIL cidb, issue
MemorySanitizer: use-of-uninitialized-value (STID: 1478-2063) FAIL cidb, issue

AI Review

Summary

This PR adds the no-parallel-replicas tag to tests/queries/0_stateless/02845_join_on_cond_sparse.sql to avoid known flakiness caused by visibility/snapshot timing across parallel replicas. The change is minimal, targeted, and consistent with the issue described in the PR body. I did not find correctness, safety, performance, or compatibility problems in the current 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 ✅
No large/binary files ✅
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) <[email protected]>
@@ -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) <[email protected]>
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) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158

@alexey-milovidov

Copy link
Copy Markdown
Member Author

The Can't adjust last granule error in CI is a known issue. The fix is in #101641

@alexey-milovidov

Copy link
Copy Markdown
Member Author

Fixed in another PR.

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