Repository navigation
Description
✅ I checked the Altinity Stable Builds lifecycle table, and the Altinity Stable Build version I'm using is still supported.
Type of problem
Bug report - something's broken
Describe the situation
On a two-replica ReplicatedMergeTree over a shared CAS pool, the green-path CAS soak (phase 1: inserts/merges/mutations, no chaos) loses a replica after two successful checkpoints. HTTP to that replica starts resetting or refusing connections. The dying INSERT is deterministic for --seed 1: op_id=102, target=0.
This is an availability failure, not a pool-corruption failure. cas-fsck at the last successful checkpoint and in the failure dump is clean (dangling=0, unreachable=0, stale_edge=0). There is no <Fatal>, no core dump, and (on the regression topology, which does not set a 28g mem_limit) no OOM: Docker still reports the container healthy while the published HTTP port is already dead.
Every clickhouse-server.err.log error on both replicas is the CAS relink confirm refusal:
Code: 210. NETWORK_ERROR
Source … did not prove it still holds the manifest it offered for part … by relink;
the relink is abandoned and the fetch will be retried later.
#2219 documents that this throw is a designed retry-later outcome and should not be logged at Error. That issue also states that replication still converges and lag stays flat. Soak phase 1 disagrees on availability: under the same refusal storm a replica stops answering HTTP, so the cluster is not merely noisy — it is no longer queryable on that node.
This issue:
- Kills replica HTTP during green-path CAS replication (no injected faults)
- Reproduces on both the upstream
utils/ca-soakcompose (PR #2073) and thecas/soakport inclickhouse-regression - Leaves the CAS pool consistent (
fsck dangling=0) - Is not explained by a bad soak port: Python diffs vs PR [WIP] CAS draft (adopting to CI/CD, not for review / merge) #2073 are only helpers.cluster env wiring (
CA_SOAK_*, chaos restart ofclickhouse-server); phase 1 does not use chaos
How to reproduce the behavior
Environment
- Version:
26.6.2.20000.altinityantalya - Build type: release, ARM (
build_arm_release) - Package: PR #2159
187e06612862e0000e7ac0431ced66ded8283beahttps://altinity-build-artifacts.s3.amazonaws.com/PRs/2159/187e06612862e0000e7ac0431ced66ded8283bea/build_arm_release/clickhouse-common-static_26.6.2.20000.altinityantalya_arm64.deb
- Also seen on the same PR at
f76335f4d1a3933d80fe9812e47eca3f61eaa686 - Topology: 2 replicas, one RustFS CAS pool, ClickHouse Keeper (upstream compose) or ZooKeeper (
cas/soaksoak_env)
A one-row relink smoke on the same cluster does work (INSERT on replica 1, SELECT on replica 2 returns the row). The failure needs the soak write rate (many small parts, overlapping fetches).
Steps (upstream harness, PR #2073)
-
Mount the 26.6 CAS-capable binary at
build/programs/clickhouse(the compose bind-mounts it over/usr/bin/clickhouseinclickhouse/clickhouse-server:25.8). -
From
utils/ca-soak:
docker compose up -d
# wait until http://localhost:8123/ping and :8124/ping answer
PYTHONPATH="$(pwd)" python3 -m soak.run --seed 1 --phase 1 --ops 200 --checkpoint-every 50- Same shape via the regression port:
cd cas/soak
./regression.py --local --with-analyzer \
--clickhouse-binary-path '<the same .deb URL>' \
--suite phase1 --seed 1Expected behavior
Phase 1 should finish 200 ops with checkpoints at 50 / 100 / 150 / 200. Both replicas should keep answering HTTP. Relink confirm refusals may happen and should retry (see #2219); they must not take a replica offline.
Actual behavior
On release builds
Checkpoints 50 and 100 succeed (dangling=0). Immediately afterwards the driver dies:
[soak.run] checkpoint OK: … dangling=0 stale_edge=0 dryrun_count=0
[soak.run] checkpoint GC PHASES [Node(localhost:8123)]: GC PHASES rounds=48 …
[soak.run] checkpoint GC PHASES [Node(localhost:8124)]: unavailable (node unreadable, …)
TRANSPORT FAILURE: [Errno 54] Connection reset by peer
# regression soak_env: clickhouse1 HTTP resets; clickhouse2 still answers `1`
# upstream compose: Connection refused after the peer exits / stops listening
Failure dump (failure.json / soak stdout):
"op_id": 102,
"last_op": {"op_id": 102, "type": "insert", "target": 0, "param": 52792},
"error": "TRANSPORT FAILURE: …",
"fsck": { "dangling": 0, "unreachable": 0, "stale_edge": 0 }
clickhouse-server.err.log on both replicas is dominated by:
<Error> ca_soak.ca_stress (…): … processQueueEntry …:
Code: 210. DB::Exception: Source … did not prove it still holds the manifest
it offered for part 20260818_3_3_0 by relink; the relink is abandoned and the
fetch will be retried later. (NETWORK_ERROR)
4. DB::DataPartsExchange::Fetcher::relinkPartToDisk(...)
5. DB::DataPartsExchange::Fetcher::fetchSelectedPart(...)
7. DB::StorageReplicatedMergeTree::fetchPart(...)
8. DB::StorageReplicatedMergeTree::executeFetch(...)
Observed counts on the PR #2073 compose run with the 187e0661… binary: 278 such errors on ch1, 214 on ch2, plus 5× Code: 1000 on each. Zero <Fatal> lines.
On the cas/soak topology (no 28g mem_limit): both containers stayed Up (healthy) while host curl :8123/ping was already Connection reset and :8124 still returned 1. Docker healthcheck ≠ HTTP alive.
Root cause analysis
Not fully pinned. The throw site is intentional taxonomy row 3 in DataPartsExchange.cpp:
throw Exception(ErrorCodes::NETWORK_ERROR,
"Source {} did not prove it still holds the manifest it offered for part {} by relink; "
"the relink is abandoned and the fetch will be retried later",
fetch_uri.getHost(), part_name);CasRefLedger::confirmExactRef returns Unknown when the source ref lane is not quiescent (lane_state != Ready, pending work, or leader_active). The receiver then abandons that relink and the replicated-queue retries later. #2219 is about logging that as Error.
What soak adds: under a burst of small parts the retry loop and confirm HTTP (cas_confirm) run concurrently with live inserts. Something on the source replica then stops serving HTTP (reset / refuse) without a Fatal. Candidates to investigate, not confirmed:
- Confirm / fetch HTTP on the source replica saturating or wedging the server HTTP path (healthcheck inside the container can still pass while the published port resets)
- Retry amplification:
NETWORK_ERRORis in the retry-later class, so a busy lane produces a storm ofrelinkPartToDiskattempts against a source that is itself writing - Memory: upstream compose sets
mem_limit: 28gper node. On a 16 GiB Docker Desktop VM a lowered 4g cap cgroup-OOM-killed ch2 after the relink storm had already started; the regression soak_env run (no such cap) still lost HTTP without OOM. Treat OOM as a possible aggravator, not the primary explanation
Additional context
Related
- #2219 — same exception, scoped to log severity; claims no replication/availability impact
- PR #2159 — CAS on
antalya-26.6(binary under test) - PR #2073 —
utils/ca-soakharness (cas-gc-rebuild)
Notes
- Phase 1 sets
transport_resilient=False, so the first HTTP reset ends the soak. That is harness policy; the replica going dark is the product bug - Single-row relink smoke (
CREATE+INSERT+SYSTEM SYNC REPLICA+SELECT) passes on the same binary and compose - Local logs from the PR [WIP] CAS draft (adopting to CI/CD, not for review / merge) #2073 run:
utils/ca-soak/logs/phase1_upstream_187e066.logandutils/ca-soak/logs/archive_4g/ch{1,2}.err.logon the machine that reproduced it
Activity
DimensionWieldr commentedon Aug 20, 2026
Was not able to reproduce this on ARM runner in clickhouse-regression CI: https://github.com/Altinity/clickhouse-regression/actions/runs/32292821417
The run passed phase 1.
I'm going to run all phases and scenarios and report back results.
filimonov commentedon Aug 20, 2026
Adjudicated against the current
cas-gc-rebuildhead (functionally identical to the187e0661/f76335f4snapshots — nothing insrc/changed since 2026-08-05).The refusal storm is known, designed behavior (same finding as #2219).
confirmExactRefrule 3 is a table-scoped, wait-free quiescence snapshot: any pending ref-lane work on the source refuses every confirm withUnknown, so a continuously-writing source refuses most relink confirms. Fail-closed by design — the confirm is zero-I/O so a peer cannot amplify it into work on the writer; the receiver abandons, the queue backs off (≤60 s) and eventually byte-fetches. Measured on 2026-07-29: ~248k refusals in 32 min, peak 9,219/min, zero correctness or availability consequence. Open follow-ups tracked: log demotion (#2219), proven/refused ProfileEvents, naming the refusing rule, and a per-ref refinement of rule 3 (the actual availability fix).The causal claim does not reproduce. Exact recipe (PR #2073 compose, fresh pool,
--seed 1 --phase 1 --ops 200 --checkpoint-every 50, release binary at head), on a 91 GiB bare-metal Linux host: all four checkpoints green (dangling=0), op 102 uneventful,PHASE1 OK, both replicas answering/pingthroughout — while generating 207,627 refusals on ch1 + 85,912 on ch2, ~1000× the issue's counts. A 90-minute phase-3 soak with 112k refusals is also on record, green. The storm does not kill HTTP; the replica death is a separate variable.Likelier explanations for the observed death:
mem_limit: 28g× 2 on a 16 GiB Docker Desktop VM — the VM's OOM killer SIGKILLs the server process with no cgroup event, no<Fatal>, no unhealthy container. "Connection refused after the peer exits" matches exactly.ch1has a healthcheck; "healthy container, dead HTTP" on ch2 is vacuous — Docker was never asked. (Harness gap, now in the backlog.)transport_resilient=False), checkpoints don't gate on HTTP health, andTRANSPORT FAILUREis the driver'selse-branch catch-all — the headline string classifies "something non-query threw", it diagnoses nothing.The abandoned-relink path was audited for fd/socket/thread leaks: none (both HTTP buffers drained and returned to the pool before the throw; the precommit released by
SCOPE_EXIT).One server-side lead not excluded, if the process was still alive when 8123 reset: all listeners share one Poco thread pool capped at
max_connections, and Poco has a documented defect (comment inbase/poco/Net/src/TCPServerDispatcher.cpp) where a saturated shared pool silently drops accepted sockets — reset for the client, nothing aboveWarningin the log. Refusals feed it indirectly: they degrade relinks into byte fetches, which do hold interserver threads. Shape-match, not proof.To settle it, capture on a re-run:
dmesginside the Docker Desktop VM (Out of memory: Killed process ... clickhouse-serv);Warninglines "Got an exception while starting thread for connection" inclickhouse-server.log;max_connectionsat death;system.replicated_fetches(byte-fetch spike);phase1_upstream_187e066.log,archive_4g/ch{1,2}.err.log) — not present on the shared machine.Bottom line: the storm part is the known #2219 behavior with tracked follow-ups; "storm kills replica HTTP" is counter-evidenced at 1000× scale and does not reproduce. Pending the data above, the death is most consistent with VM-level OOM on an undersized Docker Desktop VM.
filimonov commentedon Aug 20, 2026
TLDR version: problem with HTTP - can't reproduce (need artifacts from your run), others are known behavior. some minors noted to backlog.
UPD: checking if can be connected to #2243
DimensionWieldr commentedon Aug 20, 2026
Follow-up to the ARM CI phase-1 pass (run 32292821417).
On a dedicated aarch64 box, I ran
cas/soak--suite all --seed 1 --with-analyzeragainst the same package as this issue:https://altinity-build-artifacts.s3.amazonaws.com/PRs/2159/187e06612862e0000e7ac0431ced66ded8283bea/build_arm_release/clickhouse-common-static_26.6.2.20000.altinityantalya_arm64.debHost: Ubuntu 24.04, 8 vCPU, 31 GiB RAM, 180 G disk. Topology is
cas/soak/soak_env_arm64(2 replicas, one RustFS pool, ZooKeeper).--reuse-envleft the stack up after failure..debof the same SHANETWORK_ERRORstorm present; HTTP stayed up).deb.debPhase 2 died on the HTTP-availability failure, not pool corruption:
The driver retried
INSERT op_id=50through 39 transport failures (Connection refused/Connection reset by peer) before giving up. This is phase 2, so there was an injectedclickhouse1restart ~9 minutes in — not the green-path-only recipe in the issue body.After the suite exited, Docker still reported both ClickHouse containers
Up (healthy)andOOMKilled=false. Native protocol and HTTP were already dead:curl :8123/ping/:8124/ping→ connection failedclickhouse clienton clickhouse1 →Code: 210 Connection refused (localhost:9000)So: phase 1 still does not reproduce the green-path HTTP death here, including on a real ARM host. Phase 2 did leave both replicas unqueryable while cgroup healthchecks stayed green — same availability signature as this issue, under chaos rather than green-path load.
DimensionWieldr commentedon Aug 20, 2026
Phase 3 on the same dedicated aarch64 box (
--seed 1, same187e066arm64.deb,--phase3-duration 4h, default--workers 6) failed at 43m, still in steady (chaos had not started).Not the HTTP-death signature. Both
/pingendpoints stayed up. The driver died on:Code: 252 TOO_MANY_PARTS— 3001 parts, avg 28 KiB, on clickhouse2 (INSERTintoca_soak.ca_stress). Merges could not keep up with inserts on my 8-vCPU host.Doesn't seem like a CAS issue, I'll run again with less workers so as not to overload the machine.
filimonov commentedon Aug 20, 2026
The phase-2 death is solved from the post-mortem bundle: it is a bug in the
cas/soakport in Altinity/clickhouse-regression, not a server availability bug. After a chaos fault the server is simply never started again.Evidence (from the bundle):
docker ps: both ClickHouse containers runtail -f /dev/nullas PID 1, and the healthcheck is literallytest: echo 1, so "healthy" is unconditional — both come fromcas/soak/soak_env_arm64/clickhouse-service.yml:25-27; the server is exec'd into the container by the harness at env-up.docker inspect: both containers were restarted by chaos (ch2StartedAt19:08:40Z, ch1 19:10:00Z — thet_offset=529fault) — created at 18:58Z, i.e. same containers, restarted in place.Starting ClickHouseand oneReady for connectionsper node for the whole run; ch2's log ends at 19:08:39Z — one second before its container'sStartedAt. No second start was ever attempted.docker-proxyaccepts and resets — nothing behind it. Both replicas ended serverless because each took a fault.The bug —
cas/soak/soak/chaos.py:111-128,_ensure_clickhouse_daemon(called fromapply_faultafter every CHKILL/RESTART,chaos.py:153and:163):The guard tests pidfile existence as a server-aliveness probe. The container filesystem survives
docker restart/docker kill && docker start(same container, same writable layer), and a SIGKILLed server does not remove its pidfile — so after every chaos fault the stale pidfile makes the probe return 0 and the function no-ops. The guard was written to be a no-op on the upstream compose (where the entrypoint starts the server), but the chosen discriminator false-positives on the port's own topology.Fix (in clickhouse-regression):
and
rm -f /tmp/clickhouse-server.pidbefore launching the daemon. Two adjacent gaps worth the same pass: theecho 1healthcheck inclickhouse-service.yml:27(and the twin incas/soak/soak_env/) should be a real probe (HTTP/ping), and it is worth checking why the driver's recovery HTTP wait (cas/soak/soak/cluster.py:296) did not surface the serverless node for ~349 s (t=529 fault → driver death at 878 s).For contrast, the same fault shapes on the upstream PR #2073 harness (where the server IS the container entrypoint, so
docker restartrestarts it by construction) pass: phase 2 withch1/restart/40s,ch1/kill/42s,ch1/kill/36sand a ch2 restart completed green, both replicas answering throughout.Scope note: this closes the phase-2/dedicated-box signature only. The original green-path phase-1 laptop failure remains unreproduced (four green runs across three hosts/arches at this point, including ~1000× the refusal volume) — the environmental suspects from the earlier comment still stand for that one.
DimensionWieldr commentedon Aug 21, 2026
Seems like there are a few race conditions and other bugs in the soak tests on regression raising false positives. I've been fixing them, hopefully it doesn't take too long. 🤞
UPDATE:
Phase 3 passes after some fixes to the cas soak regression suite. Going to rerun Phase 2 to see if that was caused by test bugs as well. Then going to run soak scenarios.
UPDATE 2:
Rerun of Phase 2 passed on both AMD and ARM.
Soak scenarios have a lot of bugs. Hard to tell what is a test harness bug and what's a real CAS implementation issue, will report back after some more fixes. For now there are 11 scenarios out of 45 failing, and about half seem to be real issues.
ca: backlog — issue #2233 adjudication residue (ch2 healthcheck, TRAN…
DimensionWieldr commentedon Aug 22, 2026
Scenario suite (AMD) after harness fixes
Green-path HTTP death from this issue still has not reproduced. Phases 1–3 already pass on AMD and ARM. This is the scenario cards on AMD after the remaining harness FAILs were fixed (
d13f46cb3in clickhouse-regression).187e066—26.6.2.20000.altinityantalyaamd64--suite scenarios --seed 1 --scenario all --scenario-scale ciFAIL — CAS
Build::putBlobString copy). Pool/fsck clean. Known.uploadFromSourceUNCERTAIN / mount lease not held). Not TOO_MANY_PARTS. Remaining inserts + fsck succeeded (dangling=0).Connection refusedfor the rest of the card; heal timeout 300s). Replica agreement / fsck inconclusive because the node stayed down.S3_ERRORTimeout onsoak_pool/gc/state. RustFS write error rate ~33% in that window.stageManifest/ mount fence dropped) rather than onlyMEMORY_LIMIT_EXCEEDED. GC still had Failed rounds after disarm.CASRefNeedsRecovery=0this run.INCONCLUSIVE — not CAS (card/infra reach)
CASBlobGet— both 0 (cache/inline at ci).kMaxManifestEntries=1M).CASRootCompareSwap=0— counter may not be per-node.cas/ns/stream/for the late-PUT injection.I ran ARM scenario but the disk filled during S13 (RustFS volume ~157G on a 180G disk). Suite process died mid-fsck. Will rerun ARM on a larger disk or with a pool cap.
cas: classify transient GC round failures and keep leadership through…
cas: stream the emulated blob publication instead of materializing th…
ca-soak: score Aborted GC rounds benign and fix the S01 measurement p…
ca-soak: make S01/S02 runnable at full scale, and cap client S3 concu…
cas: classify transient GC round failures and stream emulated blob pu…
filimonov commentedon Sep 14, 2026
Closing as not reproduced / superseded. The green-path HTTP death never reproduced, including the reporter's own AMD and ARM runs (phases 1–3 pass); the phase-2 death was a
cas/soakharness bug in clickhouse-regression (server not restarted after a chaos fault), fixed there.The refusal storm is designed behaviour; its logging and error class are fixed (#2219,
NO_REPLICA_HAS_PARTin antalya-26.6).The scenario residue landed in antalya-26.6 via #2300: S28/S42 (GC round classification, retries,
error_codeincas_gc_log) and the S01 lever in 2975ced; S08/S13 are the port-exhaustion class, tracked by #2243 (closed) and #2332 (open).Anything left from the scenario cards should go to #2332 or a fresh issue with the card's artifacts.