shell: keep the source readonly when the incomplete target copy cannot be deleted (#10705)

This commit is contained in:
Chris Lu
2026-08-10 12:56:45 -07:00
committed by GitHub
parent d4d8e097dd
commit 0b1f0cafee
+4 -1
View File
@@ -117,7 +117,10 @@ func LiveMoveVolume(ctx context.Context, grpcDialOption grpc.DialOption, writer
deleteCtx, deleteCancel := context.WithTimeout(context.WithoutCancel(ctx), 30*time.Second)
defer deleteCancel()
if dErr := deleteVolume(deleteCtx, grpcDialOption, volumeId, targetVolumeServer, false, true); dErr != nil {
log.Printf("failed to delete the incomplete copy of volume %d on %s: %v", volumeId, targetVolumeServer, dErr)
// Restoring the source while the stale target stays mounted
// risks divergent replicas; re-running the move recovers both.
log.Printf("volume %d is left readonly on %s: failed to delete the incomplete copy on %s: %v; re-run volume.move to recover", volumeId, sourceVolumeServer, targetVolumeServer, dErr)
return
}
}
restoreCtx, restoreCancel := context.WithTimeout(context.WithoutCancel(ctx), 30*time.Second)