Skip to content

Retry docker compose up for the ClickHouse nodes in integration tests - #122343

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:retry-compose-up-clickhouse-nodes
Sep 26, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:retry-compose-up-clickhouse-nodes

Conversation

@groeneai

@groeneai groeneai commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #99525

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

ClickHouseCluster.start brings up every ClickHouse node of a module with one
docker compose up -d --no-recreate. Unlike the ZooKeeper/Keeper compose ups in the same
function, 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_cache errored, and this was the only failing check of that commit. One
of the nine node containers failed container init:

failed to set IPv6 gateway while updating gateway: route for the gateway 2001:3984:3989::1 could not be found: network is unreachable

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-recreate leaves the running
containers alone and starts the one left in created state, 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 -d only starts containers, and readiness is still asserted by
wait_for_start outside the retry. Only this call site changes: it is the one compose up that
every module runs.

Validated by injecting a failure into the first attempt: test_dns_cache errors without the
change 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

  • Merged into: 26.10.1.780-master (included in 26.10 and later)

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]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Sep 25, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
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
cold review each round. No finding was about the code; all were about the commit message and PR
text, and all were fixed before the push.

# Sev Finding Verdict Evidence / action
1 ⚠️ Both texts called this the only compose up in ClickHouseCluster.start without a retry AGREE, fixed before push 33 other ups in that function are still bare; both texts now say it had none, unlike the ZooKeeper/Keeper ups
2 ⚠️ Both texts had the Keeper containers starting in the same second as the nodes AGREE, fixed before push Daemon log: they started about 6 s earlier, from the earlier Keeper up
3 💡 Quoted daemon error was not a contiguous substring of the log line AGREE, fixed before push Now verbatim
4 💡 Commit subject lacked inline code; message lacked the report URL and PR link AGREE, fixed before push Added
5 💡 Body credited --no-recreate with starting the created container, and wrote start() AGREE, fixed before push Reworded: up starts it, --no-recreate leaves the running ones alone

Severity: ❌ blocker / ⚠️ major / 💡 nit. Checked and unchanged: retry re-raises the last
exception, so a deterministic failure keeps its message; wait_for_start stays outside the retry.

Session id: cron:clickhouse-review-slot-10:20260925-214800

@clickhouse-gh

clickhouse-gh Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1198ee9]

Summary: ✅


AI Review

Summary

This PR wraps the module-wide docker compose up -d --no-recreate for ClickHouse nodes in the same retry helper already used for ZooKeeper/Keeper startup. The retry stays scoped to container startup, wait_for_start still validates readiness outside the retry loop, and the last exception still propagates on persistent failure, so I do not see an unresolved correctness or failure-mode regression in the current implementation.

Final Verdict
  • Status: ✅ Approve

LLVM Coverage Report

Measured on commit 1198ee9.

Metric Baseline Current Δ
Lines 88.20% 88.20% +0.00%
Functions 91.80% 91.80% +0.00%
Branches 79.40% 79.50% +0.10%

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

Full report

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 25, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Sep 25, 2026
@alexey-milovidov alexey-milovidov self-assigned this Sep 26, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 26, 2026
Merged via the queue into ClickHouse:master with commit ff1d0ed Sep 26, 2026
176 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 26, 2026
valerypetrov pushed a commit to valerypetrov/ClickHouse that referenced this pull request Oct 13, 2026
`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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-testing Test content only (no production code). groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants