Commit d8e6bb00 authored by Gulshan Kumar Prasad's avatar Gulshan Kumar Prasad Committed by Anel

MDEV-32611: Test suite is missing dump option delete-master-logs.

Extending the rpl_mysqldump_slave.test to incorporate the
delete-master-logs option, and this options is alias of
get binlogs: show master status -> flush logs -> purge binary logs to <new_binlog>
sequence and this test is derived using the same pattern.
also we measure the pre and post log state
on the master following the mysqldump process. Introducing
assertions to validate the correct state.
parent 5f890452
......@@ -65,4 +65,13 @@ SET GLOBAL gtid_slave_pos='0-2-1003';
-- CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START;
CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
SET GLOBAL gtid_slave_pos='0-2-1003';
connection master;
CREATE TABLE t (
id int
);
insert into t values (1);
insert into t values (2);
drop table t;
-- CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000002', MASTER_LOG_POS=BINLOG_START;
-- SET GLOBAL gtid_slave_pos='0-1-1005';
include/rpl_end.inc
......@@ -83,6 +83,46 @@ DROP TABLE t2;
--replace_regex /MASTER_LOG_POS=[0-9]+/MASTER_LOG_POS=BINLOG_START/
--exec $MYSQL_DUMP_SLAVE --compact --master-data --single-transaction --gtid test
#
# MDEV-32611 Added test for mysqldump --delete-master-logs option.
# This options is alias of
# get binlogs: show master status -> flush logs -> purge binary logs to <new_binlog>
# sequence and this test is derived using the same pattern.
#
connection master;
CREATE TABLE t (
id int
);
insert into t values (1);
insert into t values (2);
drop table t;
--let $predump_binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1)
# Execute mysqldump with delete-master-logs option
--replace_regex /MASTER_LOG_POS=[0-9]+/MASTER_LOG_POS=BINLOG_START/
--exec $MYSQL_DUMP --compact --no-create-info --no-data --delete-master-logs test
--let $postdump_binlog_filename= query_get_value(SHOW MASTER STATUS, File, 1)
--let $postdump_first_binary_log_filename= query_get_value(SHOW BINARY LOGS, Log_name, 1)
if ($predump_binlog_filename == $postdump_binlog_filename)
{
--echo # predump_binlog_filename: $predump_binlog_filename
--echo # postdump_binlog_filename: $postdump_binlog_filename
--die Master state didn't change after mariadb-dump with --delete-master-logs.
}
if ($postdump_first_binary_log_filename != $postdump_binlog_filename)
{
--echo # postdump_first_binary_log_filename: $postdump_first_binary_log_filename
--echo # postdump_binlog_filename: $postdump_binlog_filename
--die Master binlog wasn't deleted after mariadb-dump with --delete-master-logs.
}
--source include/rpl_end.inc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment