summaryrefslogtreecommitdiff
path: root/scripts/wsrep_sst_mysqldump.sh
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-06-16 14:55:14 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-06-16 14:55:14 -0400
commit1fbb70559b45fee8be142e44249e8fc81b8ee3a8 (patch)
tree8fed89ea6331c1d44908f5673d4b3fa662c0253d /scripts/wsrep_sst_mysqldump.sh
parent20279b0473b959172a3bffe14940f6708dabad30 (diff)
downloadmariadb-git-1fbb70559b45fee8be142e44249e8fc81b8ee3a8.tar.gz
MDEV#6316: Fix mysqldump SST method to transfer binlog
state to the joiner In mysqldump SST, if Galera nodes are started with --log-bin and -log-slave-updates, the GTID sequence increases as the dump is played on the joiner, leaving behind the donor. This patch introduces a new mysqldump option --galera-sst-mode, which if enabled, would a) Add command to set off binary logging (log_bin=OFF). b) Add command to set @@global.gtid_binlog_state to that of donor. This will help in keeping the GTIDs consistent post-SST across the nodes.
Diffstat (limited to 'scripts/wsrep_sst_mysqldump.sh')
-rw-r--r--scripts/wsrep_sst_mysqldump.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh
index 3fce316f379..a8ed19c5381 100644
--- a/scripts/wsrep_sst_mysqldump.sh
+++ b/scripts/wsrep_sst_mysqldump.sh
@@ -79,7 +79,7 @@ STOP_WSREP="SET wsrep_on=OFF;"
MYSQLDUMP="mysqldump $AUTH -S$WSREP_SST_OPT_SOCKET \
--add-drop-database --add-drop-table --skip-add-locks --create-options \
--disable-keys --extended-insert --skip-lock-tables --quick --set-charset \
---skip-comments --flush-privileges --all-databases"
+--skip-comments --flush-privileges --all-databases --galera-sst-mode"
# mysqldump cannot restore CSV tables, fix this issue
CSV_TABLES_FIX="
@@ -118,8 +118,13 @@ $MYSQL -e"$STOP_WSREP SET GLOBAL SLOW_QUERY_LOG=OFF"
RESTORE_GENERAL_LOG="SET GLOBAL GENERAL_LOG=$GENERAL_LOG_OPT;"
RESTORE_SLOW_QUERY_LOG="SET GLOBAL SLOW_QUERY_LOG=$SLOW_LOG_OPT;"
+# reset master for 10.0 to clear gtid state
+RESET_MASTER="RESET MASTER;"
+
+
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
then
+ (echo $STOP_WSREP && echo $RESET_MASTER) | $MYSQL || true
(echo $STOP_WSREP && $MYSQLDUMP && echo $CSV_TABLES_FIX \
&& echo $RESTORE_GENERAL_LOG && echo $RESTORE_SLOW_QUERY_LOG \
&& echo $SET_START_POSITION \