From f456af94e36602c3eea5fa89c80e36a91bf9f1ed Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 5 Dec 2026 14:30:59 -0800 Subject: [PATCH] docs(block): keep an old state filesystem as the migration backup When the old state directory is itself a mount point, moving it aside moves only the empty mount-point directory; the stores stay on the old filesystem. Unmount it, keep it intact as the backup, and drop its persistent mount so it does not come back over the new one. Co-Authored-By: Claude Opus 5.5 --- seaweed-block/docs/operations-manual.md | 4 +++- seaweed-block/docs/releases/v1.1.2.md | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/seaweed-block/docs/operations-manual.md b/seaweed-block/docs/operations-manual.md index f8f1d05db5..18e89c1a97 100644 --- a/seaweed-block/docs/operations-manual.md +++ b/seaweed-block/docs/operations-manual.md @@ -140,6 +140,8 @@ To migrate an existing installation: 3. Verify the copy against the stopped source, run `sync`, then unmount the temporary location. Retain the original state until the migration has been verified; do not initialize an empty replacement store. 4. With the old state directory unmounted, move it aside to an unused backup path outside the mount point. + If the old state directory is itself a mount point, unmount that filesystem and keep it intact as the backup, + and remove its persistent mount configuration: the directory left beneath it holds no state. Create an empty directory at the original state path. Do not leave the old stores under the mount: a missing mount at boot must not expose stale state as a usable fallback. 5. Configure the new filesystem's persistent mount, for example in `/etc/fstab`. While blockmaster is still @@ -161,7 +163,7 @@ To migrate an existing installation: 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. + Remove the moved original, or the old state filesystem, 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 filesystem journal. In v1.1.2, startup also runs a `syncfs` for each store with changed import records on ext4, XFS, diff --git a/seaweed-block/docs/releases/v1.1.2.md b/seaweed-block/docs/releases/v1.1.2.md index 64b5013d8c..6dd7637bc6 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 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. +- **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 (if it is a mount point itself, unmount it and keep that filesystem as the backup) 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.