From b6bf7cd192f7fb3c8463c2c924a0b934398f4d5f Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Fri, 16 Sep 2022 08:36:11 -0600 Subject: MDEV-28986: rpl tests sometimes failing on freebsd builders The rpl_row_img_sequence test can fail on resource constrained buildbot machines due to its high space consumption. To reduce this footprint, the test is split into three parts, one for each value of the binlog_row_img variable. --- mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf | 21 ------- mysql-test/suite/rpl/t/rpl_row_img_sequence.test | 65 ---------------------- .../suite/rpl/t/rpl_row_img_sequence_full.cnf | 21 +++++++ .../suite/rpl/t/rpl_row_img_sequence_full.test | 48 ++++++++++++++++ .../suite/rpl/t/rpl_row_img_sequence_min.cnf | 21 +++++++ .../suite/rpl/t/rpl_row_img_sequence_min.test | 52 +++++++++++++++++ .../suite/rpl/t/rpl_row_img_sequence_noblob.cnf | 21 +++++++ .../suite/rpl/t/rpl_row_img_sequence_noblob.test | 51 +++++++++++++++++ 8 files changed, 214 insertions(+), 86 deletions(-) delete mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf delete mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence_min.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf create mode 100644 mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test (limited to 'mysql-test/suite/rpl/t') diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf deleted file mode 100644 index 7104b4e4502..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_img_sequence.cnf +++ /dev/null @@ -1,21 +0,0 @@ -!include include/default_mysqld.cnf - -[mysqld.1] -log-slave-updates -innodb -gtid_domain_id=0 - -[mysqld.2] -log-slave-updates -innodb -gtid_domain_id=1 - -[mysqld.3] -log-slave-updates -innodb -gtid_domain_id=2 - -[ENV] -SERVER_MYPORT_1= @mysqld.1.port -SERVER_MYPORT_2= @mysqld.2.port -SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence.test deleted file mode 100644 index 23860fb2de5..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_img_sequence.test +++ /dev/null @@ -1,65 +0,0 @@ -# -# Purpose: -# This test verifies that sequence DML updates, i.e. NEXTVAL and SETVAL, -# respect the binlog_row_image variable value when written into the binary log. -# In particular, it ensures that only changed columns are written with MINIMAL -# image mode, and all columns are written otherwise. -# -# Methodology -# After issuing a sequence update, ensure that both 1) it was replicated -# correctly, and 2) it was binlogged respective to the binlog_row_image value. -# The sequence table does not use caching to ensure each update is immediately -# binlogged. Each command is binlogged into its own unique log file, and the -# entirety of the file is analyzed for correctness of its sequence event. -# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns -# which belong to the event, and the columns are analyzed to ensure the correct -# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple -# chained replicas, varying engines between InnoDB and MyISAM. -# -# References: -# MDEV-28487: sequences not respect value of binlog_row_image with select -# nextval(seq_gen) -# - ---let $rpl_topology= 1->2->3 ---source include/rpl_init.inc ---source include/have_binlog_format_row.inc - ---connection server_1 ---source include/have_innodb.inc ---connection server_2 ---source include/have_innodb.inc ---connection server_3 ---source include/have_innodb.inc ---connection server_1 - ---echo # ---echo # Test Case 1) binlog_row_image=MINIMAL should write only columns ---echo # 1 and 8 to the binary log ---echo # ---let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y ---source include/rpl_row_img_set.inc ---let $expected_columns=(1,8) ---let row_img_test_script= include/rpl_row_img_sequence.inc ---source include/rpl_row_img_general_loop.inc - ---echo # ---echo # Test Case 2) binlog_row_image=NOBLOB should write all columns to the ---echo # binary log ---echo # ---let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y ---source include/rpl_row_img_set.inc ---let $expected_columns=(1,2,3,4,5,6,7,8) ---source include/rpl_row_img_general_loop.inc - ---echo # ---echo # Test Case 3) binlog_row_image=NOBLOB should write all columns to the ---echo # binary log ---echo # ---let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y ---source include/rpl_row_img_set.inc ---let $expected_columns=(1,2,3,4,5,6,7,8) ---source include/rpl_row_img_general_loop.inc - ---source include/rpl_end.inc ---echo # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf new file mode 100644 index 00000000000..7104b4e4502 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf @@ -0,0 +1,21 @@ +!include include/default_mysqld.cnf + +[mysqld.1] +log-slave-updates +innodb +gtid_domain_id=0 + +[mysqld.2] +log-slave-updates +innodb +gtid_domain_id=1 + +[mysqld.3] +log-slave-updates +innodb +gtid_domain_id=2 + +[ENV] +SERVER_MYPORT_1= @mysqld.1.port +SERVER_MYPORT_2= @mysqld.2.port +SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test new file mode 100644 index 00000000000..a0c6aa4dc7a --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.test @@ -0,0 +1,48 @@ +# +# Purpose: +# The rpl_row_img_sequence group of tests verify that sequence MDL updates, +# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when +# written into the binary log. In particular, it ensures that only changed +# columns are written with MINIMAL image mode, and all columns are written +# otherwise. This test focuses on validating the behavior of +# binlog_row_img=FULL. +# +# Methodology +# After issuing a sequence update, ensure that both 1) it was replicated +# correctly, and 2) it was binlogged respective to the binlog_row_image value. +# The sequence table does not use caching to ensure each update is immediately +# binlogged. Each command is binlogged into its own unique log file, and the +# entirety of the file is analyzed for correctness of its sequence event. +# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns +# which belong to the event, and the columns are analyzed to ensure the correct +# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple +# chained replicas, varying engines between InnoDB and MyISAM. +# +# References: +# MDEV-28487: sequences not respect value of binlog_row_image with select +# nextval(seq_gen) +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +--source include/have_binlog_format_row.inc + +--connection server_1 +--source include/have_innodb.inc +--connection server_2 +--source include/have_innodb.inc +--connection server_3 +--source include/have_innodb.inc +--connection server_1 + +--echo # +--echo # binlog_row_image=FULL should write all columns to the binary log +--echo # +--let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,2,3,4,5,6,7,8) +--let row_img_test_script= include/rpl_row_img_sequence.inc +--source include/rpl_row_img_general_loop.inc + +--source include/rpl_end.inc +--echo # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf new file mode 100644 index 00000000000..7104b4e4502 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf @@ -0,0 +1,21 @@ +!include include/default_mysqld.cnf + +[mysqld.1] +log-slave-updates +innodb +gtid_domain_id=0 + +[mysqld.2] +log-slave-updates +innodb +gtid_domain_id=1 + +[mysqld.3] +log-slave-updates +innodb +gtid_domain_id=2 + +[ENV] +SERVER_MYPORT_1= @mysqld.1.port +SERVER_MYPORT_2= @mysqld.2.port +SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.test new file mode 100644 index 00000000000..0a3b2827ffa --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.test @@ -0,0 +1,52 @@ +# +# Purpose: +# The rpl_row_img_sequence group of tests verify that sequence MDL updates, +# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when +# written into the binary log. In particular, it ensures that only changed +# columns are written with MINIMAL image mode, and all columns are written +# otherwise. This test focuses on validating the behavior of +# binlog_row_img=MINIMAL. +# +# Methodology +# After issuing a sequence update, ensure that both 1) it was replicated +# correctly, and 2) it was binlogged respective to the binlog_row_image value. +# The sequence table does not use caching to ensure each update is immediately +# binlogged. Each command is binlogged into its own unique log file, and the +# entirety of the file is analyzed for correctness of its sequence event. +# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns +# which belong to the event, and the columns are analyzed to ensure the correct +# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple +# chained replicas, varying engines between InnoDB and MyISAM. +# +# References: +# MDEV-28487: sequences not respect value of binlog_row_image with select +# nextval(seq_gen) +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +--source include/have_binlog_format_row.inc + +--connection server_1 +--source include/have_innodb.inc +--connection server_2 +--source include/have_innodb.inc +--connection server_3 +--source include/have_innodb.inc +--connection server_1 + +--echo # +--echo # binlog_row_image=MINIMAL should write only columns 1 and 8 to the +--echo # binary log +--echo # +--let $row_img_set=server_1:MINIMAL:N,server_2:MINIMAL:Y,server_3:MINIMAL:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,8) +--let row_img_test_script= include/rpl_row_img_sequence.inc +--source include/rpl_row_img_general_loop.inc + +--let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +--source include/rpl_row_img_set.inc + +--source include/rpl_end.inc +--echo # End of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf new file mode 100644 index 00000000000..7104b4e4502 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf @@ -0,0 +1,21 @@ +!include include/default_mysqld.cnf + +[mysqld.1] +log-slave-updates +innodb +gtid_domain_id=0 + +[mysqld.2] +log-slave-updates +innodb +gtid_domain_id=1 + +[mysqld.3] +log-slave-updates +innodb +gtid_domain_id=2 + +[ENV] +SERVER_MYPORT_1= @mysqld.1.port +SERVER_MYPORT_2= @mysqld.2.port +SERVER_MYPORT_3= @mysqld.3.port diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test new file mode 100644 index 00000000000..38ff469f22f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.test @@ -0,0 +1,51 @@ +# +# Purpose: +# The rpl_row_img_sequence group of tests verify that sequence MDL updates, +# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when +# written into the binary log. In particular, it ensures that only changed +# columns are written with MINIMAL image mode, and all columns are written +# otherwise. This test focuses on validating the behavior of +# binlog_row_img=NOBLOB. +# +# Methodology +# After issuing a sequence update, ensure that both 1) it was replicated +# correctly, and 2) it was binlogged respective to the binlog_row_image value. +# The sequence table does not use caching to ensure each update is immediately +# binlogged. Each command is binlogged into its own unique log file, and the +# entirety of the file is analyzed for correctness of its sequence event. +# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns +# which belong to the event, and the columns are analyzed to ensure the correct +# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple +# chained replicas, varying engines between InnoDB and MyISAM. +# +# References: +# MDEV-28487: sequences not respect value of binlog_row_image with select +# nextval(seq_gen) +# + +--let $rpl_topology= 1->2->3 +--source include/rpl_init.inc +--source include/have_binlog_format_row.inc + +--connection server_1 +--source include/have_innodb.inc +--connection server_2 +--source include/have_innodb.inc +--connection server_3 +--source include/have_innodb.inc +--connection server_1 + +--echo # +--echo # binlog_row_image=NOBLOB should write all columns to the binary logs +--echo # +--let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y +--source include/rpl_row_img_set.inc +--let $expected_columns=(1,2,3,4,5,6,7,8) +--let row_img_test_script= include/rpl_row_img_sequence.inc +--source include/rpl_row_img_general_loop.inc + +--let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y +--source include/rpl_row_img_set.inc + +--source include/rpl_end.inc +--echo # End of tests -- cgit v1.2.1 From 3c92050d1c907cc548e848d0ab2891a06681ad92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 23 Sep 2022 17:37:52 +0300 Subject: Fix build without either ENABLED_DEBUG_SYNC or DBUG_OFF There are separate flags DBUG_OFF for disabling the DBUG facility and ENABLED_DEBUG_SYNC for enabling the DEBUG_SYNC facility. Let us allow debug builds without DEBUG_SYNC. Note: For CMAKE_BUILD_TYPE=Debug, CMakeLists.txt will continue to define ENABLED_DEBUG_SYNC. --- mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test | 1 + mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test | 1 + 2 files changed, 2 insertions(+) (limited to 'mysql-test/suite/rpl/t') diff --git a/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test index 3a4a24e1762..8c4baafe23d 100644 --- a/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test +++ b/mysql-test/suite/rpl/t/rpl_lost_events_on_rotate.test @@ -13,6 +13,7 @@ # during this window while forcing a rotation in the binlog. # --source include/have_debug.inc +--source include/have_debug_sync.inc --source include/master-slave.inc --connection master diff --git a/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test b/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test index 31a9478f632..d1bfbf25bae 100644 --- a/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test +++ b/mysql-test/suite/rpl/t/rpl_seconds_behind_master_spike.test @@ -20,6 +20,7 @@ # MDEV-16091: Seconds_Behind_Master spikes to millions of seconds # --source include/have_debug.inc +--source include/have_debug_sync.inc --source include/have_innodb.inc --source include/master-slave.inc -- cgit v1.2.1