From ed70862944a02727ad5c1841043c7d14189aa7ce Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 17:20:49 -0800 Subject: [PATCH 1/4] docs: host connect settings The operator guide gains "Host connect settings": the nvme connect options ctrl-loss-tmo, reconnect-delay and fast_io_fail_tmo, values derived from the longest wait for a target to serve again (the re-grant barrier, 65 s with default flags), what the guest sees with these values, with the kernel defaults (up to 10 minutes) and with values too short (I/O errors reach the filesystem), how a long blockmaster outage relates, and that the CSI node connects with the kernel defaults, so a pod whose holder does not return is recovered by recreating it. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operator-guide.md | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/seaweed-block/docs/operator-guide.md b/seaweed-block/docs/operator-guide.md index b55c515ff3..58b1780204 100644 --- a/seaweed-block/docs/operator-guide.md +++ b/seaweed-block/docs/operator-guide.md @@ -239,6 +239,43 @@ off or cut it from its clients, then run `sw-block ops failover` (see 4. Start `blockvolume` on the new node, then reconnect the guest. 5. Optionally restore an older snapshot into a new volume and verify it with `ops chunk verify --depth data`. +## Host connect settings + +The guest's kernel keeps an NVMe/TCP controller whose target went away and reconnects to it. Three `nvme connect` +options decide how long it waits and what the guest sees meanwhile: + +| Option | Kernel default | Set it to | Why | +|---|---|---|---| +| `--ctrl-loss-tmo` | 600 s | 180 | Longer than the longest wait for the same target to serve again: a restarted holder waits for the re-grant barrier, at most 65 s after it stopped with default flags (see [the symptoms table](volume-lifecycle.md#symptoms)) | +| `--reconnect-delay` | 10 s | 2 | The guest finds the target again within 2 s of it serving | +| `--fast_io_fail_tmo` | off | leave off | Any value shorter than the wait above fails I/O to the filesystem before the target serves again | + +```bash +sudo nvme connect -t tcp -a 127.0.0.1 -s 4420 -n "$NQN" --ctrl-loss-tmo=180 --reconnect-delay=2 +``` + +What the guest sees: +- **These values:** I/O waits while the target is away and continues when it serves again; a target that does not + come back fails I/O after 180 s. +- **Kernel defaults:** a target that does not come back holds I/O for up to 10 minutes (a 9-minute blocked read was + observed in a fault run), then fails it. +- **Too short** (`--ctrl-loss-tmo` or `--fast_io_fail_tmo` below the wait): I/O errors reach the filesystem before + the target serves again; ext4 mounted with `errors=remount-ro` turns read-only and must be remounted. + +A blockmaster outage longer than the lease stops the holders, and they serve again at least 50 s after blockmaster +is back (see [what a restart does to serving volumes](standalone-deployment.md#restoring-a-snapshot-into-a-new-volume)): +an outage of more than about 2 minutes outlasts 180 s. Raise `--ctrl-loss-tmo` if the guest must ride through +longer outages; I/O waits that long. + +A replicated `sync-quorum` volume gets its new primary about 30 to 35 s after its host is lost, with default flags +(derived from `--freshness-window` and the two probe rounds; not yet measured). The values above cover it; they +will be checked against the measured failover time. + +**Kubernetes.** The CSI node connects with a plain `nvme connect` and the kernel defaults. A pod whose holder does +not come back holds I/O for up to 600 s: its reads and writes block (processes in uninterruptible sleep, probes that +touch the volume time out), then fail. Recovery is by recreating the pod, which stages the volume again on the +current primary ([operations](operations-v1.md)). The CSI node passing the settings above is planned for 1.0.1. + ## A volume waiting for blockmaster A `blockvolume` that cannot get its lease from blockmaster waits inside its process: the unit stays **active** From 5b0f7c8e80190d40acf64e7b62df6559b3a1c415 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 17:26:10 -0800 Subject: [PATCH 2/4] docs: host connect settings, review changes - The ctrl-loss-tmo derivation shows its sum (re-grant, the start's grant wait, the unit restart: about 100 s) and the table is marked derived, not yet run. - reconnect-delay is a retry interval. - The blockmaster-outage sum: 20 s + the outage + 50 s, so more than about 110 s outlasts 180 s; the link names the restart text. - After a failover the options do not redirect the controller: a standalone guest reaches only its own host's loopback target, so it must run on the new primary's host and connect there (how to tell which host). - The standalone connect command carries the same options. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operator-guide.md | 40 ++++++++++++--------- seaweed-block/docs/standalone-deployment.md | 3 +- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/seaweed-block/docs/operator-guide.md b/seaweed-block/docs/operator-guide.md index 58b1780204..75ee2c4eda 100644 --- a/seaweed-block/docs/operator-guide.md +++ b/seaweed-block/docs/operator-guide.md @@ -241,13 +241,14 @@ off or cut it from its clients, then run `sw-block ops failover` (see ## Host connect settings -The guest's kernel keeps an NVMe/TCP controller whose target went away and reconnects to it. Three `nvme connect` -options decide how long it waits and what the guest sees meanwhile: +The guest's kernel keeps an NVMe/TCP controller whose target went away and keeps reconnecting to the same address. +Three `nvme connect` options decide how long it waits and what the guest sees meanwhile. The values below are +derived from the waits these pages state; they have not yet been run. -| Option | Kernel default | Set it to | Why | +| Option | Kernel default | Set it to (derived, not yet run) | Why | |---|---|---|---| -| `--ctrl-loss-tmo` | 600 s | 180 | Longer than the longest wait for the same target to serve again: a restarted holder waits for the re-grant barrier, at most 65 s after it stopped with default flags (see [the symptoms table](volume-lifecycle.md#symptoms)) | -| `--reconnect-delay` | 10 s | 2 | The guest finds the target again within 2 s of it serving | +| `--ctrl-loss-tmo` | 600 s | 180 | Longer than the longest wait for the same target to serve again: a restarted holder is re-granted at most 65 s after it stopped; a start not granted within 30 s after that barrier ends its wait, and the unit starts it again after `RestartSec=5s` ([after a crash](volume-lifecycle.md#after-a-crash)): 65 + 30 + 5 = about 100 s | +| `--reconnect-delay` | 10 s | 2 | The controller retries every 2 s; connection setup and the network add to it | | `--fast_io_fail_tmo` | off | leave off | Any value shorter than the wait above fails I/O to the filesystem before the target serves again | ```bash @@ -255,21 +256,28 @@ sudo nvme connect -t tcp -a 127.0.0.1 -s 4420 -n "$NQN" --ctrl-loss-tmo=180 --re ``` What the guest sees: -- **These values:** I/O waits while the target is away and continues when it serves again; a target that does not - come back fails I/O after 180 s. -- **Kernel defaults:** a target that does not come back holds I/O for up to 10 minutes (a 9-minute blocked read was - observed in a fault run), then fails it. +- **These values:** while the same target is away, I/O waits and continues when it serves again; a target that does + not come back fails I/O after 180 s. +- **Kernel defaults** (every connect command shipped today, including the CSI node): a target that does not come + back holds I/O for up to 10 minutes (a 9-minute blocked read was observed in a fault run), then fails it. - **Too short** (`--ctrl-loss-tmo` or `--fast_io_fail_tmo` below the wait): I/O errors reach the filesystem before the target serves again; ext4 mounted with `errors=remount-ro` turns read-only and must be remounted. -A blockmaster outage longer than the lease stops the holders, and they serve again at least 50 s after blockmaster -is back (see [what a restart does to serving volumes](standalone-deployment.md#restoring-a-snapshot-into-a-new-volume)): -an outage of more than about 2 minutes outlasts 180 s. Raise `--ctrl-loss-tmo` if the guest must ride through -longer outages; I/O waits that long. +A blockmaster outage longer than the lease stops the holders: a holder may serve until 20 s after its last renewal, +and serves again at least 50 s after blockmaster is back +([what a blockmaster restart does to serving volumes](standalone-deployment.md#restoring-a-snapshot-into-a-new-volume)). +The guest's wait is then up to 20 s + the outage + 50 s, so an outage of more than about 110 s outlasts 180 s. +Raise `--ctrl-loss-tmo` if the guest must ride through longer outages; I/O waits that long. -A replicated `sync-quorum` volume gets its new primary about 30 to 35 s after its host is lost, with default flags -(derived from `--freshness-window` and the two probe rounds; not yet measured). The values above cover it; they -will be checked against the measured failover time. +**After a failover the guest must connect to the new primary.** These options retry the configured address; they +never redirect it. A standalone volume's NVMe/TCP target binds loopback only (`--nvme-listen`; a non-loopback bind +needs `--allow-external-nvme-bind`, unauthenticated, for test gates only), so a guest reaches only the target on its +own host. Each replica's target reports itself optimized only while it is the healthy primary, but no guest is +connected to the other replicas' targets. A replicated `sync-quorum` volume gets its new primary on another host +about 30 to 35 s after its host is lost, with default flags (derived from `--freshness-window` and the two probe +rounds; not yet measured). The guest's I/O on the old controller waits and then fails as above. To continue, run +the guest on the new primary's host and connect it there: that host's blockvolume logs `adopted as PRIMARY` and its +`/status?volume=` shows `"AuthorityRole":"primary"`. **Kubernetes.** The CSI node connects with a plain `nvme connect` and the kernel defaults. A pod whose holder does not come back holds I/O for up to 600 s: its reads and writes block (processes in uninterruptible sleep, probes that diff --git a/seaweed-block/docs/standalone-deployment.md b/seaweed-block/docs/standalone-deployment.md index dfa59b3bf6..0529c79a3f 100644 --- a/seaweed-block/docs/standalone-deployment.md +++ b/seaweed-block/docs/standalone-deployment.md @@ -405,7 +405,8 @@ swb_start() { done swb_alive "$MPID" && swb_alive "$VPID" && swb_owns 9180 "$MPID" && swb_owns 4420 "$VPID" || { echo "startup failed"; tail -n 20 master.log volume.log; swb_stop; return 1; } - sudo nvme connect -t tcp -a 127.0.0.1 -s 4420 -n "$NQN" || + # --ctrl-loss-tmo/--reconnect-delay: operator-guide.md, Host connect settings + sudo nvme connect -t tcp -a 127.0.0.1 -s 4420 -n "$NQN" --ctrl-loss-tmo=180 --reconnect-delay=2 || { echo "nvme connect failed"; swb_stop; return 1; } } swb_show() { # read-only: the namespace under our NQN, then the volume status From 003756a63ccaca28a9f28d252b7f8d0fdf59fb7a Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 17:56:23 -0800 Subject: [PATCH 3/4] docs: host connect settings, measured with these options A run with exactly --ctrl-loss-tmo=180 --reconnect-delay=2 (no fast_io_fail_tmo): the holder killed and started again 5 s later, a pending write completed after 6.1 s with no error; the holder kept away, the write failed with EIO after 181.5 s. The table is no longer marked derived, not yet run. The failover time stays derived. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operator-guide.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/seaweed-block/docs/operator-guide.md b/seaweed-block/docs/operator-guide.md index 75ee2c4eda..6ed6c1d6c9 100644 --- a/seaweed-block/docs/operator-guide.md +++ b/seaweed-block/docs/operator-guide.md @@ -243,9 +243,9 @@ off or cut it from its clients, then run `sw-block ops failover` (see The guest's kernel keeps an NVMe/TCP controller whose target went away and keeps reconnecting to the same address. Three `nvme connect` options decide how long it waits and what the guest sees meanwhile. The values below are -derived from the waits these pages state; they have not yet been run. +derived from the waits these pages state, and were run with exactly these options (below). -| Option | Kernel default | Set it to (derived, not yet run) | Why | +| Option | Kernel default | Set it to | Why | |---|---|---|---| | `--ctrl-loss-tmo` | 600 s | 180 | Longer than the longest wait for the same target to serve again: a restarted holder is re-granted at most 65 s after it stopped; a start not granted within 30 s after that barrier ends its wait, and the unit starts it again after `RestartSec=5s` ([after a crash](volume-lifecycle.md#after-a-crash)): 65 + 30 + 5 = about 100 s | | `--reconnect-delay` | 10 s | 2 | The controller retries every 2 s; connection setup and the network add to it | @@ -257,7 +257,9 @@ sudo nvme connect -t tcp -a 127.0.0.1 -s 4420 -n "$NQN" --ctrl-loss-tmo=180 --re What the guest sees: - **These values:** while the same target is away, I/O waits and continues when it serves again; a target that does - not come back fails I/O after 180 s. + not come back fails I/O after 180 s. Measured with exactly these options: the holder killed, a write issued, the + holder started again 5 s later (by the test, as the unit would): the write completed after 6.1 s, with no error; + the holder kept away: the write failed with `EIO` after 181.5 s. - **Kernel defaults** (every connect command shipped today, including the CSI node): a target that does not come back holds I/O for up to 10 minutes (a 9-minute blocked read was observed in a fault run), then fails it. - **Too short** (`--ctrl-loss-tmo` or `--fast_io_fail_tmo` below the wait): I/O errors reach the filesystem before From 75e982c9a338b160e1eb49e39f90e6cad0c494b5 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Thu, 26 Nov 2026 18:03:58 -0800 Subject: [PATCH 4/4] docs: host connect settings, the blockmaster outage as a lower bound A holder keeps serving for the rest of its lease during an outage, and the restart barrier is a lower bound, so the outage paragraph states the known lower bound of the guest's wait and that an outage longer than ctrl-loss-tmo less the barrier can fail guest I/O, without a threshold number. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operator-guide.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/seaweed-block/docs/operator-guide.md b/seaweed-block/docs/operator-guide.md index 6ed6c1d6c9..2bd909ede9 100644 --- a/seaweed-block/docs/operator-guide.md +++ b/seaweed-block/docs/operator-guide.md @@ -265,11 +265,12 @@ What the guest sees: - **Too short** (`--ctrl-loss-tmo` or `--fast_io_fail_tmo` below the wait): I/O errors reach the filesystem before the target serves again; ext4 mounted with `errors=remount-ro` turns read-only and must be remounted. -A blockmaster outage longer than the lease stops the holders: a holder may serve until 20 s after its last renewal, -and serves again at least 50 s after blockmaster is back +A blockmaster outage longer than the lease stops the holders: a holder keeps serving until its lease ends (up to +20 s after its last renewal) and serves again at least 50 s after blockmaster is back ([what a blockmaster restart does to serving volumes](standalone-deployment.md#restoring-a-snapshot-into-a-new-volume)). -The guest's wait is then up to 20 s + the outage + 50 s, so an outage of more than about 110 s outlasts 180 s. -Raise `--ctrl-loss-tmo` if the guest must ride through longer outages; I/O waits that long. +Guest I/O therefore waits at least the rest of the outage plus those 50 s; these pages give no upper bound. An outage +longer than `--ctrl-loss-tmo` less those 50 s can fail guest I/O. Raise `--ctrl-loss-tmo` if the guest must ride +through longer outages; I/O waits that long. **After a failover the guest must connect to the new primary.** These options retry the configured address; they never redirect it. A standalone volume's NVMe/TCP target binds loopback only (`--nvme-listen`; a non-loopback bind