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
An 8-second burst of S3 503s on PUT and POST fences the CAS mount lease. The renew period is 10 seconds and the lease TTL is 30 seconds, so that window can overlap at most one renewal. The renewal that hits it should recover. Instead CasMountLeaseRenewer fences in about 2 seconds and reports classification=external_lease_deadline while remaining_confirmed_budget_ms is still about 17000. The next INSERT fails with Code 210, mount lease not held.
This showed up while rechecking the short fault in the S39 soak card, after #2423. That issue was a stale log line on a 40-second fault, which is supposed to fence. This one is the 8-second fault.
This issue:
- Fences on a fresh pool, with no earlier
fenced afterline insystem.text_log - Leaves about 17 seconds of confirmed budget at the moment of the fence
- Reproduced on two wiped clusters. The first time both replicas fenced. The second time
clickhouse2fenced andclickhouse1loggedrecovered after
How to reproduce the behavior
Environment
- Version:
26.6.4.20001.altinityantalya - Build type: release
- Image:
altinity/clickhouse-server:26.6.4.20001.altinityantalya
Steps
-
Start two replicas with a fresh
cadisk and an empty object-store prefix. Point the disk through an S3 fault proxy. The proxy is disarmed (rate0).writer_epochin these runs is 2 because the server restarts once to attach the proxy. There is no prior fence. -
Create a replicated table on the
cadisk and insert some rows. -
Arm the proxy for 8 seconds: every PUT and POST returns 503. Then set the rate back to 0.
-
Read the renewer log and the CAS log for that window.
SELECT event_time, level, message
FROM system.text_log
WHERE logger_name = 'CasMountLeaseRenewer'
ORDER BY event_time;
SELECT event_time, outcome, detail
FROM system.cas_log
WHERE event_type = 'watermark_renew'
ORDER BY event_time;Expected behavior
A renewal that overlaps the 8-second fault logs recovered after and keeps the lease. A renewal that misses the 10-second beat logs nothing. The following INSERT succeeds. The lease fences only when the fault is held past the 30-second TTL.
Actual behavior
On release builds
Run 1, both replicas, fence at 23:03:35, seven seconds after the window opened at 23:03:28.
clickhouse1:
CAS mount renewal 'ca_soak_clickhouse1' fenced after 5 physical attempts in 2255 ms (classification=external_lease_deadline, confirmed_deadline_boot_ms=146964336)
watermark_renew outcome=failed, elapsed_ms=2255, remaining_confirmed_budget_ms=17745, writer_epoch=2.
clickhouse2: fenced after 5 physical attempts in 1803 ms, remaining_confirmed_budget_ms=18197.
The next INSERT failed:
Code: 210. DB::Exception: content-addressed disk 'ca' -- mount lease not held; backing may be temporarily unreachable; the operation is admitted again once the disk recovers to Live; TRANSIENT unavailability, not damage. (NETWORK_ERROR)
Run 2, fresh pool. The short window opened at 23:06:41.
clickhouse1 recovered at 23:06:49: recovered after 8 physical attempts in 3576 ms (classification=committed_after_retry), remaining_confirmed_budget_ms=16424.
clickhouse2 fenced at 23:06:49: fenced after 6 physical attempts in 2634 ms (classification=external_lease_deadline), remaining_confirmed_budget_ms=17366, writer_epoch=2.
The S39 card only queries clickhouse1, so this run passed the short-fault check.
Additional context
The same classification also fires a few seconds into the 40-second fault, again with about 17 seconds of budget left (clickhouse1 at 23:06:58, elapsed_ms=2527, remaining_confirmed_budget_ms=17473). A fault that long is supposed to fence after the TTL. Fencing in 2.5 seconds is the same early deadline.
Related: #2423 (closed; the 40-second fault does emit the new renewer records).
Activity
DimensionWieldr commentedon Sep 24, 2026
The
clickhouse-server.logfrom run 2 shows the renewal PUT itself getting the 503, then the renewer giving up while the object is still present.clickhouse2, during the 8-second window. Each attempt writessoak_pool/gc/server-roots/ca_soak_clickhouse2/mountand getsSlowDown:The last observation is
presentwith an etag, so the mount object was still there when the renewer fenced.clickhouse1in the same window took the other path. Same 503s on.../ca_soak_clickhouse1/mount, then:filimonov commentedon Oct 1, 2026
Confirmed. Real bug.
Working on a fix.
docs(cas): Backlog.md, real creation dates, GitHub CAS reconciliation…
spec(cas): background mount renewal retries without a lease deadline …
spec(cas): mount renewal r5: memory pressure (CAS-292), constraints r…
plan(cas): mount renewal without a lease deadline, part 1: the three …
backlog(cas): CAS-342, CAS-292, CAS-298 implemented on a local branch…
spec(cas): notes on mount lease settings that do not say what happens
docs: refine CAS lease recovery and PR boundaries
Renew the CAS mount lease until a definitive answer