Commit ac5d1d76 authored by Jan Lindström's avatar Jan Lindström

Merged revisions 3916--3921 from lp:~codership/codership-mysql/5.5-23

```---------------------------------------------------------
revno: 3921
fixes bug: https://launchpad.net/bugs/1228149
committer: Alexey Yurchenko <alexey.yurchenko@codership.com>
branch nick: 5.5-23
timestamp: Mon 2013-09-23 18:29:42 +0300
message:
  References lp:1228149 - fixing typos.
```

---------------------------------------------------------
revno: 3920
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Fri 2013-09-20 15:43:18 +0400
message:
  References lp:1201893 - remove setenv("WSREP_LOG_DIR") from ha_innodb.cc
------------------------------------------------------------
revno: 3919
tags: wsrep_23.7.6
fixes bug: https://launchpad.net/bugs/1087368
committer: Alexey Yurchenko <alexey.yurchenko@codership.com>
branch nick: 5.5-23
timestamp: Thu 2013-09-19 06:00:43 +0300
message:
  References lp:1087368 - fix to preserve the order of options in case --wsrep-new-cluster is i
n the middle of option list
------------------------------------------------------------
revno: 3918
committer: Alexey Yurchenko <alexey.yurchenko@codership.com>
branch nick: 5.5-23\ 
timestamp: Wed 2013-09-18 23:22:55 +0300
message:
  bumped wsrep patch version number to 7.6
------------------------------------------------------------
revno: 3917
committer: Vladislav Klyachin <vladislav.klyachin@codership.com>
branch nick: 5.5-23
timestamp: Wed 2013-09-18 20:11:39 +0400
message:
  References lp:1218944 - wsrep_sst_rsync now recognizes log_group_home_dir
------------------------------------------------------------
revno: 3916
fixes bug: https://launchpad.net/bugs/1224775
committer: Alexey Yurchenko <alexey.yurchenko@codership.com>
branch nick: 5.5-23
timestamp: Sun 2013-09-15 21:29:57 +0300
message:
  References lp:1224775 - reworked wsrep_recover to create temporary log file in $DATADIR. Plus
 cleaned up that function slightly.
