From 7733a1be465c6e9eecd7dcc9763eab653932aa18 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Tue, 4 Nov 2025 19:57:52 +0000 Subject: [PATCH] yet another replication fix. --- common/nfs-services-server.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/nfs-services-server.nix b/common/nfs-services-server.nix index 3f0d660..14aba77 100644 --- a/common/nfs-services-server.nix +++ b/common/nfs-services-server.nix @@ -133,15 +133,16 @@ in echo "Attempting incremental send from $(basename $PREV_LOCAL) to ${standby}" # Try incremental send, if it fails (e.g., parent missing on receiver), fall back to full - if btrfs send -p "$PREV_LOCAL" "$SNAPSHOT_PATH" | \ + # Use -c to help with broken Received UUID chains + if btrfs send -p "$PREV_LOCAL" -c "$PREV_LOCAL" "$SNAPSHOT_PATH" | \ ssh -i "$SSH_KEY" -o StrictHostKeyChecking=accept-new root@${standby} \ "btrfs receive /persist/services-standby"; then echo "Incremental send completed successfully" REPLICATION_SUCCESS=1 else - echo "Incremental send failed (likely missing parent on receiver), falling back to full send with clone source" - # Use -c to specify clone source, maintaining parent relationship even in full send - btrfs send -c "$PREV_LOCAL" "$SNAPSHOT_PATH" | \ + echo "Incremental send failed (likely missing parent on receiver), falling back to full send" + # Plain full send without clone source (receiver may have no snapshots) + btrfs send "$SNAPSHOT_PATH" | \ ssh -i "$SSH_KEY" -o StrictHostKeyChecking=accept-new root@${standby} \ "btrfs receive /persist/services-standby" REPLICATION_SUCCESS=1