diff options
author | Igor Babaev <igor@askmonty.org> | 2019-02-03 18:41:18 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2019-02-03 18:41:18 -0800 |
commit | 37deed3f37561f264f65e162146bbc2ad35fb1a2 (patch) | |
tree | c1cfb6c0995bfcc4ac3fb335f518a8b404413e32 /mysql-test/suite/galera/include/galera_load_provider.inc | |
parent | 658128af43b4d7c6db445164f8ed25ed4d1e3109 (diff) | |
parent | 5b996782be6b752ce50a0ecaa222b0688aa9e75d (diff) | |
download | mariadb-git-37deed3f37561f264f65e162146bbc2ad35fb1a2.tar.gz |
Merge branch '10.4' into bb-10.4-mdev16188
Diffstat (limited to 'mysql-test/suite/galera/include/galera_load_provider.inc')
-rw-r--r-- | mysql-test/suite/galera/include/galera_load_provider.inc | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc index aeab7e6ea19..0f843597d9c 100644 --- a/mysql-test/suite/galera/include/galera_load_provider.inc +++ b/mysql-test/suite/galera/include/galera_load_provider.inc @@ -2,7 +2,75 @@ --disable_query_log --eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; + +# +# count occurences of successful node starts in error log +# +perl; + use strict; + my $test_log=$ENV{'LOG_FILE'} or die "LOG_FILE not set"; + my $test_log_copy=$test_log . '.copy'; + if (-e $test_log_copy) { + unlink $test_log_copy; + } + +EOF +--copy_file $LOG_FILE $LOG_FILE.copy + +# +# now join to the cluster +# --eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; + +--enable_query_log + +# +# Cluster address change above, will launch SST/IST +# if mysqldump ST has been configured, mysqld will close all +# client connections, and it will be hard for us to poll for +# cluster status during SST process, therefore wait_until_connected_again.inc +# and wait_until_ready.inc may fail in this phase +# To workaround this, we do first lazy polling here just to see when +# client connections will be possible, and after that check for node readyness +# +--disable_result_log +--disable_query_log + +--error 0,1 +perl; + use strict; + my $logfile = $ENV{'LOG_FILE'} or die ("no error log file set"); + + my $counter = 1000; + #my $found = false + + while ($counter > 0) { + + open(FILE, "$logfile") or die("Unable to open $logfile : $!\n"); + my $new_sync_count = () = grep(/Synchronized with group/g,<FILE>); + close(FILE); + + open(FILEN, "$logfile.copy") or die("Unable to open $logfile.copy : $!\n"); + my $old_sync_count = () = grep(/Synchronized with group/g,<FILEN>); + close(FILEN); + + if ($new_sync_count > $old_sync_count ) { + exit(0); + } + $counter--; + sleep(5); + } + exit(1); +EOF +if ($errno) +{ +--echo "SST failed $errno" +} + +--remove_file $LOG_FILE.copy + --enable_query_log +--enable_result_log +#--eval SET GLOBAL log_error = $log_error_; --source include/galera_wait_ready.inc |