From a9b355df27092f9fa885759a46f987ba00c08725 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:31:47 -0800 Subject: [PATCH 01/10] docs: upgrade from v1.0.0 to v1.0.1 The documented procedure: blockmaster first, then each volume host one at a time through the planned return to the same host with the binary swap in the middle, the CLI last; resuming after an interrupted step; downgrade not supported, and never serve a volume above 256 GiB with v1.0.0. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/standalone-deployment.md | 2 + seaweed-block/docs/upgrade-v1.0.1.md | 91 +++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 seaweed-block/docs/upgrade-v1.0.1.md diff --git a/seaweed-block/docs/standalone-deployment.md b/seaweed-block/docs/standalone-deployment.md index 782ab422de..b962f376fd 100644 --- a/seaweed-block/docs/standalone-deployment.md +++ b/seaweed-block/docs/standalone-deployment.md @@ -20,6 +20,8 @@ lease requests require the assigned server id. A new volume against an older pre-release master stays not serving until the master is upgraded; an older volume must also be upgraded to gain the assignment guard. Do not use endpoint matching as a compatibility fallback. See [holder identity and upgrades](releases/holder-identity.md). + +From v1.0.0 to v1.0.1, follow [Upgrade from v1.0.0 to v1.0.1](upgrade-v1.0.1.md). ## Get the matching files The unit and settings files must come from the same commit as your diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md new file mode 100644 index 0000000000..46880c42ea --- /dev/null +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -0,0 +1,91 @@ +# Upgrade from v1.0.0 to v1.0.1 + +**Use this when:** you run v1.0.0 single-replica volumes (`--durable-impl walstore-chunk`, standalone under systemd) +and move them to v1.0.1. + +**What changes on disk:** nothing. v1.0.1 reads every v1.0.0 store as it is: the local data directory, the volume +records and the chunks, roots and HEAD in SeaweedFS. There is no conversion step and no flag to set. + +## Order + +1. **blockmaster first.** +2. **Then each volume host, one at a time.** Each volume on the host serves again before you start on the next host. +3. **The `sw-block` CLI last.** + +Before you start: take a snapshot of each volume (`sw-block ops chunk snapshot`), so that every volume has a recent +restore point whatever happens during the upgrade. + +## 1. blockmaster + +1. Stop it: `systemctl stop sw-blockmaster`. +2. Replace the `blockmaster` binary with v1.0.1's. Check it: `blockmaster --version`. +3. Start it with the same flags and the same stores (`--lifecycle-store`, the authority store, the cluster spec): + `systemctl start sw-blockmaster`. + +Volumes keep serving through a short restart. Each holder renews its lease every 10 s or less and may serve until 20 s +after its last renewal (with the default flags). A blockmaster that answers again within about 10 s interrupts +nothing. A longer stop is fail-closed: a holder whose lease ends stops I/O, exits 75 (`reason=lease_expired`), is +started again by its unit and serves again once blockmaster is back and its barrier has passed (see +[standalone deployment](standalone-deployment.md)). No acknowledged write is lost either way. + +During the rest of the upgrade, blockmaster is v1.0.1 and some volume hosts are still v1.0.0. This mixed state is +supported: v1.0.0 holders keep serving, and snapshots and restores work. + +## 2. Each volume host + +For each volume on the host, do the [planned return to the same host](volume-lifecycle.md#same-host) with the binary +swap in the middle: + +1. **Seal and hand back** (steps 1 to 5 of the [planned hand-over](volume-lifecycle.md#planned-hand-over)): read the + holder, stop the writer, seal with `ops chunk detach --plain`, revoke with the sealed generation, and wait for the + recorded ACK. The holder exits with status 0 after its ACK. +2. **Replace** the `blockvolume` binary on the host with v1.0.1's. Check it: `blockvolume --version`. +3. **Move back to this host** (step 6, with your own host as the target: `--target-host` this host's `server_id` and + the volume's usual `--target-data` and `--target-ctrl`). +4. **Start** `blockvolume` within 30 seconds, with the unchanged settings and local root (step 7). It claims the + sealed HEAD at the new epoch and serves its sealed image. +5. **Verify** (step 8): the holder logs `adopted as PRIMARY`, and `ops workspace show` prints the new epoch. Reconnect + the guest. + +Nothing the volume acknowledged is lost. If a step answers otherwise than its page says, stop there and follow that +page's table; do not go on to the next volume. + +A host that holds several volumes runs one `blockvolume` per volume: upgrade them one at a time, the same way. + +## 3. The `sw-block` CLI + +Replace `sw-block` on every machine that runs it. Commands that changed in v1.0.1 are listed in the +[v1.0.1 release note](releases/README.md). + +## After the upgrade + +- Each volume's first cleaning pass under v1.0.1 runs at the next `--chunk-maintenance-interval` (hourly by default). +- Check every volume with the read-only verify: + + ```bash + sw-block ops chunk verify --master MASTER --volume v1 --chunk-filer FILER --all-snapshots --depth data --orphans --timeout 30m + ``` + + Exit 0 is clean. A snapshot taken before the upgrade restores as before. + +## If a step is interrupted + +Each step can be repeated, and the procedure resumes at the step that did not finish: + +- **blockmaster killed while it starts:** start it again. Volumes behave as in a longer blockmaster stop above. +- **A holder killed during its seal:** its unit starts it again. Check with `sw-block ops chunk show`: if + `head.State` is `detached`, the seal finished; go on with the revoke. Otherwise the volume is not sealed and the + holder serves again from its local WAL; seal again. +- **The new `blockvolume` killed while it starts:** start it again. It claims the sealed HEAD at the next renewal. If + more than 30 seconds pass after the move, start it after 65 seconds, as in + [after a crash](volume-lifecycle.md#after-a-crash). +- **A whole host lost power mid-procedure:** start its units again, then resume at the step it had not finished. + +## Downgrade + +Downgrade is not supported and is not a tested procedure. Do not start a v1.0.0 build on a store that v1.0.1 has +served. + +One case is a hazard, not only unsupported: **never let v1.0.0 serve a volume larger than 256 GiB.** v1.0.0 cannot +finish the commit check of such a volume's cut within its time limit, so its snapshots fail with an unknown +outcome. From 7861509c9d31250959b7fd1739319c1face8d425 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:37:10 -0800 Subject: [PATCH 02/10] docs(upgrade): verify without orphans first; binary install; seal limits Right after the upgrade, verify without --orphans: v1.0.0 left old roots and segments that v1.0.1's cleaning removes over its first passes; the orphan check runs after that. The binary is replaced with install (a new file), once per host. The seal runs with v1.0.0's limits, which the snapshot before the upgrade keeps small, and a repeated seal is safe. The start command is ready before the move; the v1.0.0 CLI works in the mixed window; the release-note link waits for the note. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 40 ++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index 46880c42ea..3a63f22030 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -12,8 +12,10 @@ records and the chunks, roots and HEAD in SeaweedFS. There is no conversion step 2. **Then each volume host, one at a time.** Each volume on the host serves again before you start on the next host. 3. **The `sw-block` CLI last.** -Before you start: take a snapshot of each volume (`sw-block ops chunk snapshot`), so that every volume has a recent -restore point whatever happens during the upgrade. +Before you start: take a snapshot of each volume (`sw-block ops chunk snapshot`). Every volume then has a recent +restore point whatever happens during the upgrade, and the seal in step 2 has little left to copy. The seal runs on +v1.0.0 with v1.0.0's limits: each request is bounded at 5 minutes, and a restore target's first cut reads every byte +it has filled. ## 1. blockmaster @@ -28,8 +30,9 @@ nothing. A longer stop is fail-closed: a holder whose lease ends stops I/O, exit started again by its unit and serves again once blockmaster is back and its barrier has passed (see [standalone deployment](standalone-deployment.md)). No acknowledged write is lost either way. -During the rest of the upgrade, blockmaster is v1.0.1 and some volume hosts are still v1.0.0. This mixed state is -supported: v1.0.0 holders keep serving, and snapshots and restores work. +During the rest of the upgrade, blockmaster is v1.0.1 while some volume hosts and the `sw-block` CLI are still +v1.0.0. This mixed state is supported: v1.0.0 holders keep serving, snapshots and restores work, and every command of +step 2 runs from the v1.0.0 CLI. ## 2. Each volume host @@ -39,11 +42,23 @@ swap in the middle: 1. **Seal and hand back** (steps 1 to 5 of the [planned hand-over](volume-lifecycle.md#planned-hand-over)): read the holder, stop the writer, seal with `ops chunk detach --plain`, revoke with the sealed generation, and wait for the recorded ACK. The holder exits with status 0 after its ACK. -2. **Replace** the `blockvolume` binary on the host with v1.0.1's. Check it: `blockvolume --version`. + + If the seal answers a retryable error or an unknown outcome, run the same command again: repeating it is safe, and + once it has applied it answers from the sealed HEAD (`sw-block ops chunk show` then shows `head.State` + `detached`). +2. **Replace** the `blockvolume` binary with v1.0.1's by installing a new file, not by writing over the old one: + + ```bash + sudo install -m 0755 ./blockvolume /usr/local/bin/blockvolume + blockvolume --version + ``` + + `install` replaces the file, so processes still running from the old binary keep it. On a host with several + volumes the binary is one file: replace it once, at the first volume's step 2. 3. **Move back to this host** (step 6, with your own host as the target: `--target-host` this host's `server_id` and the volume's usual `--target-data` and `--target-ctrl`). -4. **Start** `blockvolume` within 30 seconds, with the unchanged settings and local root (step 7). It claims the - sealed HEAD at the new epoch and serves its sealed image. +4. **Start** `blockvolume` within 30 seconds, with the unchanged settings and local root (step 7). Have the start + command ready before you run the move. It claims the sealed HEAD at the new epoch and serves its sealed image. 5. **Verify** (step 8): the holder logs `adopted as PRIMARY`, and `ops workspace show` prints the new epoch. Reconnect the guest. @@ -54,19 +69,22 @@ A host that holds several volumes runs one `blockvolume` per volume: upgrade the ## 3. The `sw-block` CLI -Replace `sw-block` on every machine that runs it. Commands that changed in v1.0.1 are listed in the -[v1.0.1 release note](releases/README.md). +Replace `sw-block` on every machine that runs it. ## After the upgrade -- Each volume's first cleaning pass under v1.0.1 runs at the next `--chunk-maintenance-interval` (hourly by default). - Check every volume with the read-only verify: ```bash - sw-block ops chunk verify --master MASTER --volume v1 --chunk-filer FILER --all-snapshots --depth data --orphans --timeout 30m + sw-block ops chunk verify --master MASTER --volume v1 --chunk-filer FILER --all-snapshots --depth data --timeout 30m ``` Exit 0 is clean. A snapshot taken before the upgrade restores as before. +- v1.0.0 left the roots and segments of old cuts in place. v1.0.1's cleaning removes them, starting at the next + `--chunk-maintenance-interval` (hourly by default) and over as many passes as it needs; each pass logs + `maintenance volume= ... planned=N removed=N` on the volume's host. Until it has finished, the same verify with + `--orphans` lists those roots and segments: that is expected after an upgrade, not damage. Run the `--orphans` + check after the cleaning has passed; if it still lists them, run it again after the next pass. ## If a step is interrupted From 0e62df81609f42cbc5b4170a91da5d928c8b00c1 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:39:01 -0800 Subject: [PATCH 03/10] docs(upgrade): the in-place restart is the procedure A volume host's upgrade is a restart on the new binary: install it once per host, then for each volume a cut (best effort) and a restart of its unit, which replays the WAL and serves again within its lease. Any holder that restarts after the swap comes up as v1.0.1, which is supported. Seal-and-move stays as an optional alternative. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 74 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index 3a63f22030..f5edc396fa 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -12,10 +12,8 @@ records and the chunks, roots and HEAD in SeaweedFS. There is no conversion step 2. **Then each volume host, one at a time.** Each volume on the host serves again before you start on the next host. 3. **The `sw-block` CLI last.** -Before you start: take a snapshot of each volume (`sw-block ops chunk snapshot`). Every volume then has a recent -restore point whatever happens during the upgrade, and the seal in step 2 has little left to copy. The seal runs on -v1.0.0 with v1.0.0's limits: each request is bounded at 5 minutes, and a restore target's first cut reads every byte -it has filled. +Before you start: take a snapshot of each volume (`sw-block ops chunk snapshot`), so that every volume has a recent +restore point whatever happens during the upgrade. ## 1. blockmaster @@ -31,41 +29,46 @@ started again by its unit and serves again once blockmaster is back and its barr [standalone deployment](standalone-deployment.md)). No acknowledged write is lost either way. During the rest of the upgrade, blockmaster is v1.0.1 while some volume hosts and the `sw-block` CLI are still -v1.0.0. This mixed state is supported: v1.0.0 holders keep serving, snapshots and restores work, and every command of -step 2 runs from the v1.0.0 CLI. +v1.0.0. This mixed state is supported: v1.0.0 holders keep serving, snapshots and restores work, and the commands of +step 2 run from the v1.0.0 CLI. ## 2. Each volume host -For each volume on the host, do the [planned return to the same host](volume-lifecycle.md#same-host) with the binary -swap in the middle: +The upgrade of a volume host is a restart on the new binary. v1.0.1 opens the v1.0.0 local store and replays its WAL +as on any restart, so every acknowledged write is kept; no seal and no move are needed. -1. **Seal and hand back** (steps 1 to 5 of the [planned hand-over](volume-lifecycle.md#planned-hand-over)): read the - holder, stop the writer, seal with `ops chunk detach --plain`, revoke with the sealed generation, and wait for the - recorded ACK. The holder exits with status 0 after its ACK. - - If the seal answers a retryable error or an unknown outcome, run the same command again: repeating it is safe, and - once it has applied it answers from the sealed HEAD (`sw-block ops chunk show` then shows `head.State` - `detached`). -2. **Replace** the `blockvolume` binary with v1.0.1's by installing a new file, not by writing over the old one: +1. **Replace the binary**, once per host, by installing a new file, not by writing over the old one: ```bash sudo install -m 0755 ./blockvolume /usr/local/bin/blockvolume blockvolume --version ``` - `install` replaces the file, so processes still running from the old binary keep it. On a host with several - volumes the binary is one file: replace it once, at the first volume's step 2. -3. **Move back to this host** (step 6, with your own host as the target: `--target-host` this host's `server_id` and - the volume's usual `--target-data` and `--target-ctrl`). -4. **Start** `blockvolume` within 30 seconds, with the unchanged settings and local root (step 7). Have the start - command ready before you run the move. It claims the sealed HEAD at the new epoch and serves its sealed image. -5. **Verify** (step 8): the holder logs `adopted as PRIMARY`, and `ops workspace show` prints the new epoch. Reconnect - the guest. + `install` replaces the file, so the volumes still running keep their old process until they restart. From now on, + any `blockvolume` on this host that starts again, planned or not (for example after a lease expiry, exit 75, or a + crash), starts as v1.0.1. That is supported: it is the same restart. +2. **For each volume on the host, one at a time:** + 1. Publish its changes with a cut, so that its recovery point is recent if the host is lost during the upgrade: -Nothing the volume acknowledged is lost. If a step answers otherwise than its page says, stop there and follow that -page's table; do not go on to the next volume. + ```bash + sw-block ops chunk cut --volume v1 --status-addr STATUS + ``` -A host that holds several volumes runs one `blockvolume` per volume: upgrade them one at a time, the same way. + The cut needs the volume's `--chunk-control-endpoint`; without it, skip this step. If the cut answers a + retryable error or an unknown outcome, go on: the restart keeps every acknowledged write in the local WAL + either way. + 2. Restart its unit: `systemctl restart `. The new process renews within the + 30-second lease and serves again from its local WAL (see + [restart without a hand-over](volume-lifecycle.md#same-host)). + 3. Check that it serves: its status shows `"Healthy":true` and `"AuthorityRole":"primary"` + (`curl -s 'http://STATUS/status?volume=v1'`). Then go on to the next volume. + +Nothing the volume acknowledged is lost. If a volume does not serve again within its lease, follow +[after a crash](volume-lifecycle.md#after-a-crash) for it before you go on. + +You can instead combine the upgrade with a move: seal the volume and hand it over +([planned hand-over](volume-lifecycle.md#planned-hand-over)), and start it on the target host with the v1.0.1 binary. +This is optional; the restart above is the upgrade procedure. ## 3. The `sw-block` CLI @@ -81,22 +84,19 @@ Replace `sw-block` on every machine that runs it. Exit 0 is clean. A snapshot taken before the upgrade restores as before. - v1.0.0 left the roots and segments of old cuts in place. v1.0.1's cleaning removes them, starting at the next - `--chunk-maintenance-interval` (hourly by default) and over as many passes as it needs; each pass logs - `maintenance volume= ... planned=N removed=N` on the volume's host. Until it has finished, the same verify with - `--orphans` lists those roots and segments: that is expected after an upgrade, not damage. Run the `--orphans` - check after the cleaning has passed; if it still lists them, run it again after the next pass. + `--chunk-maintenance-interval` (hourly by default); each pass logs `maintenance volume= ... planned=N removed=N` + on the volume's host. Until the first v1.0.1 pass has finished, the same verify with `--orphans` lists those roots + and segments: that is expected after an upgrade, not damage. Run the `--orphans` check after that pass. ## If a step is interrupted Each step can be repeated, and the procedure resumes at the step that did not finish: - **blockmaster killed while it starts:** start it again. Volumes behave as in a longer blockmaster stop above. -- **A holder killed during its seal:** its unit starts it again. Check with `sw-block ops chunk show`: if - `head.State` is `detached`, the seal finished; go on with the revoke. Otherwise the volume is not sealed and the - holder serves again from its local WAL; seal again. -- **The new `blockvolume` killed while it starts:** start it again. It claims the sealed HEAD at the next renewal. If - more than 30 seconds pass after the move, start it after 65 seconds, as in - [after a crash](volume-lifecycle.md#after-a-crash). +- **A holder killed during its cut:** its unit starts it again, on the new binary if it was already installed. + It replays its WAL and serves again; go on with the restart step (or skip it if it already runs v1.0.1). +- **The new `blockvolume` killed while it starts:** its unit starts it again. If it does not serve again within its + lease, follow [after a crash](volume-lifecycle.md#after-a-crash). - **A whole host lost power mid-procedure:** start its units again, then resume at the step it had not finished. ## Downgrade From f8469b7f45cfecc66097c98c910dc30e871e3f94 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:39:22 -0800 Subject: [PATCH 04/10] docs(upgrade): name the format guarantee as the remote image and the log Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index f5edc396fa..a51fac14e0 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -3,8 +3,8 @@ **Use this when:** you run v1.0.0 single-replica volumes (`--durable-impl walstore-chunk`, standalone under systemd) and move them to v1.0.1. -**What changes on disk:** nothing. v1.0.1 reads every v1.0.0 store as it is: the local data directory, the volume -records and the chunks, roots and HEAD in SeaweedFS. There is no conversion step and no flag to set. +**Format:** v1.0.1 makes no format change in a volume's remote image (its chunks, roots and HEAD in SeaweedFS) or +in its log. There is no conversion step and no flag to set. ## Order @@ -34,8 +34,8 @@ step 2 run from the v1.0.0 CLI. ## 2. Each volume host -The upgrade of a volume host is a restart on the new binary. v1.0.1 opens the v1.0.0 local store and replays its WAL -as on any restart, so every acknowledged write is kept; no seal and no move are needed. +The upgrade of a volume host is a restart on the new binary. v1.0.1 replays the volume's WAL as on any restart, so +every acknowledged write is kept; no seal and no move are needed. 1. **Replace the binary**, once per host, by installing a new file, not by writing over the old one: From 1d410f8ccba4f7fbacbaa402959139e44be62016 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:42:13 -0800 Subject: [PATCH 05/10] docs: a stop does not cut; run the cut first The operator guide's recovery point and the upgrade page's cut step say that systemctl stop and restart publish nothing, so the cut runs first. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operator-guide.md | 3 ++- seaweed-block/docs/upgrade-v1.0.1.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/operator-guide.md b/seaweed-block/docs/operator-guide.md index 6086a138b9..87c1f1a345 100644 --- a/seaweed-block/docs/operator-guide.md +++ b/seaweed-block/docs/operator-guide.md @@ -188,7 +188,8 @@ default) can expire the host's slots; keep host clocks synchronized. - **For a newer recovery point:** set `--chunk-capture-interval` (at least 5 minutes), or take a snapshot before risky work. - **What does not publish:** a stop, a lease revocation and a lease expiry publish nothing. Only a cut, a snapshot or - a seal (`ops chunk detach --plain`) does. + a seal (`ops chunk detach --plain`) does. `systemctl stop` of a volume does not cut: before a stop after which the + host might not come back (maintenance, an upgrade), run `sw-block ops chunk cut` first. - **When SeaweedFS is unavailable** (the filer or a volume server is down): - Guest I/O continues from the local disk; in the tests no guest command failed, and every answer came within the test's 20 s bound (about 2 s at the slowest in the one measured run; that run's record was not kept). diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index a51fac14e0..d75f1a466e 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -48,7 +48,8 @@ every acknowledged write is kept; no seal and no move are needed. any `blockvolume` on this host that starts again, planned or not (for example after a lease expiry, exit 75, or a crash), starts as v1.0.1. That is supported: it is the same restart. 2. **For each volume on the host, one at a time:** - 1. Publish its changes with a cut, so that its recovery point is recent if the host is lost during the upgrade: + 1. Publish its changes with a cut, so that its recovery point is recent if the host is lost during the upgrade. + `systemctl stop` and `systemctl restart` do not cut by themselves; run the cut step first: ```bash sw-block ops chunk cut --volume v1 --status-addr STATUS From 4555c615476c8029d35d65bdd7dc655f34472fa1 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:43:22 -0800 Subject: [PATCH 06/10] docs(upgrade): what the guest sees; the orphan check after a pass removes nothing Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index d75f1a466e..c528411143 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -64,6 +64,12 @@ every acknowledged write is kept; no seal and no move are needed. 3. Check that it serves: its status shows `"Healthy":true` and `"AuthorityRole":"primary"` (`curl -s 'http://STATUS/status?volume=v1'`). Then go on to the next volume. + **The guest during the restart:** the restart stops the NVMe/TCP target the guest is connected to. The guest's I/O + on the device pauses and continues when the holder serves again, if it connected with the options in + [host connect settings](operator-guide.md#host-connect-settings) (`--ctrl-loss-tmo=180 --reconnect-delay=2`). + To avoid the pause, stop the writer first. If the device does not come back by itself (I/O fails with `EIO`, or + the controller is gone), connect it again with the same `nvme connect` command. + Nothing the volume acknowledged is lost. If a volume does not serve again within its lease, follow [after a crash](volume-lifecycle.md#after-a-crash) for it before you go on. @@ -86,8 +92,10 @@ Replace `sw-block` on every machine that runs it. Exit 0 is clean. A snapshot taken before the upgrade restores as before. - v1.0.0 left the roots and segments of old cuts in place. v1.0.1's cleaning removes them, starting at the next `--chunk-maintenance-interval` (hourly by default); each pass logs `maintenance volume= ... planned=N removed=N` - on the volume's host. Until the first v1.0.1 pass has finished, the same verify with `--orphans` lists those roots - and segments: that is expected after an upgrade, not damage. Run the `--orphans` check after that pass. + on the volume's host. A pass is bounded in time and the next one continues, so this can take several passes. Until + then, the same verify with `--orphans` lists those roots and segments: that is expected after an upgrade, not + damage. Run the `--orphans` check once a pass has nothing left to remove: its log line shows `removed=0` (a pass + that stops early logs an error instead). ## If a step is interrupted From aacaff3a556a924d57f5a5ea7e2a2c65ef238fa7 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 12:55:03 -0800 Subject: [PATCH 07/10] docs(upgrade): conditional snapshot, conditional restart timing, a successful empty pass Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index c528411143..952cd9e164 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -12,8 +12,10 @@ in its log. There is no conversion step and no flag to set. 2. **Then each volume host, one at a time.** Each volume on the host serves again before you start on the next host. 3. **The `sw-block` CLI last.** -Before you start: take a snapshot of each volume (`sw-block ops chunk snapshot`), so that every volume has a recent -restore point whatever happens during the upgrade. +Before you start: for each volume that runs with `--chunk-control-endpoint`, take a snapshot +(`sw-block ops chunk snapshot`), so that it has a recent restore point whatever happens during the upgrade. A volume +without the endpoint cannot be asked for a snapshot or a cut; its recovery point during the upgrade stays its last +scheduled snapshot. ## 1. blockmaster @@ -58,11 +60,13 @@ every acknowledged write is kept; no seal and no move are needed. The cut needs the volume's `--chunk-control-endpoint`; without it, skip this step. If the cut answers a retryable error or an unknown outcome, go on: the restart keeps every acknowledged write in the local WAL either way. - 2. Restart its unit: `systemctl restart `. The new process renews within the - 30-second lease and serves again from its local WAL (see - [restart without a hand-over](volume-lifecycle.md#same-host)). + 2. Restart its unit: `systemctl restart `. If the new process renews before its + lease ends, it serves again at once from its local WAL (see + [restart without a hand-over](volume-lifecycle.md#same-host)). If not, it waits for the re-grant described in + [after a crash](volume-lifecycle.md#after-a-crash) (with the default flags, up to 65 seconds after it stopped) + and then serves. 3. Check that it serves: its status shows `"Healthy":true` and `"AuthorityRole":"primary"` - (`curl -s 'http://STATUS/status?volume=v1'`). Then go on to the next volume. + (`curl -s 'http://STATUS/status?volume=v1'`). Wait for it to serve before you go on to the next volume. **The guest during the restart:** the restart stops the NVMe/TCP target the guest is connected to. The guest's I/O on the device pauses and continues when the holder serves again, if it connected with the options in @@ -94,8 +98,10 @@ Replace `sw-block` on every machine that runs it. `--chunk-maintenance-interval` (hourly by default); each pass logs `maintenance volume= ... planned=N removed=N` on the volume's host. A pass is bounded in time and the next one continues, so this can take several passes. Until then, the same verify with `--orphans` lists those roots and segments: that is expected after an upgrade, not - damage. Run the `--orphans` check once a pass has nothing left to remove: its log line shows `removed=0` (a pass - that stops early logs an error instead). + damage. Run the `--orphans` check once a pass has completed without an error and removed nothing: its count line + shows `removed=0` and no `durable: maintenance volume=: ...` error follows it. (The count line is printed for + every pass, also one that failed; `planned=` counts every chunk name the pass read, so it is not 0 on a volume with + data.) ## If a step is interrupted From f45d12dd41fa3a9c0b33754fa4ba448eafea623d Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 13:22:50 -0800 Subject: [PATCH 08/10] docs(upgrade): step 2's other answers and what to do Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index 952cd9e164..2042d3e21f 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -74,8 +74,15 @@ every acknowledged write is kept; no seal and no move are needed. To avoid the pause, stop the writer first. If the device does not come back by itself (I/O fails with `EIO`, or the controller is gone), connect it again with the same `nvme connect` command. -Nothing the volume acknowledged is lost. If a volume does not serve again within its lease, follow -[after a crash](volume-lifecycle.md#after-a-crash) for it before you go on. +Nothing the volume acknowledged is lost. The answers of step 2 other than the expected one, and what to do: + +| Step | Answer | Do | +|---|---|---| +| cut | an error, `remote_unavailable`, or an unknown outcome | go on to the restart; the local WAL keeps every acknowledged write | +| cut | the command is refused because the control endpoint is off | skip the cut | +| restart | the unit fails to start (`systemctl status` shows it failed) | check the binary (`blockvolume --version`) and the unit's log, then start it again | +| check | `"Healthy":false` or `"AuthorityRole"` not `primary`, with `NotReadyReason=lease_not_held` | wait: it is waiting for its re-grant ([after a crash](volume-lifecycle.md#after-a-crash), up to 65 s with the default flags); check again | +| check | still not serving after that wait | stop here; follow [a volume waiting for blockmaster](operator-guide.md#a-volume-waiting-for-blockmaster) (its `MasterWait` reason names the cause) before you go on | You can instead combine the upgrade with a move: seal the volume and hand it over ([planned hand-over](volume-lifecycle.md#planned-hand-over)), and start it on the target host with the v1.0.1 binary. From 278f37381a24fe9bb4db9636ad8567655d38981d Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 13:24:27 -0800 Subject: [PATCH 09/10] docs(upgrade): per host, cut each volume, replace the binary, restart each holder The documented restart without a hand-over is the procedure; the cut is recommended, not required; seal and move stay optional. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index 2042d3e21f..dc8b616f65 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -36,37 +36,37 @@ step 2 run from the v1.0.0 CLI. ## 2. Each volume host -The upgrade of a volume host is a restart on the new binary. v1.0.1 replays the volume's WAL as on any restart, so -every acknowledged write is kept; no seal and no move are needed. +The upgrade of a volume host is the documented +[restart without a hand-over](volume-lifecycle.md#same-host) on the new binary: `systemctl restart` keeps the holder +and its epoch, and the new process serves again from its local WAL, so every acknowledged write is kept. No seal and +no move are needed. -1. **Replace the binary**, once per host, by installing a new file, not by writing over the old one: +1. **Cut each volume on the host** (recommended, not required): it narrows what a loss of the host during the + upgrade can cost. `systemctl stop` and `systemctl restart` do not cut by themselves. + + ```bash + sw-block ops chunk cut --volume v1 --status-addr STATUS + ``` + + The cut needs the volume's `--chunk-control-endpoint`; without it, skip this step. If the cut answers a retryable + error or an unknown outcome, go on: the restart keeps every acknowledged write in the local WAL either way. +2. **Replace the binary**, once per host, by installing a new file (a rename), not by writing over the old one: ```bash sudo install -m 0755 ./blockvolume /usr/local/bin/blockvolume blockvolume --version ``` - `install` replaces the file, so the volumes still running keep their old process until they restart. From now on, - any `blockvolume` on this host that starts again, planned or not (for example after a lease expiry, exit 75, or a - crash), starts as v1.0.1. That is supported: it is the same restart. -2. **For each volume on the host, one at a time:** - 1. Publish its changes with a cut, so that its recovery point is recent if the host is lost during the upgrade. - `systemctl stop` and `systemctl restart` do not cut by themselves; run the cut step first: - - ```bash - sw-block ops chunk cut --volume v1 --status-addr STATUS - ``` - - The cut needs the volume's `--chunk-control-endpoint`; without it, skip this step. If the cut answers a - retryable error or an unknown outcome, go on: the restart keeps every acknowledged write in the local WAL - either way. - 2. Restart its unit: `systemctl restart `. If the new process renews before its - lease ends, it serves again at once from its local WAL (see - [restart without a hand-over](volume-lifecycle.md#same-host)). If not, it waits for the re-grant described in + The volumes still running keep their old process until they restart. From now on, any `blockvolume` on this host + that starts again, planned or not (for example after a lease expiry, exit 75, or a crash), starts as v1.0.1. That + is supported: it is the same restart. +3. **Restart each holder, one at a time:** + 1. `systemctl restart `. If the new process renews before its lease ends, it serves + again at once from its local WAL. If not, it waits for the re-grant described in [after a crash](volume-lifecycle.md#after-a-crash) (with the default flags, up to 65 seconds after it stopped) and then serves. - 3. Check that it serves: its status shows `"Healthy":true` and `"AuthorityRole":"primary"` - (`curl -s 'http://STATUS/status?volume=v1'`). Wait for it to serve before you go on to the next volume. + 2. Check that it serves: its status shows `"Healthy":true` and `"AuthorityRole":"primary"` + (`curl -s 'http://STATUS/status?volume=v1'`). Wait for it to serve before you restart the next holder. **The guest during the restart:** the restart stops the NVMe/TCP target the guest is connected to. The guest's I/O on the device pauses and continues when the holder serves again, if it connected with the options in @@ -74,7 +74,7 @@ every acknowledged write is kept; no seal and no move are needed. To avoid the pause, stop the writer first. If the device does not come back by itself (I/O fails with `EIO`, or the controller is gone), connect it again with the same `nvme connect` command. -Nothing the volume acknowledged is lost. The answers of step 2 other than the expected one, and what to do: +Nothing the volume acknowledged is lost. The answers other than the expected one, and what to do: | Step | Answer | Do | |---|---|---| @@ -84,9 +84,10 @@ Nothing the volume acknowledged is lost. The answers of step 2 other than the ex | check | `"Healthy":false` or `"AuthorityRole"` not `primary`, with `NotReadyReason=lease_not_held` | wait: it is waiting for its re-grant ([after a crash](volume-lifecycle.md#after-a-crash), up to 65 s with the default flags); check again | | check | still not serving after that wait | stop here; follow [a volume waiting for blockmaster](operator-guide.md#a-volume-waiting-for-blockmaster) (its `MasterWait` reason names the cause) before you go on | -You can instead combine the upgrade with a move: seal the volume and hand it over -([planned hand-over](volume-lifecycle.md#planned-hand-over)), and start it on the target host with the v1.0.1 binary. -This is optional; the restart above is the upgrade procedure. + +**Optional:** combine the upgrade with a move: seal the volume and hand it over +([planned hand-over](volume-lifecycle.md#planned-hand-over), or back to the same host), and start it with the v1.0.1 +binary. The restart above is the upgrade procedure. ## 3. The `sw-block` CLI From 2422388689506d5928423df8b2a3c210e815d743 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Sat, 28 Nov 2026 13:29:08 -0800 Subject: [PATCH 10/10] docs(upgrade): stage, check, then rename each binary into place install unlinks and copies, so a unit starting during the copy could find a partial file; a staged file renamed in the same directory is atomic. The same for blockmaster and the CLI. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/upgrade-v1.0.1.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/seaweed-block/docs/upgrade-v1.0.1.md b/seaweed-block/docs/upgrade-v1.0.1.md index dc8b616f65..fee5cb1aa9 100644 --- a/seaweed-block/docs/upgrade-v1.0.1.md +++ b/seaweed-block/docs/upgrade-v1.0.1.md @@ -20,7 +20,8 @@ scheduled snapshot. ## 1. blockmaster 1. Stop it: `systemctl stop sw-blockmaster`. -2. Replace the `blockmaster` binary with v1.0.1's. Check it: `blockmaster --version`. +2. Replace the `blockmaster` binary with v1.0.1's the same way as in step 2 below (stage + `/usr/local/bin/blockmaster.new`, check it with `--version`, then `mv` it over the old one). 3. Start it with the same flags and the same stores (`--lifecycle-store`, the authority store, the cluster spec): `systemctl start sw-blockmaster`. @@ -50,11 +51,14 @@ no move are needed. The cut needs the volume's `--chunk-control-endpoint`; without it, skip this step. If the cut answers a retryable error or an unknown outcome, go on: the restart keeps every acknowledged write in the local WAL either way. -2. **Replace the binary**, once per host, by installing a new file (a rename), not by writing over the old one: +2. **Replace the binary**, once per host: stage it next to the old one, check it, then rename it over the old one. + A rename in the same directory is atomic, so a unit that starts at any moment finds either the old or the new + binary, never a partial file: ```bash - sudo install -m 0755 ./blockvolume /usr/local/bin/blockvolume - blockvolume --version + sudo install -m 0755 ./blockvolume /usr/local/bin/blockvolume.new + /usr/local/bin/blockvolume.new --version + sudo mv /usr/local/bin/blockvolume.new /usr/local/bin/blockvolume ``` The volumes still running keep their old process until they restart. From now on, any `blockvolume` on this host @@ -91,7 +95,8 @@ binary. The restart above is the upgrade procedure. ## 3. The `sw-block` CLI -Replace `sw-block` on every machine that runs it. +Replace `sw-block` on every machine that runs it, the same way (stage, check with `--version`, `mv` over the old +one). ## After the upgrade