docs: the foreign-source restore code and the volume_not_found contract change

The restore page now names restore_source_not_own for a snapshot of a
restore target; a v1.0.1 release note lists both codes and calls out that
an unknown volume moves from bad_request (exit 2) to volume_not_found
(exit 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
pingqiuandClaude Opus 5.5 committed 2026-11-29 00:56:40 -08:00
1 parent eea9a6a6bb
commit ed82716e7d
3 files changed
+15 -1

No files matched your search

+1
View File
@@ -7,6 +7,7 @@ is still outside the supported boundary.
- [v1.0.0](v1.0.0.md)
- [Planned cleaning convergence after v1.0.0](cleaning-convergence.md)
- [Diagnostic log format](log-format.md)
- [Typed refusal codes of the chunk CLI](cli-refusal-codes.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)
@@ -0,0 +1,13 @@
# v1.0.1 typed refusal codes of the chunk CLI
Scripts that read `sw-block ops chunk` JSON answers should decide by the `code` field, never by the message text.
v1.0.1 gives two refusals a code of their own:
- **A restore refused because the snapshot names another volume's chunks** (a snapshot of a restore target):
`"code":"restore_source_not_own"`, exit 1. It was the generic `"code":"not_admitted"`. The master marks this
refusal with a typed reason, which the CLI maps; other refusals of the same kind stay `not_admitted`.
- **A volume the master does not know** (catalog commands such as `ops chunk snapshots --volume NAME`):
`"code":"volume_not_found"`, **exit 1**. It was `"code":"bad_request"` with **exit 2**. This is a contract change
for scripts that check the exit status: exit 2 now means only a malformed command or another resolve failure.
See [restore a snapshot into a new volume](../standalone-deployment.md#restoring-a-snapshot-into-a-new-volume).
+1 -1
View File
@@ -891,7 +891,7 @@ A restore makes a new volume from a snapshot. The new volume reads every chunk i
#### Lifetime of a restore target
- **The source snapshot cannot be deleted** while v2 exists: `ops chunk snapshot-delete` is refused with `snapshot_has_dependents`. Delete v2 first (see [Delete a volume](volume-lifecycle.md#delete-a-volume)); the snapshot can be deleted after that.
- **A snapshot of v2 cannot be restored:** it names the source's chunks. The restore exits 1 with `"code":"not_admitted"` and a message ending in `snapshot names another volume's chunks: "<snapshot>"`. The refused restore changes nothing: the target name stays free, and a restore from the source's own snapshot may use it.
- **A snapshot of v2 cannot be restored:** it names the source's chunks. The restore exits 1 with `"code":"restore_source_not_own"` (from the master's typed reason, not its text) and a message ending in `snapshot names another volume's chunks: "<snapshot>"`. The refused restore changes nothing: the target name stays free, and a restore from the source's own snapshot may use it.
- **v2's own writes stay in v2:** the source's snapshot never changes.
- **Deleting v2 releases the source snapshot:** `ops chunk volume-delete` of v2 removes it from the snapshot's dependents.
- **`ops chunk release` is a repair step, not part of this procedure.** `sw-block ops chunk release --master MASTER --source v1 --target v2 --chunk-filer FILER` removes a restore target from its source snapshot's dependents. It works only when the target no longer names the source's chunks (it was deleted), or when the target never got its first HEAD (an interrupted restore). In the second case it first tombstones the target's name, so that name can never be created. A live target is refused with `target_live`.