From 2bf4e574ad732d934016fe93e7297c017385ff68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Mon, 9 Mar 2020 09:00:14 +0200 Subject: [PATCH 1/6] MDEV-21758 : Events switched randomly to SLAVESIDE_DISABLED Change events only on Galera environment where idea is that event is enabled only on one node of the cluster and nodes are identified by server_id. --- mysql-test/r/events_restart.result | 27 ++++++++++++++++++++++++++ mysql-test/t/events_restart.test | 31 ++++++++++++++++++++++++++++++ sql/events.cc | 8 ++++---- 3 files changed, 62 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/events_restart.result b/mysql-test/r/events_restart.result index e22cfa011f2..ab90f7ff2f7 100644 --- a/mysql-test/r/events_restart.result +++ b/mysql-test/r/events_restart.result @@ -110,3 +110,30 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E test e1 root@localhost SYSTEM RECURRING # 1 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci DROP EVENT e1; # end test for bug#11748899 +# +# Test for MDEV-21758 Events switched randomly to SLAVESIDE_DISABLED +# +create event ev on schedule every 1 minute do set @a= 1; +select name, originator, status from mysql.event; +name originator status +ev 1 ENABLED +# +# Restarting server with server_id=100 +# +select @@global.server_id; +@@global.server_id +100 +select name, originator, status from mysql.event; +name originator status +ev 1 ENABLED +set global server_id= 1; +# +# Restarting server with the original server_id=1 +# +select @@global.server_id; +@@global.server_id +1 +select name, originator, status from mysql.event; +name originator status +ev 1 ENABLED +drop event ev; diff --git a/mysql-test/t/events_restart.test b/mysql-test/t/events_restart.test index ca674170e96..f56bd32b71d 100644 --- a/mysql-test/t/events_restart.test +++ b/mysql-test/t/events_restart.test @@ -141,3 +141,34 @@ SHOW EVENTS; DROP EVENT e1; --echo # end test for bug#11748899 + +--echo # +--echo # Test for MDEV-21758 Events switched randomly to SLAVESIDE_DISABLED +--echo # + +create event ev on schedule every 1 minute do set @a= 1; +select name, originator, status from mysql.event; + +--let $server_id= `SELECT @@global.server_id` + +--echo # +--echo # Restarting server with server_id=100 +--echo # +--let $restart_parameters= --server-id=100 +--source include/restart_mysqld.inc + +select @@global.server_id; +select name, originator, status from mysql.event; +--eval set global server_id= $server_id + +--echo # +--echo # Restarting server with the original server_id=$server_id +--echo # +--let $restart_parameters= +--source include/restart_mysqld.inc + +select @@global.server_id; +select name, originator, status from mysql.event; + +# Cleanup +drop event ev; diff --git a/sql/events.cc b/sql/events.cc index c189354d5eb..c5dc51ab83d 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1201,9 +1201,9 @@ Events::load_events_from_db(THD *thd) #ifdef WITH_WSREP /** - IF SST is done from a galera node that is also acting as MASTER - newly synced node in galera eco-system will also copy-over the event state - enabling duplicate event in galera eco-system. + If SST is done from a galera node that is also acting as MASTER + newly synced node in galera eco-system will also copy-over the + event state enabling duplicate event in galera eco-system. DISABLE such events if the current node is not event orginator. (Also, make sure you skip disabling it if is already disabled to avoid creation of redundant action) @@ -1213,7 +1213,7 @@ Events::load_events_from_db(THD *thd) Infact, based on galera use-case it seems like it recommends to have each node with different server-id. */ - if (et->originator != thd->variables.server_id) + if (WSREP(thd) && et->originator != thd->variables.server_id) { if (et->status == Event_parse_data::SLAVESIDE_DISABLED) continue; From 7a52b6fd25e69e3f74731c6ef38531c612d6ca60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 9 Mar 2020 12:04:02 +0200 Subject: [PATCH 2/6] Minor cleanup of main.partition_innodb Stop masking the Data_free values, because innodb_file_per_table=1 is the default. Also, do mask Update_time after updating tables, even though for some reason it does appear to matter. --- mysql-test/r/partition_innodb.result | 12 ++++++------ mysql-test/t/partition_innodb.test | 28 ++++++---------------------- 2 files changed, 12 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 8c0950e3643..6770b64552f 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -386,33 +386,33 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Dynamic 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Dynamic 2 8192 16384 0 0 0 NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Dynamic 2 8192 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Dynamic 2 8192 16384 0 0 0 NULL Create_time NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Dynamic 4 4096 16384 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Dynamic 4 4096 16384 0 0 0 NULL Create_time Update_time NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Dynamic 2 8192 16384 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Dynamic 2 8192 16384 0 0 0 1 Create_time NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Dynamic 4 4096 16384 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Dynamic 4 4096 16384 0 0 0 5 Create_time Update_time NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Dynamic 8 2048 16384 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Dynamic 8 2048 16384 0 0 0 9 Create_time Update_time NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by key (a) diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index b682162f7ea..518ef187d54 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -1,7 +1,3 @@ -if (`select plugin_auth_version < "5.6.25" from information_schema.plugins where plugin_name='innodb'`) -{ - --skip Not fixed in InnoDB as of 5.6.24 or earlier -} --source include/not_embedded.inc --source include/have_partition.inc --source include/have_innodb.inc @@ -405,9 +401,7 @@ DROP TABLE t1; # Bug #14673: Wrong InnoDB default row format # create table t1 (a int) engine=innodb partition by hash(a) ; -# Data_free for InnoDB tablespace varies depending on which -# tests have been run before this one ---replace_column 10 # 12 # +--replace_column 12 # show table status like 't1'; drop table t1; @@ -417,33 +411,23 @@ drop table t1; create table t1 (a int) engine = innodb partition by key (a); -# Data_free for InnoDB tablespace varies depending on which -# tests have been run before this one ---replace_column 10 # 12 # +--replace_column 12 Create_time show table status; insert into t1 values (0), (1), (2), (3); -# Data_free for InnoDB tablespace varies depending on which -# tests have been run before this one ---replace_column 10 # 12 # +--replace_column 12 Create_time 13 Update_time show table status; drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); -# Data_free for InnoDB tablespace varies depending on which -# tests have been run before this one ---replace_column 10 # 12 # +--replace_column 12 Create_time show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); -# Data_free for InnoDB tablespace varies depending on which -# tests have been run before this one ---replace_column 10 # 12 # +--replace_column 12 Create_time 13 Update_time show table status; insert into t1 values (NULL), (NULL), (NULL), (NULL); -# Data_free for InnoDB tablespace varies depending on which -# tests have been run before this one ---replace_column 10 # 12 # +--replace_column 12 Create_time 13 Update_time show table status; drop table t1; From 1c40cb6877c35cceebe59384998df58264997d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 10 Mar 2020 13:26:57 +0200 Subject: [PATCH 3/6] Do not bother to disable non-existing tests --- mysql-test/disabled.def | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/disabled.def b/mysql-test/disabled.def index b6991cc1d37..ee30c4f4d3c 100644 --- a/mysql-test/disabled.def +++ b/mysql-test/disabled.def @@ -17,8 +17,6 @@ mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 chang ssl_crl_clients_valid : broken upstream ssl_crl : broken upstream ssl_crl_clrpath : broken upstream -innodb-wl5522-debug-zip : broken upstream -innodb_bug12902967 : broken upstream file_contents : MDEV-6526 these files are not installed anymore max_statement_time : cannot possibly work, depends on timing partition_open_files_limit : open_files_limit check broken by MDEV-18360 From 69e4c74e079fc78812a75b1e2c050890161826bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 10 Mar 2020 13:31:20 +0200 Subject: [PATCH 4/6] Make main.mysql_client_test non-great again Re-enable main.mysql_client_test on all builders, because at the moment we do not run any --big-test on buildbot due to resource constraints. A number of tests were declared big in commit eeee1832d792ac296e1cebeeed1f7a7ce4ce4551 in an attempt to save resources on buildbot. --- mysql-test/t/mysql_client_test.test | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 8fbbbc1602e..8c2f5e2c32b 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -2,8 +2,6 @@ -- source include/not_embedded.inc # need to have the dynamic loading turned on for the client plugin tests --source include/have_plugin_auth.inc -# This test is slow on buildbot. ---source include/big_test.inc # Run test with default character set --source include/default_charset.inc From 2b8b85bd0a916f68dbe0af2af71569c81605242f Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Tue, 10 Mar 2020 15:14:53 +0300 Subject: [PATCH 5/6] fix use-after-free --- extra/mariabackup/xtrabackup.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index d5e5fc49e75..828c2e06fc2 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -3132,13 +3132,13 @@ xb_load_single_table_tablespace( } } - ut_free(name); - delete file; if (err != DB_SUCCESS && xtrabackup_backup && !is_empty_file) { die("Failed to not validate first page of the file %s, error %d",name, (int)err); } + + ut_free(name); } /** Scan the database directories under the MySQL datadir, looking for From 02343c4a54b055ea3483075219bb3ce010c33671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 10 Mar 2020 15:46:29 +0200 Subject: [PATCH 6/6] MDEV-19740: Correct a type mismatch WITH_INNODB_EXTRA_DEBUG --- storage/innobase/page/page0zip.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index 7a017913dfe..aec6bcc38da 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -3431,11 +3431,12 @@ page_zip_validate_low( differed. Let us ignore it. */ page_zip_fail(("page_zip_validate:" " min_rec_flag" - " (%s%lu,%lu,0x%02lx)\n", + " (%s" ULINTPF "," ULINTPF + ",0x%02x)\n", sloppy ? "ignored, " : "", page_get_space_id(page), page_get_page_no(page), - (ulong) page[offset])); + page[offset])); /* We don't check for spatial index, since the "minimum record" could be deleted when doing rtr_update_mbr_field.