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 @@ ...@@ -17,7 +17,7 @@
# so WSREP_VERSION is produced regardless # so WSREP_VERSION is produced regardless
# Set the patch version # Set the patch version
SET(WSREP_PATCH_VERSION "7.5") SET(WSREP_PATCH_VERSION "7.6")
# Obtain patch revision number # Obtain patch revision number
SET(WSREP_PATCH_REVNO $ENV{WSREP_REV}) SET(WSREP_PATCH_REVNO $ENV{WSREP_REV})
......
...@@ -111,15 +111,9 @@ static my_bool find_wsrep_new_cluster (int* argc, char* argv[]) ...@@ -111,15 +111,9 @@ static my_bool find_wsrep_new_cluster (int* argc, char* argv[])
{ {
ret= TRUE; ret= TRUE;
*argc -= 1; *argc -= 1;
if (*argc == i) /* preserve the order of remaining arguments */
{ // last argument, just zero it up memmove(&argv[i], &argv[i + 1], (*argc - i)*sizeof(argv[i]));
argv[i]= NULL; argv[*argc]= NULL;
}
else
{ // not the last argument, copy the last one over and zero that up.
argv[i]= argv[*argc];
argv[*argc]= NULL;
}
} }
} }
......
...@@ -947,9 +947,6 @@ have_sleep=1 ...@@ -947,9 +947,6 @@ have_sleep=1
# maximum number of wsrep restarts # maximum number of wsrep restarts
max_wsrep_restarts=0 max_wsrep_restarts=0
# maximum number of wsrep restarts
max_wsrep_restarts=0
while true while true
do do
rm -f "$pid_file" # Some extra safety rm -f "$pid_file" # Some extra safety
......
...@@ -67,6 +67,15 @@ check_pid_and_port() ...@@ -67,6 +67,15 @@ check_pid_and_port()
MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete" MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete"
rm -rf "$MAGIC_FILE" 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 # Old filter - include everything except selected
# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \ # FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \
# --exclude '*.conf' --exclude core --exclude 'galera.*' \ # --exclude '*.conf' --exclude core --exclude 'galera.*' \
...@@ -74,9 +83,8 @@ rm -rf "$MAGIC_FILE" ...@@ -74,9 +83,8 @@ rm -rf "$MAGIC_FILE"
# --exclude '*.[0-9][0-9][0-9][0-9][0-9][0-9]' --exclude '*.index') # --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 # 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 '-! */*') FILTER=(-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes'
# Old versions of rsync have a bug transferring filter rules to daemon, so specify filter rules directly to daemon -f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /*/' -f '- /*')
FILTER_DAEMON="- lost+found + /ib_lru_dump + /ibdata* + ib_logfile* + */ -! */*"
if [ "$WSREP_SST_OPT_ROLE" = "donor" ] if [ "$WSREP_SST_OPT_ROLE" = "donor" ]
then then
...@@ -107,54 +115,58 @@ then ...@@ -107,54 +115,58 @@ then
# 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 --archive --no-times --ignore-times --inplace --delete --quiet \ rsync --owner --group --perms --links --specials \
--no-recursive --dirs \ --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-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 case $RC in
;; 12) RC=71 # EPROTO
12) RC=71 # EPROTO wsrep_log_error \
wsrep_log_error \ "rsync server on the other end has incompatible protocol. " \
"rsync server on the other end has incompatible protocol. " \ "Make sure you have the same version of rsync on all nodes."
"Make sure you have the same version of rsync on all nodes." ;;
;; 22) RC=12 # ENOMEM
22) RC=12 # ENOMEM ;;
;; *) RC=255 # unknown error
*) RC=255 # unknown error ;;
;; esac
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 # 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 count=1
[ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo) [ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo)
[ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu) [ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu)
find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \ find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \
rsync --archive --no-times --ignore-times --inplace --delete --quiet \ rsync --owner --group --perms --links --specials \
$WHOLE_FILE_OPT "$WSREP_SST_OPT_DATA"/{}/ \ --ignore-times --inplace --recursive --delete --quiet \
rsync://$WSREP_SST_OPT_ADDR/{} || RC=$? $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:" popd >/dev/null
case $RC in
0) RC=0 # Success
;;
*) RC=255 # unknown error
;;
esac
[ $RC -ne 0 ] && exit $RC
if [ $RC -ne 0 ]; then
wsrep_log_error "find/rsync returned code $RC:"
exit 255 # unknown error
fi
else # BYPASS else # BYPASS
wsrep_log_info "Bypassing state dump." wsrep_log_info "Bypassing state dump."
...@@ -203,19 +215,14 @@ then ...@@ -203,19 +215,14 @@ then
cat << EOF > "$RSYNC_CONF" cat << EOF > "$RSYNC_CONF"
pid file = $RSYNC_PID pid file = $RSYNC_PID
use chroot = no use chroot = no
[$MODULE-with_filter] read only = no
path = $WSREP_SST_OPT_DATA timeout = 300
read only = no uid = $MYUID
timeout = 300 gid = $MYGID
uid = $MYUID
gid = $MYGID
filter = $FILTER_DAEMON
[$MODULE] [$MODULE]
path = $WSREP_SST_OPT_DATA path = $WSREP_SST_OPT_DATA
read only = no [$MODULE-log_dir]
timeout = 300 path = $WSREP_LOG_DIR
uid = $MYUID
gid = $MYGID
EOF EOF
# rm -rf "$DATA"/ib_logfile* # we don't want old logs around # rm -rf "$DATA"/ib_logfile* # we don't want old logs around
......
...@@ -424,10 +424,10 @@ case "$mode" in ...@@ -424,10 +424,10 @@ case "$mode" in
fi fi
exit $r exit $r
;; ;;
'boostrap') 'bootstrap')
# Bootstrap the cluster, start the first node # Bootstrap the cluster, start the first node
# that initiate the cluster # that initiate the cluster
echo $echo_n "Bootstrapping cluster)" echo $echo_n "Bootstrapping the cluster"
$0 start $other_args --wsrep-new-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