From c24f81ee4e0144e14a9a15bdd22aaae1509b232b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 14:30:48 -0800 Subject: [PATCH] docs(block): keep blockmaster from starting during the state migration A stopped but enabled blockmaster starts at the next boot, and a v1.1.0 volume unit's restart pulls it in through Wants=. Either can start it against the source being copied or the empty state path. Disable it for the migration, stop v1.1.0 volume units first, and enable it with the final start. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operations-manual.md | 12 ++++++++---- seaweed-block/docs/releases/v1.1.2.md | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index 9d032a158f..f8f1d05db5 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -132,7 +132,9 @@ create and mount the state filesystem and configure the unit's mount dependency Migrating existing state stops service: volumes fence once blockmaster's downtime outlasts their leases. To migrate an existing installation: -1. Stop blockmaster with `sudo systemctl stop sw-blockmaster` and keep it stopped throughout the migration. +1. Stop and disable blockmaster with `sudo systemctl disable --now sw-blockmaster`, so a reboot does not start it, + and keep it stopped throughout the migration. With v1.1.0 volume units on this host, stop those volumes first + ([section 4](#4-stop-a-volume)): their restart starts blockmaster again. 2. Mount the new filesystem at a temporary location. Copy the entire existing state directory onto it, preserving file contents, ownership, permissions and directory structure, including hidden files. 3. Verify the copy against the stopped source, run `sync`, then unmount the temporary location. Retain the original state @@ -154,9 +156,11 @@ To migrate an existing installation: including if its configuration is lost. Keep these protections installed after the migration. 6. Mount the copied filesystem at the configured state directory, verify that it contains the copied authority and lifecycle stores and their permissions, and run `sync`. -7. Start blockmaster with `sudo systemctl start sw-blockmaster` and verify that it opens the copied stores and - reloads the existing records before considering the migration complete. - If verification fails, keep it stopped and correct the mount or copy before retrying. +7. Enable and start blockmaster with `sudo systemctl enable --now sw-blockmaster` and verify that it opens the + copied stores and reloads the existing records before considering the migration complete. + If verification fails, stop it with `sudo systemctl disable --now sw-blockmaster`, keep it stopped, and correct + the mount or copy before retrying. + Once it verifies, start any volumes stopped in step 1 again. Remove the moved original only after this successful startup and state verification. Under heavy writes on the state filesystem, an `fsync` when blockmaster opens its state directory can wait for the diff --git a/seaweed-block/docs/releases/v1.1.2.md b/seaweed-block/docs/releases/v1.1.2.md index 20073c164c..64b5013d8c 100644 --- a/seaweed-block/docs/releases/v1.1.2.md +++ b/seaweed-block/docs/releases/v1.1.2.md @@ -6,4 +6,4 @@ v1.1.2 is not yet released. - **Trigger:** blockmaster's state filesystem also holds heavy writes, such as the holders' local data. - **Effect:** blockmaster's start syncs its state directories, which can wait for the filesystem journal. When the import has changed records, it also runs a `syncfs` for each store with changed records on ext4, XFS, btrfs or tmpfs (Linux 5.8 or later), which waits for every pending write on that filesystem, including the holders' data. Starts took from about 20 seconds to over 150 seconds in our tests (one start was not ready after 2 minutes); this is not an upper bound. A volume whose lease expires stops serving until blockmaster is back; it is then granted again on the same holder, with its data. A forced move during that time can lose writes after the last published HEAD (see [forced move](../volume-lifecycle.md#after-a-crash)). -- **What to do:** v1.1.2 stops the startup's ancestor sync at the state filesystem's boundary, so a dedicated state filesystem isolates the startup syncs; run `sync` after creating and mounting it. For a new install, mount it and configure the unit's mount dependency before the first start. Migrating existing state stops service; volumes fence once the downtime outlasts their leases. Stop blockmaster, copy all state preserving ownership and permissions, verify and sync the copy, then move the unmounted original directory aside and create an empty mount point. Configure the persistent mount and the unit's `RequiresMountsFor` plus `AssertPathIsMountPoint` drop-in, mount the copy, verify its stores and run `sync`. Start blockmaster and confirm that it opens the copied stores and reloads existing records; only then remove the moved original. Never leave stale stores beneath the mount or start against an empty replacement. Follow the [state migration steps](../operations-manual.md#1-install-the-binaries-and-units). Keep holders' data off that filesystem; a different directory on it is not enough. Restart blockmaster at low write load on the state filesystem, including when the cluster spec has not changed. If device lookup fails, a logged fallback retains the full ancestor walk. +- **What to do:** v1.1.2 stops the startup's ancestor sync at the state filesystem's boundary, so a dedicated state filesystem isolates the startup syncs; run `sync` after creating and mounting it. For a new install, mount it and configure the unit's mount dependency before the first start. Migrating existing state stops service; volumes fence once the downtime outlasts their leases. Stop and disable blockmaster (with v1.1.0 volume units, stop the host's volumes first), copy all state preserving ownership and permissions, verify and sync the copy, then move the unmounted original directory aside and create an empty mount point. Configure the persistent mount and the unit's `RequiresMountsFor` plus `AssertPathIsMountPoint` drop-in, mount the copy, verify its stores and run `sync`. Enable and start blockmaster and confirm that it opens the copied stores and reloads existing records; only then remove the moved original. Never leave stale stores beneath the mount or start against an empty replacement. Follow the [state migration steps](../operations-manual.md#1-install-the-binaries-and-units). Keep holders' data off that filesystem; a different directory on it is not enough. Restart blockmaster at low write load on the state filesystem, including when the cluster spec has not changed. If device lookup fails, a logged fallback retains the full ancestor walk.