Skip to content

Fix flaky test 02916_another_move_partition_inactive_replica - #100924

Merged
nikitamikhaylov merged 11 commits into
masterfrom
fix-02916-flaky-part-names
Mar 31, 2026
Merged

nikitamikhaylov merged 11 commits into
masterfrom
fix-02916-flaky-part-names

Conversation

@alexey-milovidov

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

Copy link
Copy Markdown
Member

The test checked specific part names after OPTIMIZE TABLE, but the merge selector doesn't guarantee which pairs of parts it picks. With max_parts_to_merge_at_once=2 and 4 input parts, two OPTIMIZE calls always yield exactly 2 active parts, but the specific merge order varies with randomized settings.

Replace the part name check with a count of active parts.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100736&sha=f0e1f4034aebfc4eb9c70f0ead3cad620f5b8199&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20distributed%20plan%2C%20sequential%29
#100736

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.4.1.451 (included in 26.4 and later)
  • Backported to: 26.3.33.49

The test checked specific part names after `OPTIMIZE TABLE`, but the
merge selector doesn't guarantee which pairs of parts it picks. With
`max_parts_to_merge_at_once=2` and 4 input parts, two `OPTIMIZE` calls
always yield exactly 2 active parts, but the specific merge order varies
with randomized settings.

Replace the part name check with a count of active parts, which is
deterministic and sufficient for the test's purpose (verifying MOVE
PARTITION with inactive replicas).

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100736&sha=f0e1f4034aebfc4eb9c70f0ead3cad620f5b8199&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20distributed%20plan%2C%20sequential%29

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0c13056]

Summary: ⏳

job_name test_name status info comment
Integration tests (amd_llvm_coverage, 2/5) failure
test_overcommit_tracker/test.py::test_user_overcommit FAIL cidb IGNORED
Stress test (arm_msan) failure
MemorySanitizer: use-of-uninitialized-value (STID: 2410-47e0) FAIL cidb, issue ISSUE CREATED
Stress test (arm_ubsan) failure
Logical error: Shard number is greater than shard count: shard_num=A shard_count=B cluster=C (STID: 5066-457d) FAIL cidb IGNORED

AI Review

Summary

This PR updates a flaky stateless test by replacing a nondeterministic check of specific part names after OPTIMIZE TABLE with a deterministic check on the number of active parts. Given the PR scope (test-only), this change aligns with the stated CI-flakiness motivation, and I did not find correctness, safety, or performance issues that warrant review comments.

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 27, 2026

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The fix is good.

@nikitamikhaylov nikitamikhaylov self-assigned this Mar 31, 2026
@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue Mar 31, 2026
Merged via the queue into master with commit a9b9cbc Mar 31, 2026
153 of 158 checks passed
@nikitamikhaylov
nikitamikhaylov deleted the fix-02916-flaky-part-names branch March 31, 2026 14:24
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 31, 2026
@PedroTadim

Copy link
Copy Markdown
Member

Must backport to 26.3 to fix CI there

@robot-ch-test-poll robot-ch-test-poll added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 10, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 10, 2026
PedroTadim added a commit that referenced this pull request Sep 11, 2026
Backport #100924 to 26.3: Fix flaky test 02916_another_move_partition_inactive_replica
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v26.3-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants