Repository navigation
Retry docker compose up for the ClickHouse nodes in integration tests - #122343
alexey-milovidov merged 1 commit into
Conversation
The `docker compose up -d --no-recreate` that brings up every ClickHouse node of a module had no retry, unlike the ZooKeeper/Keeper compose ups in the same function, so a transient Docker failure on a single container took down every test of the module. Seen on https://github.com/ClickHouse/ClickHouse/actions/runs/36126873809/job/108048678812 (Integration tests (amd_tsan, 3/6) on ClickHouse#122210, report https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122210&sha=317cd284cb24361af84aa3a2cc1f3ad6e3865d2e&name_0=BackportPR&name_1=Integration%20tests%20%28amd_tsan%2C%203%2F6%29): one of nine node containers failed container init with failed to set IPv6 gateway while updating gateway: route for the gateway 2001:3984:3989::1 could not be found: network is unreachable while the other eight nodes started on the same bridge in the same second, and the three Keeper containers had been running on it for about 6 s. `docker compose` returned 1, the module-scoped fixture died, and all 13 tests of `test_dns_cache` were reported as errors. The in-job rerun cannot help: it only re-runs failed cases when there are fewer than 10 of them. `up -d --no-recreate` leaves the already-running containers alone and starts the one left in `created` state, which then re-acquires the static address the daemon had released, so a retry recovers this state. Retry parameters and the log function match the ZooKeeper/Keeper compose ups in the same function, added for the same reason in ClickHouse#99525. A deterministic startup failure still fails, with its original message and exit code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 3 passes, 2 findings) plus my own
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20260925-214800 |
|
Workflow [PR], commit [1198ee9] Summary: ✅ AI ReviewSummaryThis PR wraps the module-wide Final Verdict
LLVM Coverage ReportMeasured on commit 1198ee9.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +188 lines in 45 files (-138 lines lost coverage) · Details |
`ClickHouseCluster.start` ran the MongoDB and MinIO `docker compose up`
once, so a transient per-container daemon error lost the whole module.
On 26.7 the MongoDB up failed with
failed to create endpoint roottesttablefunctionmongodb-gw0-mongo1-1 on
network roottesttablefunctionmongodb-gw0_default: failed to add the host
(veth2d10e1f) <=> sandbox (veth2d10e1f) pair interfaces: file exists
and all 16 tests of `test_table_function_mongodb` failed:
https://github.com/ClickHouse/ClickHouse/actions/runs/38284747320/job/114936343879
https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=26.7&sha=bc135b699eafe550939f3eb17885f541f5dfa226&name_0=ReleaseBranchCI&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%205%2F8%29
CI's docker-ce 27.0.3 draws the host-side and the container-side veth
names independently and never compares them, so with probability 2^-28
per endpoint both ends get the same name and the pair cannot be created.
The same error hit the MinIO up on
ClickHouse#119134
(https://github.com/ClickHouse/ClickHouse/actions/runs/36144124883/job/108126010556),
and an OOM-killed container init failed it on master
(https://github.com/ClickHouse/ClickHouse/actions/runs/33353696579/job/99381397549).
`up -d` converges: running containers are left alone and the container
left in `created` state is started, so another attempt recovers. Add a
`compose_up` helper with the retry the ZooKeeper/Keeper and ClickHouse
node ups already use (ClickHouse#99525, ClickHouse#122343), and route those three sites and
the MongoDB and MinIO ups through it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #99525
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
ClickHouseCluster.startbrings up every ClickHouse node of a module with onedocker compose up -d --no-recreate. Unlike the ZooKeeper/Keeper compose ups in the samefunction, that call has no retry, so a transient Docker failure on a single container loses every
test of the module.
Failing job:
Integration tests (amd_tsan, 3/6)
on #122210
(report).
All 13 tests of
test_dns_cacheerrored, and this was the only failing check of that commit. Oneof the nine node containers failed container init:
The other eight nodes started on the same bridge in the same second, and the three Keeper
containers had been running on it for about 6 s, so this is transient and per-container. The
in-job rerun does not rescue it: it re-runs failed cases only when there are fewer than 10 of
them, and there were 13.
A retry recovers the state such a failure leaves behind:
up -d --no-recreateleaves the runningcontainers alone and starts the one left in
createdstate, which re-acquires its pinned address.Parameters and log function match the ZooKeeper/Keeper ups, added for the same reason in #99525.
A deterministic failure still propagates with its original message, and a server that fails to
start is unaffected:
up -donly starts containers, and readiness is still asserted bywait_for_startoutside the retry. Only this call site changes: it is the one composeupthatevery module runs.
Validated by injecting a failure into the first attempt:
test_dns_cacheerrors without thechange and passes with it, and the full module is green three times with it and once without.
Workflow [PR]
Sync PR [sync-upstream/pr/122343]
Version info
26.10.1.780-master(included in26.10and later)