Repository navigation
Revert "Lower max_server_memory_usage_to_ram_ratio to 0.7 on sanitizer stateless runs" - #110572
Merged
alexey-milovidov merged 1 commit intoJul 15, 2026
Conversation
…r stateless runs"
alexey-milovidov
deleted the
revert-110293-fix-sanitizer-stateless-oom-memory-ratio
branch
July 15, 2026 15:03
Contributor
1 task
This was referenced Jul 15, 2026
pull Bot
pushed a commit
to CrazyForks/ClickHouse
that referenced
this pull request
Jul 18, 2026
…oncurrency Re-applies the sanitizer `max_server_memory_usage_to_ram_ratio` of 0.7 from ClickHouse#110293 (reverted in ClickHouse#110572 because it caused a flood of `MEMORY_LIMIT_EXCEEDED` in the "Stateless tests (amd_asan_ubsan, distributed plan, parallel)" job on master), and this time also lowers the test concurrency for that job so the *aggregate* server memory of concurrent queries fits under the cap. ClickHouse#110293 lowered the ratio to 0.7 to stop the host OOM killer from reaping the server ("Server died") on the heaviest sanitizer stateless configs, where ~17 GiB of concurrent ASan `clickhouse-client` processes plus a 0.9-of-RAM server exceed the 60 GiB host. That reasoning only accounted for the largest single query (~25 GiB), but in the parallel runner dozens of test queries share one server, so the server memory tracker sees the aggregate, and `--distributed-plan` fans each query across local parallel replicas, multiplying per-query server memory. The aggregate then exceeds the lowered 41.84 GiB cap and the `OvercommitTracker` rejects queries across all co-scheduled tests (Code 241, `MEMORY_LIMIT_EXCEEDED`), so hundreds of unrelated tests failed on master with 6-213 failures per run. Fix: - Re-apply `set_memory_ratio(0.7)` for every sanitizer stateless run. - Cut the parallel distributed-plan sanitizer job's concurrency to 0.35 * CPU (below the 0.4 that azure already uses for the identical failure mode), so the aggregate concurrent RSS stays under the cap. The reduction is gated to sanitizer builds, since only they carry the 0.7 cap; the healthy non-sanitizer (amd_debug) distributed-plan parallel job is left at the default concurrency. - Raise that job's timeout from 2.5h to 3h so the reduced throughput (the job runs ~80 min at 0.6 * CPU) cannot turn a memory-red into a timeout-red. CI report of the disaster (master, Code 241 flood): https://play.clickhouse.com/play?user=play&run=1&color_modes=%7B%22ppm%22%3A%22none%22%2C%22test_name%22%3A%22categorical%22%7D&tab=Failed%20checks#U0VMRUNUIGNoZWNrX3N0YXJ0X3RpbWUsIGNoZWNrX25hbWUsIHRlc3RfbmFtZSwgcmVwb3J0X3VybApGUk9NIGNoZWNrcwpXSEVSRSAxCiAgICBBTkQgY2hlY2tfc3RhcnRfdGltZSA+PSBub3coKSAtIElOVEVSVkFMIDI0IEhPVVIKICAgIEFORCAoaGVhZF9yZWYgPSAnbWFzdGVyJyBBTkQgc3RhcnRzV2l0aChoZWFkX3JlcG8sICdDbGlja0hvdXNlLycpKQogICAgQU5EIHRlc3Rfc3RhdHVzICE9ICdTS0lQUEVEJwogICAgQU5EICh0ZXN0X3N0YXR1cyBMSUtFICdGJScgT1IgdGVzdF9zdGF0dXMgTElLRSAnRSUnKQogICAgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycKT1JERVIgQlkgY2hlY2tfc3RhcnRfdGltZSBERVNDLCBjaGVja19uYW1lLCB0ZXN0X25hbWU7 Related: ClickHouse#108689 Related: ClickHouse#110293 Related: ClickHouse#110572 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
huldarchen
pushed a commit
to huldarchen/ClickHouse
that referenced
this pull request
Sep 3, 2026
The fuzzer jobs give one unbounded container a whole shared runner: get_run_command passes no --memory, and inside the container only max_server_memory_usage_to_ram_ratio is set while max_server_memory_usage stays 0, so the server sizes itself from the host (46.33 of 61.78 GiB). On PR ClickHouse#116666 the container reached "current RSS: 57.14 GiB" against "maximum: 46.18 GiB" while every query was refused with Code 241. That RSS is the container cgroup's anon, so it charges clickhouse-client and two gdb processes as well, and the server's own ratio cannot bound it. About 4.6 GiB was left for the runner agent; it lost communication, the Run step concluded cancelled, and since upload happens after Run the job published nothing. CI DB has 0 rows for AST fuzzer (amd_debug, targeted) at that commit, while the twin old_compatibility arm fuzzed the same two query files against the same diff at the same commit and passed. --memory is a kernel bound on the whole container, so the reserve holds whatever the server, gdb and the client do. The launcher stays outside the container, so an in-container kill leaves it alive to publish a result. The derived form follows ci/defs/job_configs.py and adapts to both runner classes; 8 GiB rather than that file's 2 GiB because the agent lost communication with 4.64 GiB still available, and the runner's at-rest footprint is already about 2.4 GiB. max_server_memory_usage_to_ram_ratio is deliberately unchanged and becomes an inner margin: the container cap is 53.78 GiB and the server ceiling 40.33 instead of 46.33 GiB. Lowering that ratio was tried and reverted before (ClickHouse#110293, reverted by ClickHouse#110572) for flooding unrelated tests with MEMORY_LIMIT_EXCEEDED. Validated locally: the flag binds a container carrying this job's exact flags including --privileged, and ClickHouse then reports the container size rather than the host's (8.00, 4.00 and 16.00 GiB as the cap varies, 755.49 GiB with no flag, and 8.00 down to 3.00 GiB through the cgroups v1 code path); 2 GiB of anon in a 512 MiB container of this shape is killed by the kernel and succeeds uncapped; all 10 fuzzer job digests change while 164 other PR jobs do not; and pytest ci/tests/ has identical pass/fail sets with and without the change. Related: ClickHouse#111892 Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Sep 4, 2026
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…x-sanitizer-stateless-oom-memory-ratio Revert "Lower max_server_memory_usage_to_ram_ratio to 0.7 on sanitizer stateless runs"
zeekay
pushed a commit
to hanzoai/datastore
that referenced
this pull request
Sep 11, 2026
…oncurrency Re-applies the sanitizer `max_server_memory_usage_to_ram_ratio` of 0.7 from ClickHouse#110293 (reverted in ClickHouse#110572 because it caused a flood of `MEMORY_LIMIT_EXCEEDED` in the "Stateless tests (amd_asan_ubsan, distributed plan, parallel)" job on master), and this time also lowers the test concurrency for that job so the *aggregate* server memory of concurrent queries fits under the cap. ClickHouse#110293 lowered the ratio to 0.7 to stop the host OOM killer from reaping the server ("Server died") on the heaviest sanitizer stateless configs, where ~17 GiB of concurrent ASan `clickhouse-client` processes plus a 0.9-of-RAM server exceed the 60 GiB host. That reasoning only accounted for the largest single query (~25 GiB), but in the parallel runner dozens of test queries share one server, so the server memory tracker sees the aggregate, and `--distributed-plan` fans each query across local parallel replicas, multiplying per-query server memory. The aggregate then exceeds the lowered 41.84 GiB cap and the `OvercommitTracker` rejects queries across all co-scheduled tests (Code 241, `MEMORY_LIMIT_EXCEEDED`), so hundreds of unrelated tests failed on master with 6-213 failures per run. Fix: - Re-apply `set_memory_ratio(0.7)` for every sanitizer stateless run. - Cut the parallel distributed-plan sanitizer job's concurrency to 0.35 * CPU (below the 0.4 that azure already uses for the identical failure mode), so the aggregate concurrent RSS stays under the cap. The reduction is gated to sanitizer builds, since only they carry the 0.7 cap; the healthy non-sanitizer (amd_debug) distributed-plan parallel job is left at the default concurrency. - Raise that job's timeout from 2.5h to 3h so the reduced throughput (the job runs ~80 min at 0.6 * CPU) cannot turn a memory-red into a timeout-red. CI report of the disaster (master, Code 241 flood): https://play.clickhouse.com/play?user=play&run=1&color_modes=%7B%22ppm%22%3A%22none%22%2C%22test_name%22%3A%22categorical%22%7D&tab=Failed%20checks#U0VMRUNUIGNoZWNrX3N0YXJ0X3RpbWUsIGNoZWNrX25hbWUsIHRlc3RfbmFtZSwgcmVwb3J0X3VybApGUk9NIGNoZWNrcwpXSEVSRSAxCiAgICBBTkQgY2hlY2tfc3RhcnRfdGltZSA+PSBub3coKSAtIElOVEVSVkFMIDI0IEhPVVIKICAgIEFORCAoaGVhZF9yZWYgPSAnbWFzdGVyJyBBTkQgc3RhcnRzV2l0aChoZWFkX3JlcG8sICdDbGlja0hvdXNlLycpKQogICAgQU5EIHRlc3Rfc3RhdHVzICE9ICdTS0lQUEVEJwogICAgQU5EICh0ZXN0X3N0YXR1cyBMSUtFICdGJScgT1IgdGVzdF9zdGF0dXMgTElLRSAnRSUnKQogICAgQU5EIGNoZWNrX3N0YXR1cyAhPSAnc3VjY2VzcycKT1JERVIgQlkgY2hlY2tfc3RhcnRfdGltZSBERVNDLCBjaGVja19uYW1lLCB0ZXN0X25hbWU7 Related: ClickHouse#108689 Related: ClickHouse#110293 Related: ClickHouse#110572 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Reverts #110293
Version info
26.7.1.982(included in26.7and later)