| 1 |
# |
| 2 |
# Macro to run wsrep recovery step. This is adapted from |
| 3 |
# suite/galera/include/galera_wsrep_recover.inc, with additional |
| 4 |
# option to pass binlog argument to recovery command. The macro |
| 5 |
# returns recovered position split in uuid and seqno parts. |
| 6 |
# |
| 7 |
# Arguments: |
| 8 |
# |
| 9 |
# wsrep_recover_binlog_opt - Binlog options to recovery command |
| 10 |
# |
| 11 |
# Return: |
| 12 |
# |
| 13 |
# wsrep_recover_start_position_uuid - UUID corresponding to recovered position |
| 14 |
# wsrep_recover_start_position_seqno - seqno corresponding to recovered position |
| 15 |
# |
| 16 |
|
| 17 |
--exec $MYSQLD --defaults-group-suffix=.1 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --log-error=$MYSQL_TMP_DIR/galera_wsrep_recover.log --innodb --wsrep-recover $wsrep_recover_binlog_opt --core-file > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1 |
| 18 |
|
| 19 |
--perl |
| 20 |
use strict; |
| 21 |
my $wsrep_start_position = `grep -a 'WSREP: Recovered position:' $ENV{MYSQL_TMP_DIR}/galera_wsrep_recover.log | sed 's/.*WSREP\:\ Recovered\ position://' | sed 's/^[ \t]*//'`; |
| 22 |
chomp($wsrep_start_position); |
| 23 |
die if $wsrep_start_position eq ''; |
| 24 |
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/galera_wsrep_start_position.inc") or die; |
| 25 |
my ($uuid, $seqno) = split /:/, $wsrep_start_position; |
| 26 |
print FILE "--let \$wsrep_recover_start_position_uuid = $uuid\n"; |
| 27 |
print FILE "--let \$wsrep_recover_start_position_seqno = $seqno\n"; |
| 28 |
close FILE; |
| 29 |
EOF |
| 30 |
|
| 31 |
--source $MYSQL_TMP_DIR/galera_wsrep_start_position.inc |
| 32 |
|
| 33 |
if ($wsrep_recover_start_position_uuid == '') { |
| 34 |
--die "Could not obtain start_position_uuid." |
| 35 |
} |
| 36 |
|
| 37 |
if ($wsrep_recover_start_position_seqno == '') { |
| 38 |
--die "Could not obtain start_position_seqno." |
| 39 |
} |
| 40 |
|
| 41 |
--remove_file $MYSQL_TMP_DIR/galera_wsrep_start_position.inc |