# clean out the old relay and bin-logs
#
message "Removing old replication logs"
runcmd ssh $secondary "find $datadir -print | grep bin-log | xargs rm -f"
runcmd ssh $secondary "find $datadir -print | grep relay-log | xargs rm -f"
runcmd ssh $secondary rm -f $datadir/master.info
function runcmd {
local cmd="$*"
if ! $cmd ; then
fatal 1 "\"$cmd\" command failed"
fi
}
replicate.sh quits when runcmd encounters exitcode 1 .
When the old replication logs do not exist on the secondary controller, the exit code for the commands to delete the replication logs would be 1.
See
Failure on secondary because the replication logs do not exist:
Temporary fix done in replicate.sh and the replication succeeds. But we may need to differentiate the check between file exists and cannot delete for a reason (permissions may be) and file does not exist and hence exit code is 1.
HA Version : 3.24 Tested with : sh, bash and tcsh
In replicate.sh:
replicate.sh quits when runcmd encounters exitcode 1 . When the old replication logs do not exist on the secondary controller, the exit code for the commands to delete the replication logs would be 1. See
Failure on secondary because the replication logs do not exist:
runcmd should not treat this as fatal. For example if replication was being set up for first time, there may not be old replication logs on secondary.
Temporary fix done in replicate.sh and the replication succeeds. But we may need to differentiate the check between file exists and cannot delete for a reason (permissions may be) and file does not exist and hence exit code is 1.
Changed:
TO: