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

Fixed issues found by QA (Elena)

- Added parameter to reset_logs() so that one can specify if new logs should be created.

mysql-test/include/setup_fake_relay_log.inc:
  There is no orphan relay log files anymore
mysql-test/mysql-test-run.pl:
  Added multi_source to test suite
mysql-test/suite/multi_source/info_logs.result:
  New test
mysql-test/suite/multi_source/info_logs.test:
  New test
mysql-test/suite/multi_source/my.cnf:
  Added log-warnings to get more information to the log files
mysql-test/suite/multi_source/relaylog_events.result:
  Added cleanup
mysql-test/suite/multi_source/relaylog_events.test:
  Added cleanup
mysql-test/suite/multi_source/reset_slave.result:
  Updated results after improved RESET SLAVE
mysql-test/suite/multi_source/simple.result:
  Updated results after improved RESET SLAVE
mysql-test/suite/multi_source/simple.test:
  Syncronize positions before show full slave status
mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result:
  Updated results after improved RESET SLAVE (we now use less relay log files)
mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result:
  Updated results after improved RESET SLAVE (we now use less relay log files)
sql/log.cc:
  Added parameter to reset_logs() so that one can specify if new logs should be created.
sql/log.h:
  Added parameter to reset_logs()
sql/rpl_mi.cc:
  Create Master_info_index::index_file_names once at init
  More DBUG_PRINT
  Give error if Master_info_index::check_duplicate_master_info fails
sql/rpl_rli.cc:
  If we do a full reset, don't create any new relay log files.
sql/share/errmsg-utf8.txt:
  Improved error message if connection exists
sql/sql_parse.cc:
  Fixed memory leak
sql/sql_repl.cc:
  check_duplicate_master_info() now generates an error
  Added parameter to reset_logs()
This commit is contained in:
Michael Widenius
2012-09-28 21:22:24 +03:00
parent 9b03041b27
commit 5a4b5869a0
19 changed files with 428 additions and 134 deletions

View File

@@ -0,0 +1,115 @@
#
# List of files matching '*info*' pattern before starting any slaves
multi-master.info
# End of list
#
# Contents of multi-master.info
# EOF
#
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
#
# List of files matching '*info*' pattern while 'master1' is running
master.info.master1
multi-master.info
relay-log.info.master1
# End of list
#
# Contents of multi-master.info
master1
# EOF
#
change master 'master2' to
master_port=MYPORT_2,
master_host='127.0.0.1',
master_user='root';
start slave 'master2';
set default_master_connection = 'master2';
include/wait_for_slave_to_start.inc
#
# List of files matching '*info*' pattern
# while 'master1' and 'master2' are running
master.info.master1
master.info.master2
multi-master.info
relay-log.info.master1
relay-log.info.master2
# End of list
#
# Contents of multi-master.info
master1
master2
# EOF
#
stop slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_stop.inc
reset slave 'master1' all;
#
# List of files matching '*info*' pattern
# after 'master1' was completely reset, 'master2' still running
master.info.master2
multi-master.info
relay-log.info.master2
# End of list
#
# Contents of multi-master.info
master2
# EOF
#
set default_master_connection = '';
change master to
master_port=MYPORT_1,
master_host='127.0.0.1',
master_user='root';
start slave;
include/wait_for_slave_to_start.inc
#
# List of files matching '*info*' pattern
# while 'master2' and '' are running
master.info
master.info.master2
multi-master.info
relay-log.info
relay-log.info.master2
# End of list
#
# Contents of multi-master.info
master2
# EOF
#
show full slave status;
Connection_name Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin.000002 572 master-bin.000001 Yes Yes 0 0 286 868 None 0 No 0 No 0 0 1
master2 Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-master2.000002 572 master-bin.000001 Yes Yes 0 0 286 876 None 0 No 0 No 0 0 2
show full slave status;
Connection_name Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 286 mysqld-relay-bin.000004 532 master-bin.000001 Yes Yes 0 0 286 828 None 0 No 0 No 0 0 1
master2 Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-master2.000004 532 master-bin.000001 Yes Yes 0 0 286 836 None 0 No 0 No 0 0 2
#
# List of files matching '*info*' pattern
# after slave server restart
# while 'master2' and '' are running
master.info
master.info.master2
multi-master.info
relay-log.info
relay-log.info.master2
# End of list
#
# Contents of multi-master.info
master2
# EOF
#
stop slave;
include/wait_for_slave_to_stop.inc
set default_master_connection = 'master2';
stop slave;
include/wait_for_slave_to_stop.inc
reset slave all;
reset slave '' all;

View File

@@ -0,0 +1,160 @@
#
# Check log files with multi-source
#
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
--let $datadir = `SELECT @@datadir`
#
# Check creation and updating of multi-source *info* logs
#
--echo #
--echo # List of files matching '*info*' pattern before starting any slaves
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #
# Start replication from the first master
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
--source include/wait_for_slave_to_start.inc
# Check the files
--echo #
--echo # List of files matching '*info*' pattern while 'master1' is running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #
# Start replication from the second master
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'master2' to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root';
start slave 'master2';
set default_master_connection = 'master2';
--source include/wait_for_slave_to_start.inc
# Check the files
--echo #
--echo # List of files matching '*info*' pattern
--echo # while 'master1' and 'master2' are running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #
# Remove master1 configuration
stop slave 'master1';
set default_master_connection = 'master1';
--source include/wait_for_slave_to_stop.inc
reset slave 'master1' all;
# Check the files
--echo #
--echo # List of files matching '*info*' pattern
--echo # after 'master1' was completely reset, 'master2' still running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #
# Start replication from the first master,
# now with the default empty name
set default_master_connection = '';
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
master_user='root';
start slave;
--source include/wait_for_slave_to_start.inc
# Check the files
--echo #
--echo # List of files matching '*info*' pattern
--echo # while 'master2' and '' are running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #
--sleep 5
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
show full slave status;
# Restart the slave server
--enable_reconnect
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.3.expect
restart
EOF
--shutdown_server 60
--source include/wait_until_connected_again.inc
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
show full slave status;
# Check the files
--echo #
--echo # List of files matching '*info*' pattern
--echo # after slave server restart
--echo # while 'master2' and '' are running
--list_files $datadir *info*
--echo # End of list
--echo #
--echo # Contents of multi-master.info
--cat_file $datadir/multi-master.info
--echo # EOF
--echo #
# Cleanup
stop slave;
--source include/wait_for_slave_to_stop.inc
set default_master_connection = 'master2';
stop slave;
--source include/wait_for_slave_to_stop.inc
reset slave all;
reset slave '' all;
--disconnect slave

View File

@@ -5,13 +5,16 @@
[mysqld.1]
server-id=1
log-bin=master-bin
log-warnings=2
[mysqld.2]
server-id=2
log-bin=master-bin
log-warnings=2
[mysqld.3]
server-id=3
log-warnings=2
[ENV]
SERVER_MYPORT_1= @mysqld.1.port

View File

@@ -24,4 +24,5 @@ mysqld-relay-bin-master1.000001 246 Rotate 3 304 mysqld-relay-bin-master1.000002
drop table t1;
stop slave;
include/wait_for_slave_to_stop.inc
reset slave 'master1' all;
reset master;

View File

@@ -42,6 +42,8 @@ drop table t1;
stop slave;
--source include/wait_for_slave_to_stop.inc
reset slave 'master1' all;
--disconnect slave
--connection master1

View File

@@ -18,14 +18,10 @@ mysqld-relay-bin.index-master1
reset slave 'master1';
show slave 'master1' status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
127.0.0.1 root MYPORT_1 60 4 mysqld-relay-bin-master1.000001 4 No No 0 0 0 265 None 0 No NULL No 0 0 1
mysqld-relay-bin-master1.000001
mysqld-relay-bin.index-master1
127.0.0.1 root MYPORT_1 60 4 1015 No No 0 0 0 1319 None 0 No NULL No 0 0 1
reset slave 'master1' all;
show slave 'master1' status;
ERROR HY000: There is no master connection 'master1'
mysqld-relay-bin-master1.000001
mysqld-relay-bin.index-master1
drop table t1;
drop table t1;
reset master;

View File

@@ -56,7 +56,7 @@ Master_Server_Id 1
reset slave 'slave1';
show full slave status;
Connection_name Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id
slave1 127.0.0.1 root MYPORT_1 60 4 mysqld-relay-bin-slave1.000001 4 No No 0 0 0 265 None 0 No NULL No 0 0 1
slave1 127.0.0.1 root MYPORT_1 60 4 572 No No 0 0 0 875 None 0 No NULL No 0 0 1
slave2 Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 286 mysqld-relay-bin-slave2.000002 572 master-bin.000001 Yes Yes 0 0 286 875 None 0 No 0 No 0 0 2
reset slave 'slave1' all;
show full slave status;

View File

@@ -3,6 +3,9 @@
#
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
--connection slave
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'slave1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
@@ -16,6 +19,16 @@ start slave 'slave2';
--source include/wait_for_slave_to_start.inc
set default_master_connection = '';
# Ensure that all data is in the relay log
--connection master1
--save_master_pos
--connection slave
--sync_with_master 0,'slave1'
--connection master2
--save_master_pos
--connection slave
--sync_with_master 0,'slave2'
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2
show full slave status;