diff --git a/seaweed-block/docs/releases/v1.1.2.md b/seaweed-block/docs/releases/v1.1.2.md index 2bd019607f..7a3d2a78d0 100644 --- a/seaweed-block/docs/releases/v1.1.2.md +++ b/seaweed-block/docs/releases/v1.1.2.md @@ -2,19 +2,204 @@ v1.1.2 is not yet released. -## Fixed +v1.1.2 is a fix release of the v1.1 line. It changes no stored format. Upgrade in the usual order, the CLI first, then +blockmaster, then each holder (see [Upgrade notes](#upgrade-notes)). -- **Replicated volumes (preview): a queued rebalance no longer undoes an operator failover.** blockmaster's automatic - rebalance and failover name the volume's line they were decided against, and blockmaster refuses one when that line - moved since (another replica or epoch, or other addresses). A rebalance decided just before `sw-block ops failover` - is no longer applied after it. This was a v1.1.1 known issue. +## Fixed v1.1.1 known issues -## Known issue: blockmaster restart can stall on a busy filesystem +- **`sw-block mini` as a non-root user.** `mini` now starts as any user with no `sudo` step. It keeps the volume lock + under `--dir`. It prints every command with the absolute paths of `sw-block` and `weed`. After a failed start, it + prints the `--reuse` command that starts again on the same `--dir`. It no longer takes a scheduled snapshot; take + one with the `sw-block ops chunk snapshot` command it prints. +- **Restarting blockmaster with many declared volumes**, on a dedicated or lightly written state filesystem. At + startup blockmaster now rewrites only the node and placement records whose declaration changed, and keeps the + others as stored. A restart with hundreds of unchanged declared volumes no longer runs past the running volumes' + leases. A node's stored observation time is kept when its declaration is unchanged, so a restart does not make a + silent node look fresh. On a state filesystem with heavy writes, a start can still wait: see + [the busy-filesystem known issue](#known-issue-blockmaster-restart-can-stall-on-a-busy-filesystem). +- **Startup retirement reads can delay blockmaster.** Retiring the metadata of deleted volumes now runs in the + background after blockmaster starts serving, on its own connection, and is paced. A slow filer no longer delays + the start, and a retirement outage no longer slows other calls such as a restore. +- **Replicated volumes (preview): a queued rebalance can undo an operator failover.** blockmaster's automatic + rebalance and failover name the volume line they were decided against. blockmaster refuses one when that line + moved since (another replica or epoch, or other addresses). A rebalance decided just before + `sw-block ops failover` is no longer applied after it. +- **Resuming an interrupted snapshot delete can stop the volume's snapshot deletes and cleaning.** A snapshot delete + no longer publishes an intent whose page lost its data. + - Metadata changes (blockvolume's and `sw-block`'s) send the filer's chunk write condition, so a stale change + cannot land on an object deleted and created again since it was read. + - Publication also re-reads each intent page. + - blockvolume and the writing `sw-block` commands check at start whether the filer enforces the condition. + - On a filer that does not enforce it, only the re-read protects the delete. That narrows the issue but does not + close it: see [the remaining known issue](#known-issue-snapshot-delete-on-a-filer-without-the-chunk-condition). + - A volume that already shows the v1.1.1 issue still needs the repair planned for a later release. -- **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:** In v1.1.2, with the state directory on its own filesystem, blockmaster's start no longer syncs any directory on the shared filesystem. Under one buffered-write load, three starts per case measured shared warm/cold medians of 31.3/122.9 seconds and dedicated medians of 1.6/2.5 seconds, with a dedicated warm maximum of 13.2 seconds. Warm directory fsyncs fell from 30 to 15; shared root-filesystem directory fsyncs fell from 30 to 0. These are measurements under that load, not a start-time promise. Run `sync` after creating and mounting the state filesystem. For a new install, install the units, then mount it and configure its persistent mount and 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 the state 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. +## Behaviour changes -## Lifecycle persistence failures +### A failover blockmaster decided now completes -A blockmaster lifecycle put, import or open-barrier persistence failure exits with durability-unknown status 74 instead of generic status 1. Both immediate termination and the one-second fallback use that status. The best-effort ERROR diagnostic names `lifecycle_persist_failed`. Run blockmaster under supervision so a failed process restarts from durable state; record ordering, recovery barriers and import syncfs selection are unchanged. +Before, a failover could stall with no publication in two cases: +- a volume whose primary served before blockmaster's first check and then died; +- a primary on a node that reads an older format level than the cluster. + +Both now reach a publication. blockmaster's log also follows each failover decision with what happened to it +(queued, already pending, or not submitted and why) and logs every publication. + +### Format finalize refuses while a serving process has not reported + +`sw-block cluster finalize-format` now refuses with `FORMAT_HOSTS_TOO_OLD` (exit 2) while a volume process that may +still serve has not reported reading format level 1. The answer names the host and volume. Upgrade that host's +volume process to v1.1.2 and let it report (one heartbeat), or move the volume away, then retry. A volume whose +holder released it cleanly, or whose lease has ended, does not block. A placement on a host with an old process still +blocks until that process is upgraded or the placement moves. + +The finalize judges each volume by the last report blockmaster received. A delayed report can stand in for a newer +process, so this operator rule still applies: + +- **Format finalize: operator rule.** From the end of the upgrade until `sw-block cluster finalize-format` completes: + - no v1.0.x volume process may run or start on any host. Check it on each host from the running processes + (`/proc//exe --version`) and the units' binaries, each printing exactly the revision of the v1.1.x binary + you installed with `modified=false`, not from blockmaster; + - wait 30 seconds after the last volume process start before finalizing. + + The finalize now refuses while a serving volume process reports an older read level. A delayed heartbeat report + can still stand in for a newer process, and the rule covers that case. v1.1.3 removes the rule. See the + operations manual. + +### Persistence faults exit 74 + +If blockmaster cannot be sure a write of its lifecycle records reached disk (a put, the startup import, the open +barrier), it now exits 74 instead of 1, so that its supervisor restarts it from disk. A finalize that fails after it +replaced the format file does the same; one that fails before that reports the error and leaves level 0. Run +blockmaster under a restarting supervisor, as the shipped unit does. After a finalize exits 74, check +`sw-block cluster format-level` before retrying: it can be 0 or 1. + +### Exit codes: one rule for every command + +Every command now classifies a failure by whether its request may have reached the server: + +| Exit | Meaning | What to do | +| --- | --- | --- | +| 0 | Success | — | +| 1 | Ordinary definite refusal, or the caller ended the attempt before sending | Read the answer | +| 2 | Usage error, or the server refused an argument | Fix the command | +| 3 | `outcome_unknown`: the request may have been admitted | Recover the original operation by its request id, or read the current state, before starting another | +| 4 | Integrity readout not proven | Inspect before acting | +| 5 | Authentication rejected (certificate, trust, name or role) | Fix the credentials | +| 75 | The request was proven not sent, or the server's answer permits a retry | Retry the same operation | +| 78 | Local credential or connection configuration is wrong | Fix the local setup | + +Exceptions kept from v1.1.x: +- `ops chunk verify` exits 1 for an incomplete answer; 3 there means a completed scan with findings. +- `ops failover` exits 3 for an unsent failure (read the line before another move). +- `ops volume create` and `ops volume resolve` keep 75 for a retryable unknown and 78 for definite refusals. +- `cluster finalize-format` and `cluster retire-host` keep 2 for their typed preconditions. + +Changes from v1.1.1 that scripts are most likely to see: + +| Command / failure | v1.1.1 | v1.1.2 | +| --- | --- | --- | +| Workspace commands: connection never made (refused, DNS, handshake timeout) | 3 | 75 | +| Workspace commands: plaintext client at a TLS endpoint (failed preface) | 5 | 75, with a hint to check the TLS settings | +| Workspace and cluster commands: certificate, trust or name rejection | 3, 1 or 75 | 5 | +| Workspace and cluster commands: local credential or configuration error | 2 | 78 | +| Cluster commands: request possibly admitted | 75 or 1 | 3 | +| `ops chunk`: request possibly admitted, including snapshot polls | 75 | 3 | +| `ops chunk`: server error code the CLI does not know | 1 | 3 | +| `ops chunk`: server argument refusal (`bad_request`) | 1 | 2 | +| `ops chunk detach --plain`: malformed seal result after admission | 1 | 3 | +| Snapshot observation: answered "succeeded" without a valid result | 1 | 3 | +| `ops chunk`: retryable `not_admitted` outside volume-delete | 1 | 75 | +| `ops chunk`, `volume restore`, `ops chunk restore`: authentication rejection | 1 or 2 | 5 | +| `volume restore`: typed refusal | 2 | 1 | +| `volume restore`: ambiguous answer | 1 or 2 | 3 | +| Any command: caller deadline or cancel before sending | 75 or 3 | 1 | +| `ops volume create` / `resolve`: DataLoss | 75 / 78 | 4 | +| `ops failover`: DataLoss | 3 | 4 | + +The [CLI refusal codes](cli-refusal-codes.md) page lists every case. + +### blockmaster on its own state filesystem + +With blockmaster's state directory on its own filesystem, its start no longer syncs any directory of the shared +filesystem above it. Under one buffered-write load, three starts per case gave these medians: + +| State directory | Warm start | Cold start | +| --- | --- | --- | +| On the shared filesystem | 31.3 s | 122.9 s | +| On its own filesystem | 1.6 s (maximum 13.2 s) | 2.5 s | + +These are measurements under that load, not a start-time promise. To move existing state, follow the +[state migration steps](../operations-manual.md#1-install-the-binaries-and-units). Migration stops service: +volumes fence once blockmaster's downtime outlasts their leases. + +## Known issues + +### Known issue: format finalize still relies on the operator rule + +See [Format finalize](#format-finalize-refuses-while-a-serving-process-has-not-reported): a delayed heartbeat report +can stand in for a newer process. v1.1.3 carries the process identity on every renewal and removes the rule. + +### Known issue: snapshot delete on a filer without the chunk condition + +On a filer that does not enforce the chunk write condition, the v1.1.1 snapshot-delete issue is narrowed but not +closed. The SeaweedFS filers we tested, 4.52 to 4.55, enforce it. A chunk the filer has queued for deletion but not yet freed can still pass the page re-read. To reduce +exposure, do not resume an interrupted snapshot delete by hand. At start, blockvolume logs +`chunkstore: metadata change guard: page_reread_only` on such a filer. + +### Known issue: blockmaster restart can stall on a busy filesystem + +When blockmaster's state filesystem also holds heavy writes, such as the holders' local data, its start can wait +for the filesystem journal. Under one buffered-write load with the state directory on the shared filesystem, warm +starts had a median of 31.3 seconds (22.5 to 94 seconds), and cold starts a median of 122.9 seconds. These are not +upper bounds. Keep the holders' data off blockmaster's state filesystem (see +[above](#blockmaster-on-its-own-state-filesystem)). Restart blockmaster at low write load on that filesystem. + +### Known issue: blockmaster needs its filer to start + +blockmaster checks that its filer answers before it starts. If the filer is unreachable, blockmaster stops with an +error after about 60 s. Running volumes stop when their leases run out. Start or fix the filer first. + +### Known issue: a walstore volume unit can reach its systemd start limit while blockmaster is unreachable + +Unchanged from [v1.1.1](v1.1.1.md#known-issue-a-walstore-volume-unit-can-reach-its-systemd-start-limit-while-blockmaster-is-unreachable). +Recover with `systemctl reset-failed `, then `systemctl start `. A fix is planned for a later v1.1.x +release. + +### Known issue: `sw-block ops chunk detach --plain` waits for a scheduled periodic cut + +Unchanged from v1.1.1. No data is lost. A fix is planned for a later v1.1.x release. + +### Known issue: plain detach can abort during a periodic checkpoint + +- **Trigger:** a periodic checkpoint's already-issued HEAD update lands while `sw-block ops chunk detach --plain` is stopping background work. +- **Effect:** a confirmed `detach_aborted` means no sealed HEAD was published and serving resumed on the same holder. The CLI can instead report `outcome_unknown` (exit 3); that answer alone proves neither an abort nor resumed guest I/O. If the holder's detach outcome is still unresolved, I/O stays stopped while it settles. +- **What to do:** confirm the original handle before treating this as a retryable abort. The holder keeps the handle only for about `--timeout` plus 5 s after the detach ends, and the CLI gives up about that long after its last progress, so query right after the CLI exits, or from a second shell while it still waits (it prints `sw-block ops chunk detach: id ` on stderr at admission). If no id was printed, skip this GET and follow the unresolved-outcome procedure below, keeping guest I/O stopped. On the holder's host, query the same status address and volume used by the detach, with the id printed by the CLI: + + ```sh + STATUS_ADDR='' + case "$STATUS_ADDR" in + *://*) ;; + *) STATUS_ADDR="http://$STATUS_ADDR" ;; + esac + VOLUME_ID='' + CUT_ID='' + curl --silent --show-error --max-time 5 --get \ + --data-urlencode "volumeID=$VOLUME_ID" \ + --data-urlencode "cutID=$CUT_ID" \ + --write-out '\nHTTP %{http_code}\n' \ + "${STATUS_ADDR%/}/chunk/cut" + ``` + + HTTP 409 with `apiVersion: 1`, the same `cutID`, `code: "detach_aborted"` and `retryable: true` confirms this abort. The retained handle still occupies the detach slot until about `--timeout` plus 5 s after the abort. Wait for that retention to expire before retrying the plain detach; if the retry answers `cut_busy` with reason `detach_in_progress`, wait and retry after expiry. This GET does not start another operation. Handles are transient: HTTP 404 `unknown_cut_id` (including after expiry or a holder restart), a failed query, or an unsettled answer does not confirm an abort. In that case keep guest I/O stopped, preserve the CLI output and holder logs, and [settle the unknown detach outcome](../volume-lifecycle.md#symptoms) before resuming I/O or moving the volume. A definite retryable CLI answer for this case is planned for v1.1.3. + +## Upgrade notes + +- **Order:** the CLI first, then blockmaster, then each holder, as in + [section 7](../operations-manual.md#7-upgrade-and-finalize-the-v11-format). +- **Scripts that check exit codes:** see [Exit codes](#exit-codes-one-rule-for-every-command). The most likely + differences are 75 (not 3) for a connection never made, 3 (not 75) for a request that may have been admitted, and + 5 for every authentication rejection. +- **Finalize from v1.1.0:** follow the operator rule above until `sw-block cluster finalize-format` completes. +- **Supervision:** run blockmaster under a restarting supervisor, so an exit 74 restarts it from disk. +- **`mini` users:** the two `sudo install` lines of the v1.1.1 Quick Start are no longer needed.