Commit 6242783f authored by Sergei Golubchik's avatar Sergei Golubchik

rpl.rpl_semi_sync_fail_over improve debugability

parent 1437e734
...@@ -44,7 +44,9 @@ SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; ...@@ -44,7 +44,9 @@ SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
connection server_2; connection server_2;
include/wait_for_slave_param.inc [Slave_SQL_Running_State] include/wait_for_slave_param.inc [Slave_SQL_Running_State]
include/stop_slave.inc include/stop_slave.inc
include/assert.inc [Table t1 should have 2 rows.] select count(*) 'on slave must be 2' from t1;
on slave must be 2
2
SELECT @@GLOBAL.gtid_current_pos; SELECT @@GLOBAL.gtid_current_pos;
@@GLOBAL.gtid_current_pos @@GLOBAL.gtid_current_pos
0-1-4 0-1-4
...@@ -52,7 +54,9 @@ SELECT @@GLOBAL.gtid_current_pos; ...@@ -52,7 +54,9 @@ SELECT @@GLOBAL.gtid_current_pos;
connection server_1; connection server_1;
# Ensuring variable rpl_semi_sync_slave_enabled is ON.. # Ensuring variable rpl_semi_sync_slave_enabled is ON..
# Ensuring status rpl_semi_sync_slave_status is OFF.. # Ensuring status rpl_semi_sync_slave_status is OFF..
include/assert.inc [Table t1 should have 1 rows.] select count(*) 'on master must be 1' from t1;
on master must be 1
1
FOUND 1 /truncated binlog file:.*master.*000001/ in mysqld.1.err FOUND 1 /truncated binlog file:.*master.*000001/ in mysqld.1.err
disconnect conn_client; disconnect conn_client;
connection server_2; connection server_2;
...@@ -79,9 +83,9 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; ...@@ -79,9 +83,9 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
Variable_name Value Variable_name Value
gtid_slave_pos 0-1-4 gtid_slave_pos 0-1-4
connection server_1; connection server_1;
SELECT COUNT(*) = 3 as 'true' FROM t1; SELECT COUNT(*) 'must be 3' FROM t1;
true must be 3
1 3
# ... the gtid states on the slave: # ... the gtid states on the slave:
SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos';
Variable_name Value Variable_name Value
...@@ -124,7 +128,9 @@ SET DEBUG_SYNC= "now WAIT_FOR eof_reached"; ...@@ -124,7 +128,9 @@ SET DEBUG_SYNC= "now WAIT_FOR eof_reached";
connection server_1; connection server_1;
include/wait_for_slave_param.inc [Slave_SQL_Running_State] include/wait_for_slave_param.inc [Slave_SQL_Running_State]
include/stop_slave.inc include/stop_slave.inc
include/assert.inc [Table t1 should have 5 rows.] select count(*) 'on slave must be 5' from t1;
on slave must be 5
5
SELECT @@GLOBAL.gtid_current_pos; SELECT @@GLOBAL.gtid_current_pos;
@@GLOBAL.gtid_current_pos @@GLOBAL.gtid_current_pos
0-2-7 0-2-7
...@@ -132,7 +138,9 @@ SELECT @@GLOBAL.gtid_current_pos; ...@@ -132,7 +138,9 @@ SELECT @@GLOBAL.gtid_current_pos;
connection server_2; connection server_2;
# Ensuring variable rpl_semi_sync_slave_enabled is ON.. # Ensuring variable rpl_semi_sync_slave_enabled is ON..
# Ensuring status rpl_semi_sync_slave_status is OFF.. # Ensuring status rpl_semi_sync_slave_status is OFF..
include/assert.inc [Table t1 should have 3 rows.] select count(*) 'on master must be 3' from t1;
on master must be 3
3
FOUND 1 /truncated binlog file:.*slave.*000002.* to remove transactions starting from GTID 0-1-6/ in mysqld.2.err FOUND 1 /truncated binlog file:.*slave.*000002.* to remove transactions starting from GTID 0-1-6/ in mysqld.2.err
disconnect conn_client; disconnect conn_client;
connection server_1; connection server_1;
...@@ -159,9 +167,9 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; ...@@ -159,9 +167,9 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
Variable_name Value Variable_name Value
gtid_slave_pos 0-2-7 gtid_slave_pos 0-2-7
connection server_2; connection server_2;
SELECT COUNT(*) = 6 as 'true' FROM t1; SELECT COUNT(*) 'must be 6 as' FROM t1;
true must be 6 as
1 6
# ... the gtid states on the slave: # ... the gtid states on the slave:
SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos';
Variable_name Value Variable_name Value
...@@ -205,7 +213,9 @@ SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; ...@@ -205,7 +213,9 @@ SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
connection server_2; connection server_2;
include/wait_for_slave_param.inc [Slave_SQL_Running_State] include/wait_for_slave_param.inc [Slave_SQL_Running_State]
include/stop_slave.inc include/stop_slave.inc
include/assert.inc [Table t1 should have 7 rows.] select count(*) 'on slave must be 7' from t1;
on slave must be 7
7
SELECT @@GLOBAL.gtid_current_pos; SELECT @@GLOBAL.gtid_current_pos;
@@GLOBAL.gtid_current_pos @@GLOBAL.gtid_current_pos
0-1-9 0-1-9
...@@ -213,7 +223,9 @@ SELECT @@GLOBAL.gtid_current_pos; ...@@ -213,7 +223,9 @@ SELECT @@GLOBAL.gtid_current_pos;
connection server_1; connection server_1;
# Ensuring variable rpl_semi_sync_slave_enabled is ON.. # Ensuring variable rpl_semi_sync_slave_enabled is ON..
# Ensuring status rpl_semi_sync_slave_status is OFF.. # Ensuring status rpl_semi_sync_slave_status is OFF..
include/assert.inc [Table t1 should have 6 rows.] select count(*) 'on master must be 6' from t1;
on master must be 6
6
FOUND 1 /truncated binlog file:.*master.*000002.* to remove transactions starting from GTID 0-1-9/ in mysqld.1.err FOUND 1 /truncated binlog file:.*master.*000002.* to remove transactions starting from GTID 0-1-9/ in mysqld.1.err
disconnect conn_client; disconnect conn_client;
connection server_2; connection server_2;
...@@ -242,9 +254,9 @@ Variable_name Value ...@@ -242,9 +254,9 @@ Variable_name Value
gtid_slave_pos 0-1-9 gtid_slave_pos 0-1-9
connection server_1; connection server_1;
include/sync_with_master_gtid.inc include/sync_with_master_gtid.inc
SELECT COUNT(*) = 8 as 'true' FROM t1; SELECT COUNT(*) 'must be 8' FROM t1;
true must be 8
1 8
# ... the gtid states on the slave: # ... the gtid states on the slave:
SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos';
Variable_name Value Variable_name Value
......
...@@ -68,9 +68,7 @@ source include/wait_for_slave_param.inc; ...@@ -68,9 +68,7 @@ source include/wait_for_slave_param.inc;
--error 2003 --error 2003
--source include/stop_slave.inc --source include/stop_slave.inc
--let $assert_cond= COUNT(*) = $expected_rows_on_slave FROM t1 --eval select count(*) 'on slave must be $expected_rows_on_slave' from t1
--let $assert_text= Table t1 should have $expected_rows_on_slave rows.
--source include/assert.inc
SELECT @@GLOBAL.gtid_current_pos; SELECT @@GLOBAL.gtid_current_pos;
...@@ -95,9 +93,7 @@ if (`SELECT strcmp("OFF", "$slave_semi_sync_status") != 0`) ...@@ -95,9 +93,7 @@ if (`SELECT strcmp("OFF", "$slave_semi_sync_status") != 0`)
--die Slave started with skip-slave-start yet started with rpl_semi_sync_slave_status=ON --die Slave started with skip-slave-start yet started with rpl_semi_sync_slave_status=ON
} }
--let $assert_cond= COUNT(*) = $expected_rows_on_master FROM t1 --eval select count(*) 'on master must be $expected_rows_on_master' from t1
--let $assert_text= Table t1 should have $expected_rows_on_master rows.
--source include/assert.inc
# Check error log for correct messages. # Check error log for correct messages.
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.$server_to_crash.err; let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.$server_to_crash.err;
......
...@@ -83,7 +83,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; ...@@ -83,7 +83,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
--connection server_1 --connection server_1
--sync_with_master --sync_with_master
--eval SELECT COUNT(*) = $rows_so_far as 'true' FROM t1 --eval SELECT COUNT(*) 'must be $rows_so_far' FROM t1
--echo # ... the gtid states on the slave: --echo # ... the gtid states on the slave:
SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos';
SHOW VARIABLES LIKE 'gtid_binlog_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos';
...@@ -134,7 +134,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; ...@@ -134,7 +134,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
--connection server_2 --connection server_2
--sync_with_master --sync_with_master
--eval SELECT COUNT(*) = $rows_so_far as 'true' FROM t1 --eval SELECT COUNT(*) 'must be $rows_so_far as' FROM t1
--echo # ... the gtid states on the slave: --echo # ... the gtid states on the slave:
SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos';
SHOW VARIABLES LIKE 'gtid_binlog_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos';
...@@ -185,7 +185,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos'; ...@@ -185,7 +185,7 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
--connection server_1 --connection server_1
--source include/sync_with_master_gtid.inc --source include/sync_with_master_gtid.inc
--eval SELECT COUNT(*) = $rows_so_far as 'true' FROM t1 --eval SELECT COUNT(*) 'must be $rows_so_far' FROM t1
--echo # ... the gtid states on the slave: --echo # ... the gtid states on the slave:
SHOW VARIABLES LIKE 'gtid_slave_pos'; SHOW VARIABLES LIKE 'gtid_slave_pos';
SHOW VARIABLES LIKE 'gtid_binlog_pos'; SHOW VARIABLES LIKE 'gtid_binlog_pos';
......
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