From 0e794c6a692cb9a3a067c12f37163c6c5dd9f2c4 Mon Sep 17 00:00:00 2001 From: angeloudy Date: Thu, 15 Nov 2018 13:51:09 +1100 Subject: [PATCH 1/6] Make mariabackup.sh compatible on FreeBSD --- scripts/wsrep_sst_mariabackup.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 41c0a6d178d..57805f73c47 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -22,6 +22,7 @@ . $(dirname $0)/wsrep_sst_common +OS=$(uname) ealgo="" ekey="" ekeyfile="" @@ -333,6 +334,7 @@ read_cnf() rebuild=$(parse_cnf sst rebuild 0) ttime=$(parse_cnf sst time 0) cpat=$(parse_cnf sst cpat '.*galera\.cache$\|.*sst_in_progress$\|.*\.sst$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$') + [[ $OS == "FreeBSD" ]] && cpat=$(parse_cnf sst cpat '.*galera\.cache$|.*sst_in_progress$|.*\.sst$|.*gvwstate\.dat$|.*grastate\.dat$|.*\.err$|.*\.log$|.*RPM_UPGRADE_MARKER$|.*RPM_UPGRADE_HISTORY$') ealgo=$(parse_cnf xtrabackup encrypt "") ekey=$(parse_cnf xtrabackup encrypt-key "") ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "") @@ -533,7 +535,11 @@ wait_for_listen() local MODULE=$3 for i in {1..50} do - ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break + if [ "$OS" = "FreeBSD" ];then + sockstat -46lp $PORT | grep -qE "^[^ ]* *(socat|nc) *[^ ]* *[^ ]* *[^ ]* *[^ ]*:$PORT" && break + else + ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break + fi sleep 0.2 done echo "ready ${ADDR}/${MODULE}//$sst_ver" @@ -926,7 +932,11 @@ then wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories" - find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -regex $cpat -prune -o -exec rm -rfv {} 1>&2 \+ + if [ "${OS}" = "FreeBSD" ]; then + find -E $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+ + else + find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+ + fi tempdir=$(parse_cnf mysqld log-bin "") if [[ -n ${tempdir:-} ]];then From 216d5f78995b73e3f1372ca9bb7315731932e1c8 Mon Sep 17 00:00:00 2001 From: Tao ZHOU Date: Thu, 29 Nov 2018 12:36:57 +1100 Subject: [PATCH 2/6] use `ps -p` instead of `ps --pid` make it compatible on FreeBSD. If the parent process does not exist, there's no need to kill it. --- scripts/wsrep_sst_mariabackup.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index 57805f73c47..c3b60d1bc07 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -651,13 +651,12 @@ monitor_process() while true ; do - if ! ps --pid "${WSREP_SST_OPT_PARENT}" &>/dev/null; then + if ! ps -p "${WSREP_SST_OPT_PARENT}" &>/dev/null; then wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." - kill -- -"${WSREP_SST_OPT_PARENT}" exit 32 fi - if ! ps --pid "${sst_stream_pid}" &>/dev/null; then + if ! ps -p "${sst_stream_pid}" &>/dev/null; then break fi From cb85803c459ceae885538d941b3456a7b6fef919 Mon Sep 17 00:00:00 2001 From: Tao ZHOU Date: Wed, 2 Jan 2019 15:40:55 +1100 Subject: [PATCH 3/6] Use absolute path for mariabackup binary --- scripts/wsrep_sst_mariabackup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh index c3b60d1bc07..27fc129c549 100644 --- a/scripts/wsrep_sst_mariabackup.sh +++ b/scripts/wsrep_sst_mariabackup.sh @@ -83,7 +83,7 @@ fi pcmd="pv $pvopts" declare -a RC -INNOBACKUPEX_BIN=mariabackup +INNOBACKUPEX_BIN=$(which mariabackup) XBSTREAM_BIN=mbstream XBCRYPT_BIN=xbcrypt # Not available in MariaBackup From b6b15de85ddfa29762c5aa65128f36af0ad3b99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 4 Jan 2019 20:23:13 +0200 Subject: [PATCH 4/6] Disable failing Galera test galera_query_cache. --- mysql-test/suite/galera/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index c5fa1491d34..2e9d2a216ab 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -47,3 +47,4 @@ galera.MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C] galera.MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C] galera.galera_sst_xtrabackup-v2 : MDEV-17848 Galera test failure on galera_sst_xtrabackup-v2[_data_dir] galera.galera_sst_xtrabackup-v2_data_dir : MDEV-17848 Galera test failure on galera_sst_xtrabackup-v2[_data_dir] +galera_query_cache : From 0c20b247de0c1cc7f993e1eba6c4e3367c20e2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Fri, 4 Jan 2019 21:22:41 +0200 Subject: [PATCH 5/6] Disable galera.query_cache test. --- mysql-test/suite/galera/disabled.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 2e9d2a216ab..b7997627fff 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -47,4 +47,4 @@ galera.MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C] galera.MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C] galera.galera_sst_xtrabackup-v2 : MDEV-17848 Galera test failure on galera_sst_xtrabackup-v2[_data_dir] galera.galera_sst_xtrabackup-v2_data_dir : MDEV-17848 Galera test failure on galera_sst_xtrabackup-v2[_data_dir] -galera_query_cache : +query_cache : MDEV-18137: Galera test failure on query_cache From 9edadc29b191d4861e397b1fb9f4f944a279e150 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Tue, 8 Jan 2019 20:41:39 +0530 Subject: [PATCH 6/6] MDEV-17748 innodb.alter_inplace_perfschema fails in buildbot with wrong result - Changed the performance schema query which gives sampling with event counting. It should fix the issue. --- .../suite/innodb/r/alter_inplace_perfschema.result | 9 +++++---- mysql-test/suite/innodb/t/alter_inplace_perfschema.test | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/innodb/r/alter_inplace_perfschema.result b/mysql-test/suite/innodb/r/alter_inplace_perfschema.result index 68e25664031..440a1d0d6b3 100644 --- a/mysql-test/suite/innodb/r/alter_inplace_perfschema.result +++ b/mysql-test/suite/innodb/r/alter_inplace_perfschema.result @@ -1,3 +1,4 @@ +select count_star into @init_count from performance_schema.events_waits_summary_global_by_event_name WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%'; connect ddl, localhost, root,,; update performance_schema.setup_instruments set enabled='yes'; update performance_schema.setup_consumers set enabled='yes'; @@ -8,10 +9,10 @@ SET DEBUG_SYNC = 'row_log_apply_before SIGNAL go WAIT_FOR gone'; ALTER TABLE t1 ADD INDEX(b), ALGORITHM=INPLACE; connection default; SET DEBUG_SYNC = 'now WAIT_FOR go'; -SELECT DISTINCT object_name FROM performance_schema.events_waits_history_long -WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%'; -object_name -tmp/Innodb Merge Temp File +select count_star into @final_count from performance_schema.events_waits_summary_global_by_event_name WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%'; +SELECT @final_count - @init_count; +@final_count - @init_count +11 SET DEBUG_SYNC = 'now SIGNAL gone'; connection ddl; disconnect ddl; diff --git a/mysql-test/suite/innodb/t/alter_inplace_perfschema.test b/mysql-test/suite/innodb/t/alter_inplace_perfschema.test index b832596647f..e0451e121a6 100644 --- a/mysql-test/suite/innodb/t/alter_inplace_perfschema.test +++ b/mysql-test/suite/innodb/t/alter_inplace_perfschema.test @@ -4,6 +4,7 @@ --source include/have_debug_sync.inc --source include/not_embedded.inc +select count_star into @init_count from performance_schema.events_waits_summary_global_by_event_name WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%'; connect (ddl, localhost, root,,); update performance_schema.setup_instruments set enabled='yes'; update performance_schema.setup_consumers set enabled='yes'; @@ -24,9 +25,10 @@ send ALTER TABLE t1 ADD INDEX(b), ALGORITHM=INPLACE; connection default; SET DEBUG_SYNC = 'now WAIT_FOR go'; ---replace_regex /.*[\\\/]tmp/tmp/ -SELECT DISTINCT object_name FROM performance_schema.events_waits_history_long -WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%'; + +select count_star into @final_count from performance_schema.events_waits_summary_global_by_event_name WHERE event_name LIKE '%wait%io%file%innodb%innodb_temp_file%'; + +SELECT @final_count - @init_count; #--exec lsof -p `pidof mysqld` SET DEBUG_SYNC = 'now SIGNAL gone';