mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
docs(block): move aside the directory an old state mount uncovers
Unmounting an old state filesystem can expose older files that the mount hid, so that directory is not empty; leaving it at the state path would put stale stores beneath the new mount. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6e467bc71
commit
332a3dcdec
2 files changed
+3
-2
No files matched your search
@@ -142,7 +142,8 @@ To migrate an existing installation:
|
||||
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.
|
||||
and remove its persistent mount configuration. The directory it uncovers is not the backup, but it can hold
|
||||
older files the mount hid: move it aside as well, to a separate path.
|
||||
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
|
||||
|
||||
@@ -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 and disable 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.
|
||||
- **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 and disable 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, keep that filesystem as the backup, and move the directory it uncovers aside too) 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.
|
||||
Reference in new issue
Block a user