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

@ -1903,7 +1903,7 @@ live filesystems exclusively.
.PP
All other commands operate exclusively on the live filesystem.
.SH 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/\`.
@ -1913,8 +1913,12 @@ successfully completed \`sync\`, containing the exact data used to
compute the current parity. It serves as the primary data source
for \`scrub\`, \`check\`, and \`fix\` commands.
.PP
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.
.PP
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.