Skip to content

Implement snbk snapshot metadata update#1104

Open
jamesljlster wants to merge 2 commits intoopenSUSE:masterfrom
jamesljlster:dev_snbk_metadata_update
Open

Implement snbk snapshot metadata update#1104
jamesljlster wants to merge 2 commits intoopenSUSE:masterfrom
jamesljlster:dev_snbk_metadata_update

Conversation

@jamesljlster
Copy link
Contributor

@jamesljlster jamesljlster commented Feb 16, 2026

This pull request implements snapshot metadata update for snbk.

A for-loop shell command is used to calculate checksums instead of using a wildcard path. This avoids the following issues:

  • Fails when no snapshots are present.
  • May exceed command length limits when a large number of snapshots exist.

Snapshot metadata updating is combined in the transfer function. No new snapshot operation function is introduced.

Detail changes:

  • Added a CmdMetaHash module to compute metadata hashes (using sha256sum).
  • Added a new target state TheBigThing::TargetState::LEGACY, indicating that the source snapshot's metadata has changed since the transfer. Snapshots in the target state LEGACY are also valid as Btrfs send parents.
  • Added target-sha256sum-bin to backup config for customization.

resolve #1103

@jamesljlster
Copy link
Contributor Author

The latest commit (1844cd1), rearranges the precondition checks for snapshot restoration. The change avoids an inappropriate error message when trying to restore a legacy snapshot, which is already on the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

snbk: Update the metadata of backed-up snapshots

1 participant