From d038806dfe120af4c130cfd6e9fa184112061115 Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Fri, 8 Mar 2019 16:00:08 +0530 Subject: [PATCH 1/2] MDEV-18855 Mariabackup should fetch innodb_compression_level from running server - Fetch innodb_compression_level from the running server.Add the value of innodb_compression_level in backup-my.cnf file during backup phase. So that prepare can use the innodb_compression_level variable from backup-my.cnf --- extra/mariabackup/backup_mysql.cc | 14 +++++++-- extra/mariabackup/xtrabackup.cc | 12 ++++++- .../mariabackup/page_compression_level.result | 14 +++++++++ .../mariabackup/page_compression_level.test | 31 +++++++++++++++++++ 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/mariabackup/page_compression_level.result create mode 100644 mysql-test/suite/mariabackup/page_compression_level.test diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc index 7f0ad8a8361..93e603133aa 100644 --- a/extra/mariabackup/backup_mysql.cc +++ b/extra/mariabackup/backup_mysql.cc @@ -54,7 +54,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #include "mysqld.h" #include "encryption_plugin.h" #include - +#include "page0zip.h" char *tool_name; char tool_args[2048]; @@ -350,6 +350,7 @@ get_mysql_vars(MYSQL *connection) char *innodb_undo_directory_var = NULL; char *innodb_page_size_var = NULL; char *innodb_undo_tablespaces_var = NULL; + char *page_zip_level_var = NULL; char *endptr; unsigned long server_version = mysql_get_server_version(connection); @@ -379,6 +380,7 @@ get_mysql_vars(MYSQL *connection) {"innodb_undo_directory", &innodb_undo_directory_var}, {"innodb_page_size", &innodb_page_size_var}, {"innodb_undo_tablespaces", &innodb_undo_tablespaces_var}, + {"innodb_compression_level", &page_zip_level_var}, {NULL, NULL} }; @@ -512,7 +514,13 @@ get_mysql_vars(MYSQL *connection) } if (innodb_undo_tablespaces_var) { - srv_undo_tablespaces = strtoul(innodb_undo_tablespaces_var, &endptr, 10); + srv_undo_tablespaces = strtoul(innodb_undo_tablespaces_var, + &endptr, 10); + ut_ad(*endptr == 0); + } + + if (page_zip_level_var != NULL) { + page_zip_level = strtoul(page_zip_level_var, &endptr, 10); ut_ad(*endptr == 0); } @@ -1574,6 +1582,7 @@ bool write_backup_config_file() "innodb_log_block_size=%lu\n" "innodb_undo_directory=%s\n" "innodb_undo_tablespaces=%lu\n" + "innodb_compression_level=%u\n" "%s%s\n" "%s%s\n" "%s\n", @@ -1586,6 +1595,7 @@ bool write_backup_config_file() srv_log_block_size, srv_undo_dir, srv_undo_tablespaces, + page_zip_level, innobase_doublewrite_file ? "innodb_doublewrite_file=" : "", innobase_doublewrite_file ? innobase_doublewrite_file : "", innobase_buffer_pool_filename ? diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index fb897e407e2..ee7acb1f375 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -597,7 +597,8 @@ enum options_xtrabackup OPT_XTRA_TABLES_EXCLUDE, OPT_XTRA_DATABASES_EXCLUDE, - OPT_PROTOCOL + OPT_PROTOCOL, + OPT_INNODB_COMPRESSION_LEVEL }; struct my_option xb_client_options[] = @@ -1145,6 +1146,11 @@ Disable with --skip-innodb-doublewrite.", (G_PTR*) &innobase_use_doublewrite, (G_PTR*)&srv_undo_tablespaces, (G_PTR*)&srv_undo_tablespaces, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 126, 0, 1, 0}, + {"innodb_compression_level", OPT_INNODB_COMPRESSION_LEVEL, + "Compression level used for zlib compression.", + (G_PTR*)&page_zip_level, (G_PTR*)&page_zip_level, + 0, GET_UINT, REQUIRED_ARG, 6, 0, 9, 0, 0, 0}, + {"defaults_group", OPT_DEFAULTS_GROUP, "defaults group in config file (default \"mysqld\").", (G_PTR*) &defaults_group, (G_PTR*) &defaults_group, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -1381,6 +1387,10 @@ xb_get_one_option(int optid, ADD_PRINT_PARAM_OPT(innodb_checksum_algorithm_names[srv_log_checksum_algorithm]); break; + case OPT_INNODB_COMPRESSION_LEVEL: + ADD_PRINT_PARAM_OPT(page_zip_level); + break; + case OPT_INNODB_BUFFER_POOL_FILENAME: ADD_PRINT_PARAM_OPT(innobase_buffer_pool_filename); diff --git a/mysql-test/suite/mariabackup/page_compression_level.result b/mysql-test/suite/mariabackup/page_compression_level.result new file mode 100644 index 00000000000..6273d79f56a --- /dev/null +++ b/mysql-test/suite/mariabackup/page_compression_level.result @@ -0,0 +1,14 @@ +set global innodb_compression_level = 3; +CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1; +INSERT INTO t1 VALUES(1, 'mariadb'); +# xtrabackup backup +# xtrabackup prepare +FOUND /innodb_compression_level=3/ in backup-my.cnf +DELETE FROM t1; +ALTER TABLE t1 DISCARD TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; +SELECT * FROM t1; +c1 b +1 mariadb +DROP TABLE t1; +set global innodb_compression_level = default; diff --git a/mysql-test/suite/mariabackup/page_compression_level.test b/mysql-test/suite/mariabackup/page_compression_level.test new file mode 100644 index 00000000000..e80c956e621 --- /dev/null +++ b/mysql-test/suite/mariabackup/page_compression_level.test @@ -0,0 +1,31 @@ +#--source include/innodb_page_size.inc + +set global innodb_compression_level = 3; +CREATE TABLE t1(c1 INT, b CHAR(20)) ENGINE=INNODB PAGE_COMPRESSED=1; +INSERT INTO t1 VALUES(1, 'mariadb'); + +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; + +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir; +echo # xtrabackup prepare; +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.1 --prepare --export --target-dir=$targetdir; +--enable_result_log + +--let SEARCH_PATTERN=innodb_compression_level=3 +--let SEARCH_FILE=$targetdir/backup-my.cnf +--source include/search_pattern_in_file.inc + +DELETE FROM t1; +ALTER TABLE t1 DISCARD TABLESPACE; +let $MYSQLD_DATADIR= `select @@datadir`; +copy_file $targetdir/test/t1.ibd $MYSQLD_DATADIR/test/t1.ibd; +copy_file $targetdir/test/t1.cfg $MYSQLD_DATADIR/test/t1.cfg; +ALTER TABLE t1 IMPORT TABLESPACE; + +SELECT * FROM t1; + +DROP TABLE t1; +set global innodb_compression_level = default; +rmdir $targetdir; From 6567636b09ba410a330cd45285e489c628c4ff37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 8 Mar 2019 16:33:23 +0200 Subject: [PATCH 2/2] Disable regularly failing Galera tests galera.partition and galera.galera_binlog_stmt_autoinc regularly display mismatching values for AUTO_INCREMENT columns. galera.MW-336 often times out while waiting for something in PROCESSLIST. Also, sort the test names, remove the redundant "galera." prefix and fix typos in 2 test names. --- mysql-test/suite/galera/disabled.def | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index b81c9a737ec..4b70a84ac2e 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -10,21 +10,23 @@ # ############################################################################## -galera_flush : MariaDB does not have global.thread_statistics +GAL-419 : MDEV-13549 Galera test failures +MW-329 : wsrep_local_replays not stable +MW-336 : MDEV-13549 Timeout in wait_condition.inc for PROCESSLIST +MW-416 : MDEV-13549 Galera test failures galera_account_management : MariaDB 10.0 does not support ALTER USER -galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events -galera_migrate : MariaDB does not support START SLAVE USER galera_as_master_gtid : Requires MySQL GTID galera_as_master_gtid_change_master : Requires MySQL GTID galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB -GAL-419 : MDEV-13549 Galera test failures -galera_var_notify_cmd : MDEV-13549 Galera test failures -galera_as_slave_replication_bundle : MDEV-13549 Galera test failures +galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() +galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events +galera_binlog_stmt_autoinc : MDEV-13549 auto_increment mismatch +galera_flush : MariaDB does not have global.thread_statistics +galera_gcs_fc_limit : MDEV-17061 Timeout in wait_condition.inc for PROCESSLIST +galera_migrate : MariaDB does not support START SLAVE USER +galera_pc_ignore_sb : MDEV-17357 Test failure on galera.galera_pc_ignore_sb galera_ssl_upgrade : MDEV-13549 Galera test failures -galera.MW-329 : wsrep_local_replays not stable -MW-416 : MDEV-13549 Galera test failures galera_sst_mysqldump_with_key : MDEV-16890 Galera test failure -galera_gc_fc_limit : MDEV-17061 Test failure on galera.galera_gc_fc_limit -galera_as_slave_replication_budle : MDEV-15785 Test case galera_as_slave_replication_bundle caused debug assertion +galera_var_notify_cmd : MDEV-13549 Galera test failures galera_wan : MDEV-17259: Test failure on galera.galera_wan -galera_pc_ignore_sb : MDEV-17357 Test failure on galera.galera_pc_ignore_sb +partition : MDEV-13549 regularly showing auto_increment mismatch