From bcda03b4fa3ce8286a264bf3c9b1996ba7088d4f Mon Sep 17 00:00:00 2001 From: sachin Date: Mon, 2 Oct 2017 13:30:48 +0530 Subject: [PATCH 1/4] MDEV-13950 mysqld_safe could not start Galera node after upgrade ... This is regression caused by patch of mdev-10767. 1st problem :- mktmp is invoked without '-t' or specifing tmp directory. 2nd problem :- Since eval_log_error redirect stderr to stdout '2>' will return nothing. and hence $wr_logfile will be empty. Patch Credit:- Andrii Nikitin --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 5564f92a27c..bcaf7b86f5f 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -246,7 +246,7 @@ wsrep_recover_position() { local euid=$(id -u) local ret=0 - local wr_logfile=$(mktemp wsrep_recovery.XXXXXX) + local wr_logfile=$(mktemp /tmp/wsrep_recovery.XXXXXX) # safety checks if [ -z $wr_logfile ]; then @@ -268,7 +268,7 @@ wsrep_recover_position() { log_notice "WSREP: Running position recovery with $wr_options" - eval_log_error "$mysqld_cmd --wsrep_recover $wr_options 2> $wr_logfile" + eval "$mysqld_cmd --wsrep_recover $wr_options 2> $wr_logfile" local rp="$(grep 'WSREP: Recovered position:' $wr_logfile)" if [ -z "$rp" ]; then From ebda6e958f0ccfc606d02dfb100e85997f91e370 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 28 Sep 2017 20:28:01 +0200 Subject: [PATCH 2/4] enable MongoDB support in CONNECT --- storage/connect/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index d422b076fc2..dc1f61d0d26 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -247,7 +247,7 @@ ENDIF(CONNECT_WITH_ODBC) # # JDBC with MongoDB Java Driver included but disabled # -#OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) +OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) IF(CONNECT_WITH_JDBC) From a62ebf2590800d70c19f1063e6a506969dd2f7a0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 29 Sep 2017 10:51:00 +0200 Subject: [PATCH 3/4] cppcheck harmless warnings MDEV-13953 mariadb-10.2.9/storage/innobase/row/row0import.cc:3602: possible cut'n'paste error ? MDEV-13955 mariadb-10.2.9/sql/log_event.cc:7671: possible wrong operator ? --- sql/log_event.cc | 2 +- storage/innobase/row/row0import.cc | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 9299932ac4b..81cf7d8c250 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7668,7 +7668,7 @@ Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info) char buf[21]; char buf2[21]; - if (!print_event_info->short_form & !is_flashback) + if (!print_event_info->short_form && !is_flashback) { print_header(&cache, print_event_info, FALSE); longlong10_to_str(seq_no, buf, 10); diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index e220c0275bb..1804cba7065 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -3595,10 +3595,6 @@ row_import_for_mysql( DBUG_EXECUTE_IF("ib_import_cluster_root_adjust_failure", err = DB_CORRUPTION;); - if (err != DB_SUCCESS) { - return(row_import_error(prebuilt, trx, err)); - } - if (err != DB_SUCCESS) { return(row_import_error(prebuilt, trx, err)); } else if (cfg.requires_purge(index->name)) { From 8898c1614d31a73b653988a0d8e13cee8f3e00b0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 4 Oct 2017 18:32:45 +0200 Subject: [PATCH 4/4] cleanup: remove test include file, clarify the comment --- mysql-test/include/fail_start_mysqld.inc | 18 ------------------ mysql-test/mysql-test-run.pl | 6 +++--- mysql-test/r/tc_heuristic_recover.result | 1 - mysql-test/t/tc_heuristic_recover.test | 24 ++++++++---------------- 4 files changed, 11 insertions(+), 38 deletions(-) delete mode 100644 mysql-test/include/fail_start_mysqld.inc diff --git a/mysql-test/include/fail_start_mysqld.inc b/mysql-test/include/fail_start_mysqld.inc deleted file mode 100644 index bb1085b5dd7..00000000000 --- a/mysql-test/include/fail_start_mysqld.inc +++ /dev/null @@ -1,18 +0,0 @@ -# ==== Usage ==== -# -# [--let $restart_parameters= --innodb-force-recovery=0 --innodb-read-only=1] -# [--let $mysqld_stub_cmd= $MYSQLD_LAST_CMD] -# [--let $error_log= $MYSQLTEST_VARDIR/log/mysqld.1.err] -# --source include/fail_restart_mysqld.inc - -# Evaluate the default of $error_log -if (!$error_log) -{ - --let $error_log= $MYSQLTEST_VARDIR/log/mysqld.1.err -} - ---error 1 ---exec $mysqld_stub_cmd $restart_parameters >> $error_log 2>&1 - -# As the server is stopped ---disable_reconnect diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index dceae892c0f..7176892623e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5055,9 +5055,9 @@ sub mysqld_start ($$) { } - # "Dynamic" version of MYSQLD_CMD is reevaluated with each mysqld_start. - # Use it to restart the server at testing a failing server start (e.g - # due to incompatible options). + # Command line for mysqld started for *this particular test*. + # Differs from "generic" MYSQLD_CMD by including all command line + # options from *.opt and *.combination files. $ENV{'MYSQLD_LAST_CMD'}= "$exe @$args"; if ( $opt_gdb || $opt_manual_gdb ) diff --git a/mysql-test/r/tc_heuristic_recover.result b/mysql-test/r/tc_heuristic_recover.result index 8fe3643b174..193a73c77f8 100644 --- a/mysql-test/r/tc_heuristic_recover.result +++ b/mysql-test/r/tc_heuristic_recover.result @@ -1,7 +1,6 @@ call mtr.add_suppression("Can't init tc log"); call mtr.add_suppression("Found 1 prepared transactions!"); call mtr.add_suppression("Aborting"); -set debug_sync='RESET'; CREATE TABLE t1 (i INT) ENGINE=InnoDB; SET GLOBAL innodb_flush_log_at_trx_commit=1; FLUSH TABLES; diff --git a/mysql-test/t/tc_heuristic_recover.test b/mysql-test/t/tc_heuristic_recover.test index c9fa767c249..8cbf7d61143 100644 --- a/mysql-test/t/tc_heuristic_recover.test +++ b/mysql-test/t/tc_heuristic_recover.test @@ -9,7 +9,7 @@ # All this proves no crashes and effective rollback of the transaction. # --source include/have_innodb.inc -# The test logics really requires --log-bin. +# The test logic really requires --log-bin. --source include/have_binlog_format_mixed.inc --source include/have_debug_sync.inc --source include/not_embedded.inc @@ -22,14 +22,7 @@ call mtr.add_suppression("Aborting"); # # The "restart" expect-file facility can't be engaged because the server # having conflicting options may not succeed to boot up. -# Also notice $MYSQLD_CMD is too "static" being unaware of the actual options -# of the last (before shutdown or kill) server run. -# That's why $MYSQLD_LAST_CMD that allows for the server new start -# with more options appended to a stub set which is settled at this very point. ---let $mysqld_stub_cmd= $MYSQLD_LAST_CMD ---let $error_log= $MYSQLTEST_VARDIR/log/mysqld.1.err ---let SEARCH_FILE= $error_log -set debug_sync='RESET'; +--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err CREATE TABLE t1 (i INT) ENGINE=InnoDB; SET GLOBAL innodb_flush_log_at_trx_commit=1; @@ -55,8 +48,8 @@ SELECT * FROM t1; # TODO: MDEV-12700 Allow innodb_read_only startup without prior slow shutdown. --source include/kill_mysqld.inc ---let $restart_parameters= --innodb-force-recovery=4 ---source include/fail_start_mysqld.inc +--error 1 +--exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --innodb-force-recovery=4 --let SEARCH_PATTERN= was in the XA prepared state --source include/search_pattern_in_file.inc @@ -65,8 +58,8 @@ SELECT * FROM t1; --let SEARCH_PATTERN= \\[ERROR\\] Can\\'t init tc log --source include/search_pattern_in_file.inc ---let $restart_parameters= --innodb-force-recovery=4 --tc-heuristic-recover=COMMIT ---source include/fail_start_mysqld.inc +--error 1 +--exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --innodb-force-recovery=4 --tc-heuristic-recover=COMMIT --let SEARCH_PATTERN= was in the XA prepared state --source include/search_pattern_in_file.inc --let SEARCH_PATTERN= Found 1 prepared transactions! @@ -76,8 +69,8 @@ SELECT * FROM t1; --let SEARCH_PATTERN= Please restart mysqld without --tc-heuristic-recover --source include/search_pattern_in_file.inc ---let $restart_parameters= --tc-heuristic-recover=ROLLBACK ---source include/fail_start_mysqld.inc +--error 1 +--exec $MYSQLD_LAST_CMD --log-bin=master-bin --binlog-format=mixed --core-file --loose-debug-sync-timeout=300 --tc-heuristic-recover=ROLLBACK --let SEARCH_PATTERN= was in the XA prepared state --source include/search_pattern_in_file.inc @@ -88,7 +81,6 @@ SELECT * FROM t1; --let SEARCH_PATTERN= Please restart mysqld without --tc-heuristic-recover --source include/search_pattern_in_file.inc ---let $restart_parameters= --source include/start_mysqld.inc --let SEARCH_PATTERN= was in the XA prepared state