Repository navigation
Fix flaky test_dirty_pages_force_purge - #113811
Merged
Merged
Conversation
The test query peaks at ~417 MiB, but the purge was triggered only when jemalloc dirty pages exceeded 4 GiB * 0.2 = 819 MiB. Since jemalloc reuses dirty pages within the same arenas across iterations, `pdirty` can plateau below the threshold when few arenas are touched (e.g. when the number of query threads is lowered by `MemoryTrackerUtils` on a constrained CI machine), so the `MemoryAllocatorPurge` event never fired and the test timed out. Lower the ratio to 0.05 (~205 MiB) so a single iteration of the test query reliably exceeds the threshold. Seen in: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110188&sha=5b0dd0156a543c7e72ceb73c0ebb890d53cb1f83&name_0=PR&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%204%2F4%29 PR: #110188 Co-Authored-By: Claude Fable 5 <[email protected]>
1 task
Contributor
|
Workflow [PR], commit [b87486d] Summary: ✅ AI ReviewSummaryThis PR lowers Missing context / blind spots
Final VerdictNo findings. |
This was referenced Aug 7, 2026
This was referenced Aug 9, 2026
Merged
This was referenced Aug 9, 2026
alexey-milovidov
commented
Aug 9, 2026
alexey-milovidov
left a comment
Member
Author
There was a problem hiding this comment.
I don't think it was a good test, but I also don't mind this change.
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: #110188
The test
test_dirty_pages_force_purgeoccasionally times out waiting for theMemoryAllocatorPurgeevent (seen on unrelated PRs #110188, #111332, #113192, #107442, #105056; e.g. this report).Root cause: the test query peaks at ~417 MiB, but the forced purge fires only when jemalloc dirty pages exceed
max_server_memory_usage(4 GiB) ×memory_worker_purge_dirty_pages_threshold_ratio(0.2) = 819 MiB. Since jemalloc reuses dirty pages within the same arenas across iterations,pdirtycan plateau below the threshold when few arenas are touched — for example, when the number of query threads is lowered byMemoryTrackerUtilson a constrained CI machine (the failing run showsLower number of threads for query to 3 (5 requested)and all 100 iterations peaking at exactly 416.86 MiB) — so the event never fires and the test times out.Fix: lower the ratio to 0.05 (~205 MiB), so a single iteration of the test query reliably exceeds the threshold. The purge is still attributable to dirty-page volume rather than the total-memory threshold (0.9 × 4 GiB = 3.6 GiB, and the test keeps asserting peak memory < 3 GiB).
Changelog category (leave one):
Version info
26.8.1.1044(included in26.8and later)