#!/bin/bash

set -e

orchestrator-client -c register-candidate -i 127.0.0.1:10113 --promotion-rule prefer
test-retry orchestrator-client -c stop-replica -i 127.0.0.1:10112
mysql -uci -pci -h 127.0.0.1 --port=10111 -e "update test.heartbeat set hint='mysql-failover-candidate-lag-cross-datacenter'"
sleep 2
mysqladmin -uci -pci -h 127.0.0.1 --port=10111 shutdown
sleep 20
