diff --git a/seaweed-block/docs/persisted-state.md b/seaweed-block/docs/persisted-state.md index ff1640010b..aa956dccf2 100644 --- a/seaweed-block/docs/persisted-state.md +++ b/seaweed-block/docs/persisted-state.md @@ -2,13 +2,16 @@ **Use this when:** you upgrade in place, or you want to know what a process leaves on disk or in SeaweedFS. -Every state the product writes and reads back after a restart is listed here, in three groups: the volume's remote -image in SeaweedFS, blockmaster's own stores, and the files a volume host keeps under `--durable-root`. Each row +Every state the product writes and reads back after a restart is listed here: the volume's remote image in +SeaweedFS, blockmaster's own stores, the files a volume host keeps under `--durable-root`, and the files the +`sw-block` commands write on a host. Each row says where the state lives, which process writes and reads it, how it is encoded and what a reader does with a version it does not know, whether a test pins the v1.0.0 bytes, and whether v1.0.1 changed it. -**v1.0.1 adds no file, object kind, attribute or field to any of them.** A v1.0.1 process reads what v1.0.0 wrote, -and writes the same encodings. Two existing kinds are written in more situations (see +**v1.0.1 adds no file, object kind, attribute or field to any store the daemons (blockmaster and blockvolume) +read.** A v1.0.1 daemon reads what v1.0.0 wrote, and writes the same encodings. The only new files are the ones the +new `sw-block` commands write on a host ([below](#files-the-sw-block-commands-write)); no daemon of v1.0.0 reads +them. Two existing kinds are written in more situations (see [What v1.0.1 writes differently](#what-v101-writes-differently)). "Pinned" means a test checks that v1.0.1 writes, and reads, the exact bytes v1.0.0 wrote for that state (fixtures @@ -38,7 +41,7 @@ All under `/-/`. | Lost ranges of forced moves | `/.lostrange.json` | blockmaster | JSON with version 1; unknown version or bad checksum: the file is skipped | yes, without the optional HEAD times | no | | Store attestations | `/store-attestations.json` | blockmaster | JSON, no version; unknown fields are ignored | yes, without the two optional flags | no | | Store lock | `/.sparrow-authority-lock` | blockmaster | lock file holding the PID, for diagnosis only | not needed | no | -| Volume records | `/volumes/.json` | blockmaster | JSON, no version; unknown fields are ignored; an invalid record stops blockmaster at start | yes | no; one more delete ([below](#what-v101-writes-differently)) | +| Volume records | `/volumes/.json` | blockmaster | JSON, no version; unknown fields are ignored; an invalid record stops blockmaster at start. A restore target's record carries its source volume, source layout id, source snapshot and request id, as in v1.0.0 | yes (a plain volume and a restore target) | no; one more delete ([below](#what-v101-writes-differently)) | | Node inventory | `/nodes/.json` | blockmaster | JSON, no version; unknown fields are ignored | yes | no | | Placements | `/placements/.json` | blockmaster | JSON, no version; unknown fields are ignored | yes | no | | Workspace bindings | `/workspace-bindings/bindings.json` | blockmaster | JSON, no version; unknown fields are ignored | yes | no | @@ -65,6 +68,19 @@ The experimental stores (`--durable-impl smartwal`, `parallel-walstore`) have th `.bin`, refuse other versions, and are not pinned. They are experimental; smartwal does not support the chunk layer. +## Files the sw-block commands write + +New in v1.0.1, since the commands are. They are written by the `sw-block` command on the host, not by a daemon, and +have no v1.0.0 bytes to pin. + +| File | Written by | Read by | Format | +|---|---|---|---| +| `/etc/sw-block/volumes/.env` | `sudo sw-block volume start ` (mode 0640; replaced only with `--replace`, and only while the unit is stopped) | the `sw-blockvolume@` unit, as its environment (`EnvironmentFile=`), and `volume start` itself on its next run | `KEY=value` lines, sorted, values with spaces or quotes quoted | +| `/mini.json` | `sw-block mini --dir ` (mode 0644) | `sw-block mini --reuse` | JSON: size, port shift, weed path, NQN, binary directory | + +The unit template `sw-blockvolume@.service` is shipped in `deploy/systemd/` and installed by you; it is not written +by a command. + ## Not persisted - **Rebuilt after a restart:** the holder's cut status, cleaning cursors and plans, snapshot schedule (a restart