diff --git a/seaweed-block/docs/design/invariants.md b/seaweed-block/docs/design/invariants.md index 059b7a6d4d..b219c873f8 100644 --- a/seaweed-block/docs/design/invariants.md +++ b/seaweed-block/docs/design/invariants.md @@ -393,8 +393,8 @@ stateDiagram-v2 Not reachable in this release: the frozen detach and the pre-copy detach. `/chunk/detach` refuses a valid `frozen` request with `frozen_detach_unsupported` before any provider call (`INV-CUT-FROZEN-DETACH-REFUSED-001`), and blockvolume refuses to start with `--chunk-detach-precopy` (`INV-CUT-PRECOPY-FLAG-REFUSED-001`). So the transitions Admit → FrozenForecast, FrozenForecast → Refused, FrozenForecast → Quiesce, Quiesce → Refused (guest-frozen recheck), Quiesce → FinalFreeze and FinalFreeze → OpenWindow, and the rows Pre-copy admission, Pre-copy detach, Guest-frozen detach (apart from its HTTP400 validation) and Pre-copy host drain, are not reached by a released process. Their code is kept and still tested below the HTTP handler; the text above is unchanged. -Periodic HEAD cuts default to 15 minutes in blockvolume (OSS minimum 5 minutes; -0 explicitly disables); they do not create named snapshots. One five-minute +Periodic HEAD cuts are off by default in blockvolume (`--chunk-capture-interval` +0; when set, at least 5 minutes); they do not create named snapshots. One five-minute context covers a cut, including uploads. Deadline-aborted uploads remain rooted and reusable only while their chunk version and HEAD generation match. diff --git a/seaweed-block/docs/operator-guide.md b/seaweed-block/docs/operator-guide.md index d53fdadf67..215d2cf75f 100644 --- a/seaweed-block/docs/operator-guide.md +++ b/seaweed-block/docs/operator-guide.md @@ -224,6 +224,23 @@ the snapshot name exists only after a request for it succeeds (check with `sw-bl (`TestKnownDefectSnapshotRetryAfterAGenuineConflictCommitsTheDataUnnamed`). A retry that names the snapshot at once is planned for 1.0.1. +A snapshot's time grows with the data changed since the volume's last cut: 64 GiB changed took 122 s (about 2 s +per GiB). `sw-block ops chunk snapshot` waits 60 s by default, so pass `--timeout` above the expected time; the +server bounds one request at 5 minutes whatever `--timeout` says. A request that runs +out of time answers a retryable code: `remote_unavailable` or `deadline_exceeded` when it ran out before its commit, +`outcome_unknown` when it ran out during the commit. Before the commit, the name is withdrawn and no later cut +publishes it; the volume's data is unchanged and stays queued for the next cut. +After `outcome_unknown`, the commit may have landed with the name. +Rerun the snapshot with the same name and a larger `--timeout`: a name already in HEAD is answered with the +snapshot it names, so a rerun never takes a second one. A rerun keeps what a timed-out request already +uploaded: it finds those chunks and sends only the rest. A longer or derived default is planned for 1.0.1. + +With `--host-limit-dir` set (it is off by default), uploads are paced at `--host-limit-upload-bytes-sec` (64 MiB/s by +default) shared by the host's 4 slots, about 16 MiB/s per volume, and the pacing is charged for chunks already +uploaded too. A cut or snapshot with more than about 4.7 GiB changed then cannot finish within the 5 minutes, and a +rerun does not help: the volume is stuck. Do not use `--host-limit-dir` in 1.0.0 for volumes that change more than +about 4 GiB between snapshots. A fix is planned for 1.0.1. + ## Moving a volume, and returning it [Volume lifecycle](volume-lifecycle.md): diff --git a/seaweed-block/docs/releases/README.md b/seaweed-block/docs/releases/README.md index 2ee8a45c10..9149cea04e 100644 --- a/seaweed-block/docs/releases/README.md +++ b/seaweed-block/docs/releases/README.md @@ -4,6 +4,7 @@ Seaweed Block release notes use narrow product claims. Each alpha version names what a user or reviewer can actually run, what QA evidence backs it, and what is still outside the supported boundary. +- [v1.0.0](v1.0.0.md) - [Holder identity and pre-release upgrades](holder-identity.md) - [One live process per volume per host](one-process-per-volume.md) - [Local disk headroom at volume create](local-disk-headroom.md) diff --git a/seaweed-block/docs/releases/v1.0.0.md b/seaweed-block/docs/releases/v1.0.0.md new file mode 100644 index 0000000000..cffd9e464c --- /dev/null +++ b/seaweed-block/docs/releases/v1.0.0.md @@ -0,0 +1,127 @@ +# v1.0.0 + +The first release. The supported configuration is the **single-replica volume** (`--durable-impl walstore-chunk`), +backed up to SeaweedFS with snapshots, restore, moves and volume delete. Replicated volumes ship as a preview: see +[replicated volumes in v1.0: a preview](replicated-volumes-preview.md). + +## Kubernetes +Kubernetes is an alpha in v1.0.0, for supported lab clusters, not production: PVC provisioning and the Helm install +path are available; backup, snapshot and restore on Kubernetes are not claimed (see +[Kubernetes status](../kubernetes-status.md)). The CSI node connects with a plain `nvme connect` and the kernel +defaults, so a pod whose holder does not come back holds I/O for about 600 s when the holder's node is up, and some +13 minutes when it is powered off (derived from the reconnect count; not run). + +## Store layout +- Chunks are named by their index and the SHA-256 of their bytes; manifests are per-shard segments and a root; HEAD + names the current root and the named snapshots. Every name is derived from content, so an existing name is a + complete object. +- Each volume has a random id. References carry ids, so a reference never resolves to another volume. The name of a + deleted volume cannot be used again: create the replacement under another name. +- Each volume's store directory is `-` (for example `db1-3f9a2c7e`), + created exclusively and never reused. Tools resolve a name to its directory only through blockmaster's volume + record. +- Removal of unreachable objects is a conditional mark and then a conditional delete on the object itself, so a late + delete never removes an object a newer image uses. + +## Upgrade +- This is the first release. A store written by a pre-release build is refused at start + (`chunkstore: legacy store format; recreate the volume`); there is no conversion. Recreate such volumes. +- No downgrade: a local data directory written by this release is refused by earlier builds. + +## Durability and start-up +- **Recovery point.** A stopped volume keeps everything it acknowledged, on its host. A lost host's volume comes back + from its last cut, the last point published to SeaweedFS. By default there is no periodic capture and one scheduled + snapshot a day (`--chunk-snapshot-schedule=daily:7`), so with defaults a host loss can lose up to a day of + acknowledged writes. For a newer recovery point, set `--chunk-capture-interval` (at least 5 minutes) or take a + snapshot before risky work. +- Every read from the SeaweedFS store is checked against the chunk's content hash (guest reads, the first read of a + restored volume's chunk, and restores); a damaged object is refused with a typed error, never served or installed. +- Extents are flushed only up to the acknowledged log position. +- blockvolume waits in-process while blockmaster is unreachable at start, and serves once blockmaster is back and its + barrier has passed. A volume that was moved away or deleted exits 78; 75 means only that blockmaster could not be + reached. +- A failed directory fsync after an authority record's rename stops blockmaster with exit 74; the restart reloads + what is on disk. +- Empty local data at the holder's own epoch (a wrong or unmounted data directory) is refused with the cure named; a + forced move records the lost range. + +## Cleaning (on by default) +- The serving volume removes chunks that no snapshot or current image names: after each snapshot delete or retention + pass, and every `--chunk-maintenance-interval` (default `1h`). Only the volume's holder cleans, never during a + snapshot session; a cut or stop cancels a running cleaning. +- `--chunk-maintenance-gc=false` turns the cleaning off (retention still runs). SeaweedFS vacuum then reclaims the disk + space of removed chunks. + +## Authentication +- Control traffic that leaves the host is authenticated. One host: blockmaster's control API listens on loopback only, + with no certificates; a non-loopback control listener without mutual TLS is refused at start. Several hosts: mutual + TLS, with a fingerprint-pinned role file (viewer, operator, admin, node) and an audit log (`--audit-log`) of every + operator and admin call. +- `--insecure-external-bind` and `--workspace-head-base-url` are removed: blockmaster refuses to start with either. + blockmaster reads volume HEADs through its SeaweedFS filer connection (`--chunk-filer`). + +## Limits +- Up to 10 snapshots per volume; one more is refused with `snapshot_limit` and changes nothing (delete a snapshot or + let retention prune). +- A snapshot takes about 2 s per GiB changed since the last cut (64 GiB: 122 s). The CLI waits 60 s by default and + the server at most 5 minutes per request: pass `--timeout`, and rerun a timed-out snapshot with the same name; a + rerun keeps what was already uploaded (see the operator guide). +- Do not use `--host-limit-dir` (off by default) in 1.0.0 for volumes that change more than about 4 GiB between + snapshots: it paces uploads at about 16 MiB/s per volume, so such a cut or snapshot cannot finish within 5 minutes + and a rerun does not help (fix planned for 1.0.1). +- Snapshot names up to 64 bytes; up to 4 labels per snapshot (keys up to 24 bytes, values up to 32 bytes). +- Up to 4 restore targets per snapshot and 16 per volume at a time. +- A volume's size, block size and chunk size are fixed at creation; resize is not supported, and a restore target + always has its source's geometry. + +## Not in this release +- Fork (a writable copy of a live volume): restore from a snapshot instead. +- `sw-block ops chunk gc`: removed; space is reclaimed by the volume's own cleaning, then SeaweedFS vacuum. +- Independent restore targets: a restored volume keeps reading its source's unchanged chunks, fetching each the first + time the guest reads or writes it (there is no background fill). Its source snapshot, and the source volume, cannot + be deleted while it depends on them: delete or release the restored volume first. A volume's plain snapshots, with + no restored volume depending on them, are deleted with the volume. +- Authentication of the SeaweedFS links and of the volume process's loopback HTTP routes. + +## Operator rules +- Do not edit or copy a volume's local data directory by hand. +- Run exactly one blockmaster per cluster; a second one on another host is not detected in this release. +- Never restore blockmaster's data directory from a backup or a copy: an older authority record reissues epochs that + were already used. To recover, re-create the volumes from their snapshots. +- A delete right after a stop, or after a start or move that never served, is refused (`live until `) until the + lease horizon plus the clock-skew margin has passed (about a minute with default flags); then the same delete + completes. Retry with the same request id; there is no bypass. + +## Known limits +- If the outcome of a chunk upload is unknown (for example the connection drops mid-request), the object may remain in + SeaweedFS unreferenced; the volume's cleaning does not reclaim it. `weed shell volume.fsck -collection -v` lists such objects; do not use its delete option on block data. +- A restored volume takes no scheduled snapshots while any of its chunks is still only in the source snapshot (the + pass is skipped as `restoring`). Read the whole device once if a restored volume must be backed up on schedule. +- A restored volume records which chunks it has fetched only at its next checkpoint: after a crash, chunks fetched + since then are fetched again from the source snapshot (no data is lost). +- A snapshot of a restored volume cannot itself be a restore source (`restore_source_not_own`): restore chains are one + level deep. +- A refused restore (for example from a snapshot of a restored volume) answers `not_admitted` with its cause + (`snapshot names another volume's chunks`) after a misleading `layout store not ready:` prefix, and it leaves the + target name bound: a later restore under that name is refused with `target_exists`. Restore under another target + name. +- A volume-delete refused with `snapshot_has_dependents` has already reserved the volume: it does not serve again + (`ops workspace show` answers `workspace: volume is being deleted`). Delete or release the restored volume that + depends on the snapshot, then run the same delete again. +- A volume created at run time (`CreateVolume`, the Kubernetes CSI path) and not placed in the cluster spec is served + only when blockmaster runs with `--lifecycle-product-loop-interval` set; the shipped Kubernetes stacks set it. +- blockmaster reads its cluster spec only at start: a new volume, restore target or host listed there takes effect + after a blockmaster restart. A restart that blockmaster answers within about 10 s interrupts no serving volume; a + longer one stops the holders (exit 75), which serve again at least about 50 s after blockmaster is back. +- A snapshot that meets a concurrent change of the volume's HEAD answers `head_conflict`: retry it. If that retry + answers `internal` `snapshot "NAME" of VOL is not in HEAD after its commit`, retry once more; the data was committed + either way, and the name is recorded only by the attempt that succeeds. +- A guest's NVMe/TCP connection, with the documented connect options, waits for a stopped target before outstanding + I/O fails: about 181 s when the holder process is stopped and its host is up (the case of a standalone guest, which + runs on its volume's primary host and connects over loopback; a powered-off host takes that guest down with it), + and about 464 s when the holder's host is powered off and the guest is on another host. See + [host connect settings](../operator-guide.md#host-connect-settings). +- One SeaweedFS filer per chunk store: it is a single point of availability for cuts, snapshots and moves. +- Every deleted volume leaves one small record in blockmaster's deletion store, which keeps the name from being + reused.