Defer pending snapshot promotion until parity sync

This commit is contained in:
Andrea Mazzoleni 2026-08-12 14:53:58 +02:00
parent 554adc9048
commit 6cab8e3909
48 changed files with 352 additions and 145 deletions

View file

@ -1507,7 +1507,7 @@ Snapshots
All other commands operate exclusively on the live filesystem.
Snapshots Lifecycle
SnapRAID manages two specific snapshots, `stable` and `pending`,
SnapRAID manages three specific snapshots, `stable`, `pending`, and `scan`,
within a hidden directory at the root of each data subvolume.
In Btrfs, Bcachefs, and NTFS it's used the `.snapraid/` directory,
in ZFS the standard `.zfs/snapshot/`.
@ -1517,8 +1517,12 @@ Snapshots Lifecycle
compute the current parity. It serves as the primary data source
for `scrub`, `check`, and `fix` commands.
The `pending` snapshot is a temporary image created at the start
of a `sync` to provide a frozen state for parity computation.
The `scan` snapshot is a temporary image created at the start
of a `sync` to provide a frozen state for scanning and parity computation.
After scanning and saving the new content state, it replaces the previous
`pending` snapshot.
The `pending` snapshot is the image used by an interrupted sync.
Upon successful completion of the operation, the previous `stable`
snapshot is deleted, and the `pending` snapshot is promoted to
take its place as the new stable reference.