1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.0' into 10.1

This commit is contained in:
Sergei Golubchik
2017-08-08 10:18:43 +02:00
313 changed files with 36802 additions and 2097 deletions

View File

@@ -0,0 +1,29 @@
include/master-slave.inc
[connection master]
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 (c1) VALUES (1);
include/stop_slave_sql.inc
FLUSH LOGS;
FLUSH LOGS;
INSERT INTO t1 (c1) VALUES (2);
include/sync_slave_io_with_master.inc
call mtr.add_suppression("File '.*slave-relay-bin.");
call mtr.add_suppression("Could not open log file");
call mtr.add_suppression("Failed to open the relay log");
call mtr.add_suppression("Failed to initialize the master info structure");
include/rpl_stop_server.inc [server_number=2]
# Removing file(s)
include/rpl_start_server.inc [server_number=2]
START SLAVE;
ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
START SLAVE;
ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
RESET SLAVE;
DROP TABLE t1;
START SLAVE UNTIL MASTER_LOG_FILE= 'MASTER_LOG_FILE', MASTER_LOG_POS= MASTER_LOG_POS;;
include/wait_for_slave_sql_to_stop.inc
include/stop_slave_io.inc
include/start_slave.inc
include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE t1;
include/rpl_end.inc

View File

@@ -0,0 +1,91 @@
###############################################################################
# Bug#24901077: RESET SLAVE ALL DOES NOT ALWAYS RESET SLAVE
#
# Problem:
# =======
# If you have a relay log index file that has ended up with
# some relay log files that do not exists, then RESET SLAVE
# ALL is not enough to get back to a clean state.
###############################################################################
# Remove all slave-relay-bin.0* files (do not remove slave-relay-bin.index)
# During server restart rli initialization will fail as there are no
# relay logs. In case of bug RESET SLAVE will not do the required clean up
# as rli is not inited and subsequent START SLAVE will fail.
# Disable "Warning 1612 Being purged log ./slave-relay-bin.0* was not found"
# because it is different on Unix and Windows systems.
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc
--connection master
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 (c1) VALUES (1);
--sync_slave_with_master
--connection slave
--source include/stop_slave_sql.inc
--let $MYSQLD_SLAVE_DATADIR= `select @@datadir`
--connection master
# Generate more relay logs on slave.
FLUSH LOGS;
FLUSH LOGS;
INSERT INTO t1 (c1) VALUES (2);
--source include/sync_slave_io_with_master.inc
call mtr.add_suppression("File '.*slave-relay-bin.");
call mtr.add_suppression("Could not open log file");
call mtr.add_suppression("Failed to open the relay log");
call mtr.add_suppression("Failed to initialize the master info structure");
# Stop slave
--let $rpl_server_number= 2
--source include/rpl_stop_server.inc
# Delete file(s)
--echo # Removing $remove_pattern file(s)
--let $remove_pattern= slave-relay-bin.0*
--remove_files_wildcard $MYSQLD_SLAVE_DATADIR $remove_pattern
# Start slave
--let $rpl_server_number= 2
--source include/rpl_start_server.inc
# Start slave must fail because of the removed file(s).
--error ER_MASTER_INFO
START SLAVE;
# Try a second time, it must fail again.
--error ER_MASTER_INFO
START SLAVE;
# Retrieve master executed position before reset slave.
--let $master_exec_file= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1)
--let $master_exec_pos= query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1)
# Reset slave.
# Disable "Warning 1612 Being purged log ./slave-relay-bin.0* was not found"
# because it is different on Unix and Windows systems.
--disable_warnings
RESET SLAVE;
--enable_warnings
DROP TABLE t1;
--replace_result $master_exec_file MASTER_LOG_FILE $master_exec_pos MASTER_LOG_POS
--eval START SLAVE UNTIL MASTER_LOG_FILE= '$master_exec_file', MASTER_LOG_POS= $master_exec_pos;
--source include/wait_for_slave_sql_to_stop.inc
--source include/stop_slave_io.inc
# Start slave.
--source include/start_slave.inc
--connection master
--sync_slave_with_master
# Check consistency.
--let $diff_tables= master:t1, slave:t1
--source include/diff_tables.inc
# Cleanup
--connection master
DROP TABLE t1;
--sync_slave_with_master
--source include/rpl_end.inc