Repository navigation
Fix flaky test test_ttl_move/test.py::test_moves_after_merges - #128704
Merged
PedroTadim merged 1 commit intoNov 3, 2026
Merged
PedroTadim merged 1 commit into
PedroTadim merged 1 commit into
Conversation
The test inserted two parts with `d1 = now + 3 s` under `SYSTEM STOP MOVES`,
ran `OPTIMIZE`, and expected the merged part to stay on `jbod1` (step 1).
`SYSTEM STOP MOVES` only blocks the background mover: a merge picks its
destination itself and honours a move TTL that has already expired
(`MergeTreeData::tryReserveSpacePreferringTTLRules`, with `time(nullptr)` for
MergeTree and the log entry create time for ReplicatedMergeTree). The window
was 3 s minus the fraction `toDateTime(float)` truncates, and had to cover both
INSERTs and the OPTIMIZE reaching the server. In the failing ASan+UBSan job
the OPTIMIZE reached the server 1.66 s after the client issued it, 0.22 s after
the TTL expired, so the merge itself placed the part on `external` and step 1
saw `{'external': 20}`.
Both parts now share one TTL timestamp, `int(time.time()) + 10`, taken before
the inserts, and step 2 sleeps until exactly that timestamp instead of a fixed
3 s, so the existing 30 s wait is left for the move.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: 0 blockers, 0 open majors
|
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-7:20261102-153800 |
Collaborator
Author
|
cc @CurtizJ, could you review this and add the |
Contributor
|
Workflow [PR], commit [f711e8a] Summary: ✅ AI ReviewSummaryThe PR gives both inserted parts in Missing context / blind spots
Final VerdictStatus: ✅ Approve |
PedroTadim
approved these changes
Nov 3, 2026
Merged
via the queue into
ClickHouse:master
with commit Nov 3, 2026
a79b6ce
179 of 180 checks passed
This was referenced Nov 3, 2026
Merged
Merged
clickhouse-gh Bot
added a commit
that referenced
this pull request
Nov 3, 2026
Backport #128704 to 26.9: Fix flaky test `test_ttl_move/test.py::test_moves_after_merges`
clickhouse-gh Bot
added a commit
that referenced
this pull request
Nov 3, 2026
Backport #128704 to 26.8: Fix flaky test `test_ttl_move/test.py::test_moves_after_merges`
clickhouse-gh Bot
added a commit
that referenced
this pull request
Nov 3, 2026
Backport #128704 to 26.10: Fix flaky test `test_ttl_move/test.py::test_moves_after_merges`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #128619
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
Failure:
Integration tests (amd_asan_ubsan, db disk, 3/8)on #12861955595802aa93: step 1 found the merged part onexternalinstead ofjbod1.The test inserts two parts with
d1 = now + 3 sunderSYSTEM STOP MOVES, runsOPTIMIZEand expects the merged part to stay onjbod1.SYSTEM STOP MOVESonly stops the background mover: a merge reserves its own space and goes to the TTL destination if the TTL has already expired (MergeTreeData::tryReserveSpacePreferringTTLRules). The 3 s window had to cover both INSERTs and theOPTIMIZE. In the failing job theOPTIMIZEreached the server 1.66 s after the client sent it, 0.22 s after the TTL expired, and the server loggedTrying to reserve 1.00 MiB to apply a TTL rulefor that merge.Both parts now share one TTL timestamp,
int(time.time()) + 10(about 3.5x the 2.84 s the failing job needed from the first INSERT to theOPTIMIZEreaching the server), and step 2 sleeps until exactly that time instead of a fixed 3 s. The assertions are unchanged.Validation (master ASan build, both
[mt]and[rmt]):OPTIMIZE, the old test fails with the CI assertion and server log line, and the fixed test passes.SYSTEM START MOVESit fails in step 2, so both checks still catch their case.The other checks in this file that run on 3 s TTL data before it expires (
test_inserts_and_moves,test_merges_to_disk,test_move_after_policy_change,test_replicated_download_ttl_info) are unchanged: none of their ~1.1M runs in 90 days of CIDB failed this way.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/128704]
Version info
26.11.1.1189-master(included in26.11and later)