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
A sustained S3 503 on PUT and POST drops the CAS mount lease. Inserts fail with Code 210, mount lease not held. The server never logs the CasMountLeaseKeeper lines that are supposed to explain that drop: a transient renewal failure, or the mount-lease stops advancing.
A shorter 503, held for 8 seconds, is under the 10-second renew period and must not fence the lease. That window also produced none of the transient renewal lines, so the log does not show whether the renewer saw the fault.
Seen in a local soak run of scenario S39 (mount-lease resilience under a degraded-but-alive S3) on 22 Sep 2026. After the fault was cleared, writes resumed, both replicas agreed, and cas-fsck reported dangling=0. The data survived. The lease loss is invisible in the renewal log.
This issue:
- Reproduces the lease drop with an injected
503, not with port exhaustion or a quietSELECT FINAL - Loses the mount on a 40-second
503(past the 30-second lease TTL) and returns Code 210 - Emits zero
background renewal failed transientlylines and zerothe mount-lease stops advancinglines insystem.text_logandclickhouse-server.log
How to reproduce the behavior
Environment
- Version:
26.6.4.20001.altinityantalya(altinity/clickhouse-server:26.6.4.20001.altinityantalya) - Build type: release
- Cluster: 2 replicas. The
cadisk endpoint is an S3 proxy in front of RustFS.system.text_logis enabled. - Lease:
mount_lease_ttl_ms=30000,mount_renew_period_ms=10000(from theCasRequestBudgetlog line on startup)
Steps
-
Create a replicated table on the
capolicy and insert enough rows that the mount is live. -
Arm the proxy so every PUT and POST returns
503. Hold that for 8 seconds, then disarm. Searchsystem.text_logand the server log forbackground renewal failed transiently, retrying while the lease is still valid. -
Arm the same
503again and hold it for 40 seconds while an INSERT andOPTIMIZErun. Then disarm, wait 20 seconds, and insert again.
proxy control: {"rate": 1.0, "modes": ["503"], "methods": ["PUT", "POST"]}
Expected behavior
During the 8-second fault, the renewer logs a transient retry if the fault hits a renewal, and the lease does not fence.
During the 40-second fault, the lease fences, and the log contains background renewal failed, the mount-lease stops advancing. After the 503 stops, a new INSERT commits and both replicas match.
Actual behavior
On release builds
The 8-second window logged 0 transient renewal lines and 0 fence lines.
The 40-second window failed the in-flight INSERT with:
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)
The same Code 210 appears on interserver requests during that window. system.text_log and clickhouse-server.log contain 0 rows for background renewal failed, the mount-lease stops advancing. The only hits for that phrase are the SELECT that searches for it.
After a 20-second settle, the next INSERT committed. Both replicas reported 2000 rows and the same checksum. cas-fsck reported dangling=0.
Additional context
Local run, not CI. Dev scale of scenario S39 in cas/soak_tests: 2000 rows, 512-byte payload, 8-second then 40-second 503.
#2243 quotes these same CasMountLeaseKeeper lines, produced there by ephemeral-port exhaustion (EADDRNOTAVAIL). This run had no EADDRNOTAVAIL. #2332 is a lease drop with no renewal log line, triggered by concurrent SELECT FINAL on a quiet store rather than by a 503.
Activity
filimonov commentedon Sep 24, 2026
Thanks for the detailed report. Two points:
1. The log lines you searched for no longer exist in this version.
background renewal failed transiently, retrying while the lease is still validandbackground renewal failed, the mount-lease stops advancing(loggerCasMountLeaseKeeper) were removed in 7f932d3 (2026-08-25), before the26.6.4.20001.altinityantalyatag. They were quoted in #2243 and #2332 from older builds.In 26.6.4 the renewer logs under
CasMountLeaseRenewer:CAS mount renewal '<root>' physical retry attempt N ...at DEBUG level, one per retryCAS mount renewal '<root>' recovered after N physical attempts in M ms ...at INFO levelCAS mount renewal '<root>' fenced after N physical attempts in M ms (classification=...)at WARNING levelIt also writes a
watermark_renewevent tosystem.cas_logand incrementsCASMountRenewalAttempts,CASMountRenewalRetries,CASMountRenewalRecovered,CASMountRenewalDeadlineExceededandCASMountLeaseLostinsystem.events. The S39 card asserts on these counters, not on log text.2. The lease loss during the 40-second
503is expected.Lease renewal is an S3 PUT. If every PUT fails for 40 seconds, the lease cannot be renewed and must fence after the 30-second TTL. The
Code 210 ... TRANSIENT unavailability, not damageerror, followed by recovery once the fault clears, is the designed behavior, and your run confirms it (writes resumed, replicas match,dangling=0).For the 8-second window, zero lines is also possible: the renew period is 10 seconds, so an 8-second fault may not overlap a renewal at all. If it does, you will see the INFO
recoveredline and a nonzeroCASMountRenewalRetries.Could you rerun and check:
If the 40-second fault produces no
fencedWARNING and noWatermarkRenewevent, please reopen with that output. Otherwise I will close this as working as designed.DimensionWieldr commentedon Sep 24, 2026
Reran S39 on
26.6.4.20001.altinityantalya(dev scale: 8s then 40s of S3 503). The 40-second fault does produce the new renewer records.clickhouse1fenced:system.cas_loghas onewatermark_renewat 19:14:09,outcome=failed,reason=CAS mount renewal ended without retained authority and fenced the mount,classification=external_lease_deadline,attempts_sent=5.clickhouse2recovered on the same window instead of fencing:Its
watermark_renewrow is at 19:14:12.CASMountRenewalAttemptsis 5 there. Neither replica hasCASMountRenewalRetries,CASMountRenewalRecovered,CASMountRenewalDeadlineExceeded, orCASMountLeaseLostinsystem.events.The scenario stopped when the next INSERT hit Code 210 (
mount lease not held), so it did not finish the settle and recovery checks. The fenced WARNING and thewatermark_renewevent are both present.DimensionWieldr commentedon Sep 24, 2026
Closing this. The two log lines in the report were removed before 26.6.4, and a 40-second S3 503 is supposed to fence the mount lease.
A rerun on 26.6.4.20001.altinityantalya shows the replacement records:
CasMountLeaseRenewerlogsfenced after … (classification=external_lease_deadline)at Warning, andsystem.cas_logwriteswatermark_renewwithoutcome=failed. The Code 210 that follows is the mount refusing writes until it recovers.S39 now checks those. The short window no longer requires the deleted "retrying while the lease is still valid" line, because an 8-second fault can miss the 10-second renew beat. It fails only if that window logs
fenced after. The long window fails unless it logsfenced afterand a failedwatermark_renew.docs(cas): Backlog.md, canary label and priority floor (user directiv…