Repository navigation
Make test_dirty_pages_force_purge deterministic - #113906
alexey-milovidov wants to merge 1 commit into
Conversation
The purge fires only when jemalloc dirty pages exceed `memory_worker_purge_dirty_pages_threshold_ratio` (0.2) of `max_server_memory_usage` (4Gi) = 0.8 GiB, but a single test query dirties only ~400 MB and jemalloc reuses freed extents within an arena, so repeating the same query does not accumulate dirty pages beyond one query's footprint per arena. Crossing the threshold therefore depended on queries landing on different thread-pool threads (= different arenas), and the test timed out waiting for the `MemoryAllocatorPurge` event when they did not — 7 failures across unrelated PRs in the last 14 days. Lower the ratio so a single query reliably crosses the threshold. Seen in https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113042&sha=9a329692501a39e051b9c908b281282f4110e0fb&name_0=PR on #113042 Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [e3eab12] Summary: ✅ AI ReviewSummaryThis PR lowers Final Verdict✅ No findings. |
|
🕵 Closing as a duplicate of #113811, which was opened earlier, applies the same fix (lowering |
The test waits for a
MemoryAllocatorPurgeevent, but the purge fires only when jemalloc dirty pages exceedmemory_worker_purge_dirty_pages_threshold_ratio(0.2) ofmax_server_memory_usage(4Gi) = 0.8 GiB. A single test query dirties only ~400 MB, and jemalloc reuses freed extents within an arena, so repeating the same query does not accumulate dirty pages beyond one query's footprint per arena. Crossing the threshold therefore depended on queries landing on different thread-pool threads (= different arenas), and when they did not, the test timed out waiting for the event — 7 failures across unrelated PRs (#113192, #110188, #110144, #111332, …) in the last 14 days per CIDB. Example: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=113042&sha=9a329692501a39e051b9c908b281282f4110e0fb&name_0=PR on #113042.Lower the ratio in the test config so the dirty pages of a single query reliably cross the threshold. Verified locally: the test now passes in ~7 s (the purge fires on the first query) instead of looping.
Related: #113042
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...