File tree Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Expand file tree Collapse file tree 2 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -115,12 +115,12 @@ if $cluster; then
115115 fi
116116fi
117117
118- # Figure out if this instance is in a replication pair
119- if ghe-ssh " $GHE_HOSTNAME " -- " ghe-repl-status -r 2>/dev/null " \
120- | grep -Eq " replica|primary " ; then
121- instance_configured=true
122- echo " WARNING: Restoring to a server with replication enabled interrupts replication. "
123- echo " You will need to reconfigure replication after the restore completes. "
118+ # Figure out if this appliance is in a replication pair
119+ if ghe-ssh " $GHE_HOSTNAME " -- \
120+ " [ -f ' $GHE_REMOTE_ROOT_DIR /etc/github/repl-state' ] " ; then
121+ echo " Error: Restoring to an appliance with replication enabled is not supported. " >&2
122+ echo " Please teardown replication before restoring. " >&2
123+ exit 1
124124fi
125125
126126# Prompt to verify the restore host given is correct. Restoring overwrites
Original file line number Diff line number Diff line change 607607 echo $output | grep -q " The snapshot that is being restored contains a leaked SSH host key."
608608)
609609end_test
610+
611+ begin_test " ghe-restore fails when restore to an active HA pair"
612+ (
613+ set -e
614+
615+ if [ " $GHE_VERSION_MAJOR " -le 1 ]; then
616+ # noop GHE < 2.0, does not support replication
617+ exit 0
618+ fi
619+
620+ rm -rf " $GHE_REMOTE_ROOT_DIR "
621+ setup_remote_metadata
622+
623+ echo " rsync" > " $GHE_DATA_DIR /current/strategy"
624+ touch " $GHE_REMOTE_ROOT_DIR /etc/github/repl-state"
625+
626+ ! output=$( ghe-restore -v -f localhost 2>&1 )
627+
628+ echo $output | grep -q " Error: Restoring to an appliance with replication enabled is not supported."
629+ )
630+ end_test
You can’t perform that action at this time.
0 commit comments