Repository navigation
Cap the integration tests' /docker cgroup leaf at a ceiling, not at its share - #117411
alexey-milovidov wants to merge 1 commit into
Conversation
… its share The nested test containers' leaf was the only one whose `memory.max` was its share of the job limit rather than a ceiling overlapping the other leaves. That share does not hold what the leaf actually charges: besides the nested servers' anon memory it holds every byte they write, as page cache, so the leaf ran at its cap continuously and the kernel OOM-killed a `clickhouse` server whenever reclaim could not keep up with writeback. Measured on master, one day after the reporting for this condition became reliable: `/docker` reached the 40.78 GiB cap in nearly every run of every `amd_asan_ubsan, db disk, old analyzer` shard - including shards that passed - and the kill turned into `Container memory budget exceeded (/docker)` in 47.3% of the runs of shard 6/6, 26.9% of 5/6 and 17.0% of 2/6, with a smaller number of `amd_tsan` and `amd_llvm_coverage` runs. In the run below the leaf was killed three times at 40.78 GiB of 40.78 GiB while `/dockerd` sat at 18.36 GiB of 42.78 GiB and `/init` at 21.98 GiB of 56.78 GiB, and the whole job peaked at 47.14 GiB against its own 59.78 GiB limit: ~12 GiB the partition held back from the only leaf that had a use for it. So `/docker` now gets `CI_DIND_NESTED_LIMIT`, the ceiling `/init` has, while `CI_DIND_NESTED_BUDGET` stays its share and keeps sizing xdist concurrency - the worker count is unchanged. Containment is unaffected: it comes from `--cgroupns=private`, and the job's own `--memory` still bounds the leaves together. The overlap with `/init` becomes mutual, where before only `/init` could borrow; what protects the harness is that the memory `/docker` borrows is page cache, which reclaim takes back before it touches anon, and a borrow that outgrows even that breaches the job's cgroup, which `job_cgroup_oom` reports. Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=25dfbdb6c5dd3c0bd78c7134c14045ddb7647bcf&name_0=MasterCI&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%206%2F6%29 Caused by: #112984
|
Workflow [PR], commit [7a54b0a] Summary: ❌
AI ReviewSummaryThis PR splits the integration-tests nested Docker leaf into a worker-sizing Findings💡 Nits
Final Verdict✅ No blocking correctness issue found in the current diff. One diagnostics nit should be cleaned up so the new LLVM Coverage Report |
| 40 GiB cap. Runs without the variable (local, or a job that sets no memory limit) keep | ||
| `CI_DIND_NESTED_BUDGET` is the share of the job limit that the cgroup parenting them owes the | ||
| other leaves nothing for, so deriving worker concurrency from it keeps scheduling and | ||
| containment on the same number. Its `memory.max` is `CI_DIND_NESTED_LIMIT`, a ceiling that |
There was a problem hiding this comment.
Now that /docker is actually capped by CI_DIND_NESTED_LIMIT and CI_DIND_NESTED_BUDGET is only the worker-sizing share, the remaining diagnostics should stop describing a /docker leaf OOM as Container memory budget exceeded. DIND_LEAF_MEANINGS["docker"] and the comment in tests/integration/integration-tests-entrypoint.sh still send readers to the old number, so a run that hits the new ceiling will look like the 40 GiB budget was breached. Could you rename those to limit exceeded in the same change?
The integration tests run a nested Docker daemon whose cgroup is split into three capped leaves —
/init(the harness),/dockerd(the daemons) and/docker(the nested test containers)./dockerwas the only leaf whosememory.maxwas its share of the job limit rather than a ceiling overlapping the other leaves, and that share does not hold what the leaf actually charges: besides the nested servers' anon memory it holds every byte they write, as page cache. The leaf therefore ran at its cap continuously, and the kernel OOM-killed aclickhouseserver whenever reclaim could not keep up with writeback.Measured on master, one day after the reporting for this condition became reliable:
/dockerreached the 40.78 GiB cap in nearly every run of everyamd_asan_ubsan, db disk, old analyzershard — including shards that passed — and the kill turned intoContainer memory budget exceeded (/docker)in 47.3% of the runs of shard 6/6, 26.9% of 5/6 and 17.0% of 2/6, plus a smaller number ofamd_tsanandamd_llvm_coverageruns. In the reported run the leaf was killed three times at 40.78 GiB of 40.78 GiB while/dockerdsat at 18.36 GiB of 42.78 GiB and/initat 21.98 GiB of 56.78 GiB, and the job as a whole peaked at 47.14 GiB against its own 59.78 GiB limit — about 12 GiB the partition held back from the only leaf that had a use for it. Thetest_s3_plain_rewritablefailure in the same report (Connection refusedduringOPTIMIZE TABLE test FINAL) is one of those killed servers./dockernow getsCI_DIND_NESTED_LIMIT, the same ceiling/inithas, whileCI_DIND_NESTED_BUDGETstays its share and keeps sizing xdist concurrency, so the worker count is unchanged. Containment is unaffected — it comes from--cgroupns=private, and the job's own--memorystill bounds the leaves together. The overlap with/initbecomes mutual, where before only/initcould borrow; what protects the harness is that the memory/dockerborrows is page cache, which reclaim takes back before it touches anon, and a borrow that outgrows even that breaches the job's own cgroup, whichjob_cgroup_oomalready reports.CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=25dfbdb6c5dd3c0bd78c7134c14045ddb7647bcf&name_0=MasterCI&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%206%2F6%29
Caused by: #112984
Changelog category (leave one):
Workflow [PR]
Sync PR [sync-upstream/pr/117411]