feat: remove cephmig snapshots during sync and add cleanup command

Users of a subvolume should not see traces of the migration. Each sync
round now deletes the older cephmig-* round snapshots at source and
target and keeps only the newest one as base for the next round. The new
command `cephmig cleanup` deletes the remaining one after the cutover.
Application snapshots are never touched.

The journal marks a snapshot as removed before deleting it, so an
interrupted run finishes the deletion instead of reporting a vanished
snapshot.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-12-03 19:52:13 +01:00
1 parent cc2dff46a0
commit 907d400765
9 files changed
+322 -19

No files matched your search

+7 -1
View File
@@ -209,6 +209,12 @@ for snap in history-1 history-2; do
test "$a" = "$b"
done
python3 /lab/snapshot-identity.py --config "$config" --snapshot history-1
"$binary" cleanup --config "$config" --state "$state" > "$work/cleaned.json"
for side in source_ceph target_ceph; do
names=$("$side" fs subvolume snapshot ls cephfs "$name" --group_name migration |
python3 -c 'import json,sys; print(" ".join(sorted(x["name"] for x in json.load(sys.stdin))))')
test "$names" = "history-1 history-2"
done
completed=true
echo 'PASS: Go migration, historical snapshots, live catch-up, quotas, ACLs, xattrs, sparse-file contents, crash/error resume, exclusive target, finalization'
echo 'PASS: Go migration, historical snapshots, live catch-up, quotas, ACLs, xattrs, sparse-file contents, crash/error resume, exclusive target, finalization, snapshot cleanup'