Skip to content

Commit

Permalink
Merge pull request #1466 from evandeaubl/main
Browse files Browse the repository at this point in the history
Sync only the target filesystem at the end of mover tasks
  • Loading branch information
openshift-merge-bot[bot] authored Dec 11, 2024
2 parents 0f8c557 + 58fec6f commit e3e8da7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mover-rclone/active.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ destination)
error 1 "unknown value for DIRECTION: ${DIRECTION}"
;;
esac
sync
sync -f "${MOUNT_PATH}"
echo "Rclone completed in $(( SECONDS - START_TIME ))s"
2 changes: 1 addition & 1 deletion mover-restic/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ for op in "$@"; do
"restore")
ensure_initialized
do_restore
sync
sync -f "${DATA_DIR}"
;;
*)
error 2 "unknown operation: $op"
Expand Down
6 changes: 5 additions & 1 deletion mover-rsync-tls/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,9 @@ fi
wait
echo "Stunnel completed shut down."

sync
if test -b $BLOCK_TARGET; then
sync -f $BLOCK_TARGET
else
sync -f $TARGET
fi
echo "Sync complete, exiting."
4 changes: 3 additions & 1 deletion mover-rsync/destination.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "command=\"/mover-rsync/destination-command.sh\",restrict $(</keys/source.pub)" > ~/.ssh/authorized_keys

MOUNT_PATH="/data"
VOLUME_MODE="filesystem"
if test -b /dev/block; then
VOLUME_MODE=block
MOUNT_PATH="/dev/block"
fi
echo "Destination PVC volumeMode is $VOLUME_MODE"

Expand All @@ -68,6 +70,6 @@ if [[ -e /tmp/exit_code ]]; then
CODE="$CODE_IN"
fi
fi
sync
sync -f "${MOUNT_PATH}"
echo "Exiting... Exit code: $CODE"
exit "$CODE"
1 change: 0 additions & 1 deletion mover-rsync/source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ do
done
set -e
echo "Rsync completed in $(( SECONDS - START_TIME ))s"
sync
if [[ $rc -eq 0 ]]; then
echo "Synchronization completed successfully. Notifying destination..."
# ssh does not take [ip] format for ipv6, so use DESTINATION_ADDRESS rather than URL_DESTINATION_ADDRESS
Expand Down

0 comments on commit e3e8da7

Please sign in to comment.