parent c72126e0
......@@ -17,7 +17,7 @@
# so WSREP_VERSION is produced regardless
# Set the patch version
SET(WSREP_PATCH_VERSION "7.5")
SET(WSREP_PATCH_VERSION "7.6")
# Obtain patch revision number
SET(WSREP_PATCH_REVNO $ENV{WSREP_REV})
......
......@@ -111,17 +111,11 @@ static my_bool find_wsrep_new_cluster (int* argc, char* argv[])
{
ret= TRUE;
*argc -= 1;
if (*argc == i)
{ // last argument, just zero it up
argv[i]= NULL;
}
else
{ // not the last argument, copy the last one over and zero that up.
argv[i]= argv[*argc];
/* preserve the order of remaining arguments */
memmove(&argv[i], &argv[i + 1], (*argc - i)*sizeof(argv[i]));
argv[*argc]= NULL;
}
}
}
return ret;
}
......
......@@ -947,9 +947,6 @@ have_sleep=1
# maximum number of wsrep restarts
max_wsrep_restarts=0
# maximum number of wsrep restarts
max_wsrep_restarts=0
while true
do
rm -f "$pid_file" # Some extra safety
......
......@@ -67,6 +67,15 @@ check_pid_and_port()
MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete"
rm -rf "$MAGIC_FILE"
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd -P)
WSREP_LOG_DIR=${WSREP_LOG_DIR:-$($SCRIPT_DIR/my_print_defaults --defaults-file "$WSREP_SST_OPT_CONF" mysqld server mysqld-5.5 \
| grep -- '--innodb[-_]log[-_]group[-_]home[-_]dir=' | cut -b 29- )}
if [ -n "${WSREP_LOG_DIR:-""}" ]; then
WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$WSREP_LOG_DIR"; cd $WSREP_LOG_DIR; pwd -P)
else
WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P)
fi
# Old filter - include everything except selected
# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \
# --exclude '*.conf' --exclude core --exclude 'galera.*' \
......@@ -74,9 +83,8 @@ rm -rf "$MAGIC_FILE"
# --exclude '*.[0-9][0-9][0-9][0-9][0-9][0-9]' --exclude '*.index')
# New filter - exclude everything except dirs (schemas) and innodb files
FILTER=(-f '- lost+found' -f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /ib_logfile*' -f '+ */' -f '-! */*')
# Old versions of rsync have a bug transferring filter rules to daemon, so specify filter rules directly to daemon
FILTER_DAEMON="- lost+found + /ib_lru_dump + /ibdata* + ib_logfile* + */ -! */*"
FILTER=(-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes'
-f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /*/' -f '- /*')
if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
then
......@@ -107,16 +115,15 @@ then
# first, the normal directories, so that we can detect incompatible protocol
RC=0
rsync --archive --no-times --ignore-times --inplace --delete --quiet \
--no-recursive --dirs \
rsync --owner --group --perms --links --specials \
--ignore-times --inplace --dirs --delete --quiet \
$WHOLE_FILE_OPT "${FILTER[@]}" "$WSREP_SST_OPT_DATA/" \
rsync://$WSREP_SST_OPT_ADDR-with_filter || RC=$?
rsync://$WSREP_SST_OPT_ADDR >&2 || RC=$?
[ $RC -ne 0 ] && wsrep_log_error "rsync returned code $RC:"
if [ "$RC" -ne 0 ]; then
wsrep_log_error "rsync returned code $RC:"
case $RC in
0) RC=0 # Success
;;
12) RC=71 # EPROTO
wsrep_log_error \
"rsync server on the other end has incompatible protocol. " \
......@@ -127,34 +134,39 @@ then
*) RC=255 # unknown error
;;
esac
exit $RC
fi
[ $RC -ne 0 ] && exit $RC
# second, we transfer InnoDB log files
rsync --owner --group --perms --links --specials \
--ignore-times --inplace --dirs --delete --quiet \
$WHOLE_FILE_OPT -f '+ /ib_logfile[0-9]*' -f '- **' "$WSREP_LOG_DIR/" \
rsync://$WSREP_SST_OPT_ADDR-log_dir >&2 || RC=$?
if [ $RC -ne 0 ]; then
wsrep_log_error "rsync innodb_log_group_home_dir returned code $RC:"
exit 255 # unknown error
fi
# then, we parallelize the transfer of database directories, use . so that pathconcatenation works
pushd "$WSREP_SST_OPT_DATA" 1>/dev/null
pushd "$WSREP_SST_OPT_DATA" >/dev/null
count=1
[ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
[ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu)
find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \
rsync --archive --no-times --ignore-times --inplace --delete --quiet \
$WHOLE_FILE_OPT "$WSREP_SST_OPT_DATA"/{}/ \
rsync://$WSREP_SST_OPT_ADDR/{} || RC=$?
rsync --owner --group --perms --links --specials \
--ignore-times --inplace --recursive --delete --quiet \
$WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \
rsync://$WSREP_SST_OPT_ADDR/{} >&2 || RC=$?
popd 1>/dev/null
[ $RC -ne 0 ] && wsrep_log_error "find/rsync returned code $RC:"
case $RC in
0) RC=0 # Success
;;
*) RC=255 # unknown error
;;
esac
[ $RC -ne 0 ] && exit $RC
popd >/dev/null
if [ $RC -ne 0 ]; then
wsrep_log_error "find/rsync returned code $RC:"
exit 255 # unknown error
fi
else # BYPASS
wsrep_log_info "Bypassing state dump."
......@@ -203,19 +215,14 @@ then
cat << EOF > "$RSYNC_CONF"
pid file = $RSYNC_PID
use chroot = no
[$MODULE-with_filter]
path = $WSREP_SST_OPT_DATA
read only = no
timeout = 300
uid = $MYUID
gid = $MYGID
filter = $FILTER_DAEMON
read only = no
timeout = 300
uid = $MYUID
gid = $MYGID
[$MODULE]
path = $WSREP_SST_OPT_DATA
read only = no
timeout = 300
uid = $MYUID
gid = $MYGID
[$MODULE-log_dir]
path = $WSREP_LOG_DIR
EOF
# rm -rf "$DATA"/ib_logfile* # we don't want old logs around
......
......@@ -424,10 +424,10 @@ case "$mode" in
fi
exit $r
;;
'boostrap')
'bootstrap')
# Bootstrap the cluster, start the first node
# that initiate the cluster
echo $echo_n "Bootstrapping cluster)"
echo $echo_n "Bootstrapping the cluster"
$0 start $other_args --wsrep-new-cluster
;;
*)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment