Skip to content

Commit b06e4ed

Browse files
committed
fix(ns-ha): skip rsync during switch
Assume the last sync was successfull and all files are already in place. This change should speedup the switch by few seconds.
1 parent 4b1ccd4 commit b06e4ed

File tree

1 file changed

+5
-0
lines changed
  • packages/keepalived/files/etc/hotplug.d/keepalived

1 file changed

+5
-0
lines changed

packages/keepalived/files/etc/hotplug.d/keepalived/02-rsync

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ set -eu
2222
SRC_DIR="/usr/share/keepalived/rsync"
2323
RESTORE_LIST="$SRC_DIR/tmp/restore_list"
2424

25+
# Do not execute on backup/master switch
26+
if [ "$ACTION" != "NOTIFY_SYNC" ]; then
27+
exit 0
28+
fi
29+
2530
# Ensure source directory exists
2631
if [ ! -d "$SRC_DIR" ]; then
2732
log_err "Source directory does not exist: $SRC_DIR"

0 commit comments

Comments
 (0)