mirror of
https://github.com/MariaDB/server.git
synced 2025-04-22 23:25:37 +02:00

- Major rewrite of ddl_log.cc and ddl_log.h - ddl_log.cc described in the beginning how the recovery works. - ddl_log.log has unique signature and is dynamic. It's easy to add more information to the header and other ddl blocks while still being able to execute old ddl entries. - IO_SIZE for ddl blocks is now dynamic. Can be changed without affecting recovery of old logs. - Code is more modular and is now usable outside of partition handling. - Renamed log file to dll_recovery.log and added option --log-ddl-recovery to allow one to specify the path & filename. - Added ddl_log_entry_phase[], number of phases for each DDL action, which allowed me to greatly simply set_global_from_ddl_log_entry() - Changed how strings are stored in log entries, which allows us to store much more information in a log entry. - ddl log is now always created at start and deleted on normal shutdown. This simplices things notable. - Added probes debug_crash_here() and debug_simulate_error() to simply crash testing and allow crash after a given number of times a probe is executed. See comments in debug_sync.cc and rename_table.test for how this can be used. - Reverting failed table and view renames is done trough the ddl log. This ensures that the ddl log is tested also outside of recovery. - Added helper function 'handler::needs_lower_case_filenames()' - Extend binary log with Q_XID events. ddl log handling is using this to check if a ddl log entry was logged to the binary log (if yes, it will be deleted from the log during ddl_log_close_binlogged_events() - If a DDL entry fails 3 time, disable it. This is to ensure that if we have a crash in ddl recovery code the server will not get stuck in a forever crash-restart-crash loop. mysqltest.cc changes: - --die will now replace $variables with their values - $error will contain the error of the last failed statement storage engine changes: - maria_rename() was changed to be more robust against crashes during rename.
49 lines
1.8 KiB
Text
49 lines
1.8 KiB
Text
# ==== Purpose ====
|
|
#
|
|
# Test verifies that when "replicate_annotate_row_events" are enabled on slave
|
|
# the DML operations on blackhole engine will be successful. It also ensures
|
|
# that Annotate events are logged into slave's binary log.
|
|
#
|
|
# ==== Implementation ====
|
|
#
|
|
# Steps:
|
|
# 0 - Enable "replicate_annotate_row_events" on slave and do DML operations
|
|
# on master.
|
|
# 1 - Slave server will successfully apply the DML operations and it is in
|
|
# sync with master.
|
|
# 2 - Verify that the "show binlog events" prints all annotate events.
|
|
# 3 - Stream the slave's binary log using "mysqlbinlog" tool and verify
|
|
# that the Annotate events are being displayed.
|
|
#
|
|
# ==== References ====
|
|
#
|
|
# MDEV-11094: Blackhole table updates on slave fail when row annotation is
|
|
# enabled
|
|
|
|
source include/have_blackhole.inc;
|
|
source include/have_binlog_format_row.inc;
|
|
source include/binlog_start_pos.inc;
|
|
source include/master-slave.inc;
|
|
|
|
SET timestamp=1000000000;
|
|
RESET MASTER;
|
|
connection slave;
|
|
SET timestamp=1000000000;
|
|
RESET MASTER;
|
|
|
|
connection master;
|
|
source include/rpl_blackhole_basic.test;
|
|
|
|
# Verify on slave.
|
|
connection slave;
|
|
FLUSH LOGS;
|
|
--replace_column 2 # 5 #
|
|
--replace_result $binlog_start_pos <start_pos>
|
|
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
|
|
--eval show binlog events in 'slave-bin.000001' from $binlog_start_pos
|
|
|
|
let $MYSQLD_DATADIR= `select @@datadir`;
|
|
--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /CRC32 0x[0-9a-f]*/CRC32 XXX/ /xid=\d*/xid=<xid>/
|
|
--exec $MYSQL_BINLOG --base64-output=decode-rows $MYSQLD_DATADIR/slave-bin.000001
|
|
|
|
source include/rpl_end.inc;
|