MDEV-10432: Post-fix after merging PR#205
This commit is contained in:
parent
cf1b0c1ace
commit
44ccb8f29e
@ -65,28 +65,29 @@ check_pid_and_port()
|
|||||||
|
|
||||||
case $OS in
|
case $OS in
|
||||||
FreeBSD)
|
FreeBSD)
|
||||||
local port_info=$(netstat -46lp ${rsync_port} 2>/dev/null | \
|
local port_info="$(sockstat -46lp ${rsync_port} 2>/dev/null | \
|
||||||
grep ":${rsync_port}")
|
grep ":${rsync_port}")"
|
||||||
local is_rsync=$(echo $port_info | \
|
local is_rsync="$(echo $port_info | \
|
||||||
grep -w '[[:space:]]\+rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null)
|
grep -w '[[:space:]]\+rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if ! which lsof > /dev/null; then
|
if ! which lsof > /dev/null; then
|
||||||
wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
|
wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
|
||||||
exit 2 # ENOENT
|
exit 2 # ENOENT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local port_info=$(lsof -i :$rsync_port -Pn 2>/dev/null | \
|
local port_info="$(lsof -i :$rsync_port -Pn 2>/dev/null | \
|
||||||
grep "(LISTEN)")
|
grep "(LISTEN)")"
|
||||||
local is_listening_all=$(echo $port_info | \
|
local is_rsync="$(echo $port_info | \
|
||||||
grep "*:$rsync_port" 2>/dev/null)
|
grep -w '^rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null)"
|
||||||
local is_listening_addr=$(echo $port_info | \
|
|
||||||
grep "$rsync_addr:$rsync_port" 2>/dev/null)
|
|
||||||
local is_rsync=$(echo $port_info | \
|
|
||||||
grep -w '^rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null)
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
local is_listening_all="$(echo $port_info | \
|
||||||
|
grep "*:$rsync_port" 2>/dev/null)"
|
||||||
|
local is_listening_addr="$(echo $port_info | \
|
||||||
|
grep "$rsync_addr:$rsync_port" 2>/dev/null)"
|
||||||
|
|
||||||
if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then
|
if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then
|
||||||
if [ -z "$is_rsync" ]; then
|
if [ -z "$is_rsync" ]; then
|
||||||
wsrep_log_error "rsync daemon port '$rsync_port' has been taken"
|
wsrep_log_error "rsync daemon port '$rsync_port' has been taken"
|
||||||
@ -202,7 +203,9 @@ then
|
|||||||
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
||||||
then
|
then
|
||||||
# Prepare binlog files
|
# Prepare binlog files
|
||||||
pushd $BINLOG_DIRNAME &> /dev/null
|
OLD_PWD="$(pwd)"
|
||||||
|
cd $BINLOG_DIRNAME
|
||||||
|
|
||||||
binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index)
|
binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index)
|
||||||
binlog_files=""
|
binlog_files=""
|
||||||
for ii in $binlog_files_full
|
for ii in $binlog_files_full
|
||||||
@ -214,14 +217,14 @@ then
|
|||||||
wsrep_log_info "Preparing binlog files for transfer:"
|
wsrep_log_info "Preparing binlog files for transfer:"
|
||||||
tar -cvf $BINLOG_TAR_FILE $binlog_files >&2
|
tar -cvf $BINLOG_TAR_FILE $binlog_files >&2
|
||||||
fi
|
fi
|
||||||
popd &> /dev/null
|
cd "$OLD_PWD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# first, the normal directories, so that we can detect incompatible protocol
|
# first, the normal directories, so that we can detect incompatible protocol
|
||||||
RC=0
|
RC=0
|
||||||
rsync --owner --group --perms --links --specials \
|
eval rsync --owner --group --perms --links --specials \
|
||||||
--ignore-times --inplace --dirs --delete --quiet \
|
--ignore-times --inplace --dirs --delete --quiet \
|
||||||
$WHOLE_FILE_OPT "${FILTER}" "$WSREP_SST_OPT_DATA/" \
|
$WHOLE_FILE_OPT ${FILTER} "$WSREP_SST_OPT_DATA/" \
|
||||||
rsync://$WSREP_SST_OPT_ADDR >&2 || RC=$?
|
rsync://$WSREP_SST_OPT_ADDR >&2 || RC=$?
|
||||||
|
|
||||||
if [ "$RC" -ne 0 ]; then
|
if [ "$RC" -ne 0 ]; then
|
||||||
@ -253,7 +256,8 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# then, we parallelize the transfer of database directories, use . so that pathconcatenation works
|
# then, we parallelize the transfer of database directories, use . so that pathconcatenation works
|
||||||
pushd "$WSREP_SST_OPT_DATA" >/dev/null
|
OLD_PWD="$(pwd)"
|
||||||
|
cd $WSREP_SST_OPT_DATA
|
||||||
|
|
||||||
count=1
|
count=1
|
||||||
[ "$OS" = "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
|
[ "$OS" = "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
|
||||||
@ -266,7 +270,7 @@ then
|
|||||||
$WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \
|
$WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \
|
||||||
rsync://$WSREP_SST_OPT_ADDR/{} >&2 || RC=$?
|
rsync://$WSREP_SST_OPT_ADDR/{} >&2 || RC=$?
|
||||||
|
|
||||||
popd >/dev/null
|
cd "$OLD_PWD"
|
||||||
|
|
||||||
if [ $RC -ne 0 ]; then
|
if [ $RC -ne 0 ]; then
|
||||||
wsrep_log_error "find/rsync returned code $RC:"
|
wsrep_log_error "find/rsync returned code $RC:"
|
||||||
@ -377,7 +381,9 @@ EOF
|
|||||||
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
if ! [ -z $WSREP_SST_OPT_BINLOG ]
|
||||||
then
|
then
|
||||||
|
|
||||||
pushd $BINLOG_DIRNAME &> /dev/null
|
OLD_PWD="$(pwd)"
|
||||||
|
cd $BINLOG_DIRNAME
|
||||||
|
|
||||||
if [ -f $BINLOG_TAR_FILE ]
|
if [ -f $BINLOG_TAR_FILE ]
|
||||||
then
|
then
|
||||||
# Clean up old binlog files first
|
# Clean up old binlog files first
|
||||||
@ -389,7 +395,8 @@ EOF
|
|||||||
echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
|
echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
popd &> /dev/null
|
cd "$OLD_PWD"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [ -r "$MAGIC_FILE" ]
|
if [ -r "$MAGIC_FILE" ]
|
||||||
then
|
then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user