| 1 |
--echo Loading wsrep provider ... |
| 2 |
|
| 3 |
--disable_query_log |
| 4 |
# |
| 5 |
# count occurences of successful node starts in error log |
| 6 |
# |
| 7 |
perl; |
| 8 |
use strict; |
| 9 |
my $test_log=$ENV{'LOG_FILE'} or die "LOG_FILE not set"; |
| 10 |
my $test_log_copy=$test_log . '.copy'; |
| 11 |
if (-e $test_log_copy) { |
| 12 |
unlink $test_log_copy; |
| 13 |
} |
| 14 |
|
| 15 |
EOF |
| 16 |
--copy_file $LOG_FILE $LOG_FILE.copy |
| 17 |
|
| 18 |
# |
| 19 |
# now join to the cluster |
| 20 |
# |
| 21 |
--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; |
| 22 |
|
| 23 |
--enable_query_log |
| 24 |
|
| 25 |
# |
| 26 |
# Cluster address change above, will launch SST/IST |
| 27 |
# if mysqldump ST has been configured, mysqld will close all |
| 28 |
# client connections, and it will be hard for us to poll for |
| 29 |
# cluster status during SST process, therefore wait_until_connected_again.inc |
| 30 |
# and wait_until_ready.inc may fail in this phase |
| 31 |
# To workaround this, we do first lazy polling here just to see when |
| 32 |
# client connections will be possible, and after that check for node readyness |
| 33 |
# |
| 34 |
--disable_result_log |
| 35 |
--disable_query_log |
| 36 |
|
| 37 |
--error 0,1 |
| 38 |
perl; |
| 39 |
use strict; |
| 40 |
my $logfile = $ENV{'LOG_FILE'} or die ("no error log file set"); |
| 41 |
|
| 42 |
my $counter = 1000; |
| 43 |
#my $found = false |
| 44 |
|
| 45 |
while ($counter > 0) { |
| 46 |
|
| 47 |
open(FILE, "$logfile") or die("Unable to open $logfile : $!\n"); |
| 48 |
my $new_sync_count = () = grep(/Synchronized with group/g,<FILE>); |
| 49 |
close(FILE); |
| 50 |
|
| 51 |
open(FILEN, "$logfile.copy") or die("Unable to open $logfile.copy : $!\n"); |
| 52 |
my $old_sync_count = () = grep(/Synchronized with group/g,<FILEN>); |
| 53 |
close(FILEN); |
| 54 |
|
| 55 |
if ($new_sync_count > $old_sync_count ) { |
| 56 |
exit(0); |
| 57 |
} |
| 58 |
$counter--; |
| 59 |
sleep(5); |
| 60 |
} |
| 61 |
exit(1); |
| 62 |
EOF |
| 63 |
if ($errno) |
| 64 |
{ |
| 65 |
--echo "SST failed $errno" |
| 66 |
} |
| 67 |
|
| 68 |
--remove_file $LOG_FILE.copy |
| 69 |
|
| 70 |
--enable_query_log |
| 71 |
--enable_result_log |
| 72 |
#--eval SET GLOBAL log_error = $log_error_; |
| 73 |
|
| 74 |
--source include/galera_wait_ready.inc |