diff options
Diffstat (limited to 'storage/rocksdb/mysql-test/rocksdb_rpl/r')
25 files changed, 2745 insertions, 0 deletions
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result new file mode 100644 index 00000000..31777c45 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/consistent_snapshot_mixed_engines.result @@ -0,0 +1,68 @@ +DROP TABLE IF EXISTS t1; +connect con1,localhost,root,,; +connect con2,localhost,root,,; +connection con1; +create table i1 (id int primary key , value int) engine=innodb; +create table r1 (id int primary key , value int) engine=rocksdb; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection con2; +insert into i1 values (1,1); +insert into r1 values (1,1); +connection con1; +select * from i1; +id value +select * from r1; +id value +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 1115 uuid:1-5 +connection con2; +insert into i1 values (2,2); +insert into r1 values (2,2); +connection con1; +select * from i1; +id value +1 1 +2 2 +select * from r1; +id value +1 1 +connection con2; +insert into i1 values (3,2); +insert into r1 values (3,2); +connection con1; +select * from i1; +id value +1 1 +2 2 +select * from r1; +id value +1 1 +START TRANSACTION WITH CONSISTENT INNODB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 2015 uuid:1-9 +connection con2; +insert into r1 values (4,4); +connection con1; +select * from r1; +id value +1 1 +2 2 +3 2 +4 4 +connection con2; +insert into r1 values (5,5); +connection con1; +select * from r1; +id value +1 1 +2 2 +3 2 +4 4 +drop table i1; +drop table r1; +connection default; +disconnect con1; +disconnect con2; +reset master; diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/mdev12179.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/mdev12179.result new file mode 100644 index 00000000..a1e501f7 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/mdev12179.result @@ -0,0 +1,283 @@ +include/master-slave.inc +[connection master] +connection server_2; +include/stop_slave.inc +SET GLOBAL gtid_cleanup_batch_size = 999999999; +CHANGE MASTER TO master_use_gtid=slave_pos; +SET sql_log_bin=0; +CREATE TABLE mysql.gtid_slave_pos_innodb LIKE mysql.gtid_slave_pos; +ALTER TABLE mysql.gtid_slave_pos_innodb ENGINE=InnoDB; +CREATE TABLE mysql.gtid_slave_pos_rocksdb LIKE mysql.gtid_slave_pos; +ALTER TABLE mysql.gtid_slave_pos_rocksdb ENGINE=rocksdb; +CREATE TABLE mysql.gtid_slave_pos_myisam_redundant LIKE mysql.gtid_slave_pos; +CREATE TABLE mysql.gtid_slave_pos_innodb_redundant LIKE mysql.gtid_slave_pos; +ALTER TABLE mysql.gtid_slave_pos_innodb_redundant ENGINE=InnoDB; +call mtr.add_suppression("Ignoring redundant table.*since.*has the same storage engine"); +include/start_slave.inc +connection server_1; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t3 (a INT PRIMARY KEY) ENGINE=rocksdb; +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +INSERT INTO t3 VALUES (1); +SELECT * FROM t1 ORDER BY a; +a +1 +SELECT * FROM t2 ORDER BY a; +a +1 +SELECT * FROM t3 ORDER BY a; +a +1 +connection server_2; +SELECT * FROM t1 ORDER BY a; +a +1 +SELECT * FROM t2 ORDER BY a; +a +1 +SELECT * FROM t3 ORDER BY a; +a +1 +SELECT * FROM mysql.gtid_slave_pos ORDER BY sub_id; +domain_id sub_id server_id seq_no +0 1 1 1 +0 2 1 2 +0 3 1 3 +0 4 1 4 +SELECT * FROM ( SELECT * FROM mysql.gtid_slave_pos_innodb +UNION ALL SELECT * FROM mysql.gtid_slave_pos_innodb_redundant) inner_select +ORDER BY sub_id; +domain_id sub_id server_id seq_no +0 5 1 5 +SELECT * FROM mysql.gtid_slave_pos_rocksdb ORDER BY sub_id; +domain_id sub_id server_id seq_no +0 6 1 6 +connection server_2; +FLUSH NO_WRITE_TO_BINLOG STATUS; +SET sql_log_bin=0; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 0 +INSERT INTO t1 VALUES (100); +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 0 +INSERT INTO t2 VALUES (101); +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 0 +INSERT INTO t3 VALUES (101); +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 0 +BEGIN; +INSERT INTO t3 VALUES (102); +INSERT INTO t2 VALUES (103); +COMMIT; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 1 +BEGIN; +INSERT INTO t2 VALUES (104); +INSERT INTO t3 VALUES (105); +COMMIT; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 2 +UPDATE t2, t3 SET t2.a=106, t3.a=107 WHERE t2.a=104 AND t3.a=105; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 3 +SET sql_log_bin=1; +INSERT INTO t1 VALUES (200); +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 3 +INSERT INTO t2 VALUES (201); +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 3 +INSERT INTO t3 VALUES (201); +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 3 +BEGIN; +INSERT INTO t3 VALUES (202); +INSERT INTO t2 VALUES (203); +COMMIT; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 4 +BEGIN; +INSERT INTO t2 VALUES (204); +INSERT INTO t3 VALUES (205); +COMMIT; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 5 +UPDATE t2, t3 SET t2.a=206, t3.a=207 WHERE t2.a=204 AND t3.a=205; +SHOW STATUS LIKE "Transactions_multi_engine"; +Variable_name Value +Transactions_multi_engine 6 +DELETE FROM t1 WHERE a >= 100; +DELETE FROM t2 WHERE a >= 100; +DELETE FROM t3 WHERE a >= 100; +connection server_1; +include/save_master_gtid.inc +connection server_2; +include/sync_with_master_gtid.inc +SELECT COUNT(*)>=10 FROM mysql.gtid_slave_pos; +COUNT(*)>=10 +1 +SELECT COUNT(*)>=10 FROM ( SELECT * FROM mysql.gtid_slave_pos_innodb +UNION ALL SELECT * FROM mysql.gtid_slave_pos_innodb_redundant) inner_select; +COUNT(*)>=10 +1 +SELECT COUNT(*)>=10 FROM mysql.gtid_slave_pos_rocksdb; +COUNT(*)>=10 +1 +SET GLOBAL gtid_cleanup_batch_size = 3; +connection server_2; +include/stop_slave.inc +SET sql_log_bin=0; +DROP TABLE mysql.gtid_slave_pos_rocksdb; +DROP TABLE mysql.gtid_slave_pos_myisam_redundant; +DROP TABLE mysql.gtid_slave_pos_innodb_redundant; +SET sql_log_bin=1; +FLUSH NO_WRITE_TO_BINLOG STATUS; +include/start_slave.inc +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 0 +Transactions_multi_engine 0 +connection server_1; +INSERT INTO t1 VALUES (100); +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 0 +Transactions_multi_engine 0 +connection server_1; +INSERT INTO t2 VALUES (101); +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 0 +Transactions_multi_engine 0 +connection server_1; +INSERT INTO t3 VALUES (101); +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 0 +connection server_1; +BEGIN; +INSERT INTO t3 VALUES (102); +INSERT INTO t2 VALUES (103); +COMMIT; +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 1 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 1 +connection server_1; +BEGIN; +INSERT INTO t2 VALUES (104); +INSERT INTO t3 VALUES (105); +COMMIT; +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 2 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 2 +connection server_1; +UPDATE t2, t3 SET t2.a=106, t3.a=107 WHERE t2.a=104 AND t3.a=105; +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 3 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 3 +connection server_2; +connection server_2; +SHOW VARIABLES LIKE 'log_bin'; +Variable_name Value +log_bin OFF +include/start_slave.inc +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 0 +Transactions_multi_engine 0 +connection server_1; +INSERT INTO t1 VALUES (200); +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 0 +Transactions_multi_engine 0 +connection server_1; +INSERT INTO t2 VALUES (201); +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 0 +Transactions_multi_engine 0 +connection server_1; +INSERT INTO t3 VALUES (201); +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 0 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 0 +connection server_1; +BEGIN; +INSERT INTO t3 VALUES (202); +INSERT INTO t2 VALUES (203); +COMMIT; +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 1 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 1 +connection server_1; +BEGIN; +INSERT INTO t2 VALUES (204); +INSERT INTO t3 VALUES (205); +COMMIT; +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 2 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 2 +connection server_1; +UPDATE t2, t3 SET t2.a=206, t3.a=207 WHERE t2.a=204 AND t3.a=205; +connection server_2; +SHOW STATUS LIKE "%transactions%engine"; +Variable_name Value +Rpl_transactions_multi_engine 3 +Transactions_gtid_foreign_engine 1 +Transactions_multi_engine 3 +connection server_2; +SET sql_log_bin=0; +DROP TABLE mysql.gtid_slave_pos_innodb; +SET sql_log_bin=1; +connection server_1; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/multiclient_2pc.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/multiclient_2pc.result new file mode 100644 index 00000000..493107ec --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/multiclient_2pc.result @@ -0,0 +1,26 @@ +DROP TABLE IF EXISTS t1; +SET GLOBAL MAX_BINLOG_SIZE = 4096; +SET GLOBAL ROCKSDB_ENABLE_2PC = ON; +create table t1 (a int primary key, b int, c varchar(255)) engine=rocksdb; +'con1' +SET SESSION debug="d,crash_commit_after_log"; +SET DEBUG_SYNC='rocksdb.prepared SIGNAL parked WAIT_FOR go'; +insert into t1 values (1, 1, "iamtheogthealphaandomega");; +'con2' +insert into t1 values (2, 1, "i_am_just_here_to_trigger_a_flush"); +SET GLOBAL ROCKSDB_FLUSH_LOG_AT_TRX_COMMIT = 0; +SET GLOBAL SYNC_BINLOG = 0; +SET DEBUG_SYNC='now WAIT_FOR parked'; +SET GLOBAL ROCKSDB_FLUSH_LOG_AT_TRX_COMMIT = 2; +SET GLOBAL SYNC_BINLOG = 1; +insert into t1 values (1000000, 1, "i_am_just_here_to_trigger_a_flush"); +SET DEBUG_SYNC='now SIGNAL go'; +**found 'prepare' log entry** +**found 'commit' log entry** +select * from t1 where a=1; +a b c +1 1 iamtheogthealphaandomega +select count(*) from t1; +count(*) +4096 +drop table t1; diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/optimize_myrocks_replace_into.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/optimize_myrocks_replace_into.result new file mode 100644 index 00000000..1b41405f --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/optimize_myrocks_replace_into.result @@ -0,0 +1,282 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +SET @prior_rocksdb_perf_context_level = @@rocksdb_perf_context_level; +SET GLOBAL rocksdb_perf_context_level=3; +SET GLOBAL enable_blind_replace=ON; +create table t1(c1 int,c2 int, primary key (c1)) engine=rocksdb; +insert into t1 values(1,1),(2,2),(3,3); +select * from t1; +c1 c2 +1 1 +2 2 +3 3 +create table t2(c1 int,c2 int, primary key (c1)) engine=rocksdb; +insert into t2 values(1,1),(2,2),(3,3); +select * from t2; +c1 c2 +1 1 +2 2 +3 3 +create table t3(c1 int,c2 int, primary key (c1)) engine=rocksdb; +insert into t3 values(1,1),(2,2),(3,3); +select * from t3; +c1 c2 +1 1 +2 2 +3 3 +SET GLOBAL enable_blind_replace=ON; +create trigger trg before insert on t2 for each row set @a:=1; +alter table t3 add constraint slave_unique_key unique (c2); +connect slave +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +Case 1 +connect master +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +replace into t1 values(1,11); +replace into t1 values(2,22); +replace into t1 values(3,33); +select case when variable_value-@d > 3 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +true +select * from t1; +c1 c2 +1 11 +2 22 +3 33 +connect slave +select case when variable_value-@d > 3 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +true +select * from t1; +c1 c2 +1 11 +2 22 +3 33 +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +Case 2 +connect master +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +replace into t1 values(2,44),(3,55); +select case when variable_value-@d > 2 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +true +select * from t1; +c1 c2 +1 11 +2 44 +3 55 +connect slave +select case when variable_value-@d > 2 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +true +select * from t1; +c1 c2 +1 11 +2 44 +3 55 +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +Case 3 +connect master +update t1 set c2=66 where c1=3; +select * from t1; +c1 c2 +1 11 +2 44 +3 66 +connect slave +select * from t1; +c1 c2 +1 11 +2 44 +3 66 +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +Case 4 +connect master +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +replace into t2 values(1,111); +replace into t2 values(2,222); +replace into t2 values(3,333); +select case when variable_value-@d > 3 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +true +select * from t2; +c1 c2 +1 111 +2 222 +3 333 +connect slave +select case when variable_value-@d > 3 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +false +select * from t2; +c1 c2 +1 111 +2 222 +3 333 +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +Case 5 +connect master +select variable_value into @d from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +replace into t3 values(1,1111); +replace into t3 values(2,2222); +replace into t3 values(3,3333); +select * from t3; +c1 c2 +1 1111 +2 2222 +3 3333 +select case when variable_value-@d > 3 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +true +connect slave +select case when variable_value-@d > 3 then 'false' else 'true' end as read_free from information_schema.global_status where variable_name='rocksdb_num_get_for_update_calls'; +read_free +false +select * from t3; +c1 c2 +1 1111 +2 2222 +3 3333 +select * from t3 use index (slave_unique_key); +c1 c2 +1 1111 +2 2222 +3 3333 +Case 6 +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; create table t1(c1 int,c2 int, primary key (c1)) engine=rocksdb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; create table t2(c1 int,c2 int, primary key (c1)) engine=rocksdb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; create table t3(c1 int,c2 int, primary key (c1)) engine=rocksdb +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; create table t1(c1 int,c2 int, primary key (c1)) engine=rocksdb +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # use `test`; create table t2(c1 int,c2 int, primary key (c1)) engine=rocksdb +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t2) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # use `test`; create table t3(c1 int,c2 int, primary key (c1)) engine=rocksdb +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t3) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t2 for each row set @a:=1 +slave-bin.000001 # Query # # use `test`; alter table t3 add constraint slave_unique_key unique (c2) +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t1) +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t2) +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t2) +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t2) +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t3) +slave-bin.000001 # Delete_rows # # table_id: # +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t3) +slave-bin.000001 # Delete_rows # # table_id: # +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +slave-bin.000001 # Query # # BEGIN +slave-bin.000001 # Table_map # # table_id: # (test.t3) +slave-bin.000001 # Delete_rows # # table_id: # +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Xid # # COMMIT /* XID */ +drop table t1; +drop table t2; +drop table t3; +SET GLOBAL rocksdb_perf_context_level = @prior_rocksdb_perf_context_level; +SET GLOBAL enable_blind_replace=DEFAULT; +SET GLOBAL enable_blind_replace=DEFAULT; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rocksdb_slave_check_before_image_consistency.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rocksdb_slave_check_before_image_consistency.result new file mode 100644 index 00000000..a7708222 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rocksdb_slave_check_before_image_consistency.result @@ -0,0 +1,165 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Error_code: 1032"); +create table t1 (a int primary key, b int, c int) engine = rocksdb; +create table t2 (a int unique, b int, c int) engine = rocksdb; +create table t3 (a int, b int, c int, key(a)) engine = rocksdb; +create table t4 (a int, b int, c int) engine = rocksdb; +insert into t1 values(1, 1, 1); +insert into t2 values(1, 1, 1); +insert into t3 values(1, 1, 1); +insert into t4 values(1, 1, 1); +include/sync_slave_sql_with_master.inc +set @@sql_log_bin = 0; +update t1 set c = 2; +update t2 set c = 2; +update t3 set c = 2; +update t4 set c = 2; +set @@sql_log_bin = 1; +update t1 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t1 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +update t2 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t2 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +update t3 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t3 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +update t4 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t4 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +select * from t1; +a b c +1 2 1 +select * from t2; +a b c +1 2 1 +select * from t3; +a b c +1 2 1 +select * from t4; +a b c +1 2 1 +select * from t1; +a b c +1 2 1 +select * from t2; +a b c +1 2 1 +select * from t3; +a b c +1 2 1 +select * from t4; +a b c +1 2 1 +drop table t1; +drop table t2; +drop table t3; +drop table t4; +include/sync_slave_sql_with_master.inc +include/stop_slave.inc +set @@global.slave_rows_search_algorithms = 'INDEX_SCAN,TABLE_SCAN,HASH_SCAN'; +include/start_slave.inc +create table t1 (a int primary key, b int, c int) engine = rocksdb; +create table t2 (a int unique, b int, c int) engine = rocksdb; +create table t3 (a int, b int, c int, key(a)) engine = rocksdb; +create table t4 (a int, b int, c int) engine = rocksdb; +insert into t1 values(1, 1, 1); +insert into t2 values(1, 1, 1); +insert into t3 values(1, 1, 1); +insert into t4 values(1, 1, 1); +include/sync_slave_sql_with_master.inc +set @@sql_log_bin = 0; +update t1 set c = 2; +update t2 set c = 2; +update t3 set c = 2; +update t4 set c = 2; +set @@sql_log_bin = 1; +update t1 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t1 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +update t2 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t2 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +update t3 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t3 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +update t4 set b = 2; +include/wait_for_slave_sql_error.inc [errno=1032] +set @@sql_log_bin = 0; +update t4 set c = 1; +set @@sql_log_bin = 1; +include/stop_slave.inc +include/start_slave.inc +include/sync_slave_sql_with_master.inc +select * from t1; +a b c +1 2 1 +select * from t2; +a b c +1 2 1 +select * from t3; +a b c +1 2 1 +select * from t4; +a b c +1 2 1 +select * from t1; +a b c +1 2 1 +select * from t2; +a b c +1 2 1 +select * from t3; +a b c +1 2 1 +select * from t4; +a b c +1 2 1 +drop table t1; +drop table t2; +drop table t3; +drop table t4; +include/sync_slave_sql_with_master.inc +include/stop_slave.inc +set @@global.slave_rows_search_algorithms = DEFAULT; +include/start_slave.inc +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result new file mode 100644 index 00000000..9b46a5b5 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result @@ -0,0 +1,204 @@ +CREATE TABLE `t` ( +`a` text DEFAULT NULL +) ENGINE=ROCKSDB; +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +INSERT INTO t SET a=repeat('a', 4096); +INSERT INTO t SET a=repeat('a', 4096/2); +DROP TABLE t; diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_crash_safe_wal_corrupt.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_crash_safe_wal_corrupt.result new file mode 100644 index 00000000..6d061e99 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_crash_safe_wal_corrupt.result @@ -0,0 +1,135 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +drop table if exists x; +select @@binlog_format; +@@binlog_format +ROW +create table x (id int primary key, value int, value2 int, index(value)) engine=rocksdb; +insert into x values (1,1,1); +insert into x values (2,1,1); +insert into x values (3,1,1); +insert into x values (4,1,1); +insert into x values (5,1,1); +select @@global.gtid_executed; +@@global.gtid_executed + + +--- slave state before crash --- +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +select @@global.gtid_executed; +@@global.gtid_executed + +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +include/rpl_start_server.inc [server_number=2] + +--- slave state after crash recovery, slave stop, one transaction recovered--- +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +select @@global.gtid_executed; +@@global.gtid_executed + +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid + +--- slave state after restart, slave start --- +include/start_slave.inc +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +select @@global.gtid_executed; +@@global.gtid_executed + +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +insert into x values (6,1,1); +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +select @@global.gtid_executed; +@@global.gtid_executed + +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +insert into x values (7,1,1); +insert into x values (8,1,1); +insert into x values (9,1,1); +insert into x values (10,1,1); +insert into x values (11,1,1); +insert into x values (12,1,1); +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +7 1 1 +8 1 1 +9 1 1 +10 1 1 +11 1 1 +12 1 1 +select @@global.gtid_executed; +@@global.gtid_executed + +include/rpl_start_server.inc [server_number=2] + +--- slave state after crash recovery, slave stop, WAL was corrupted, point in time recovery with wal_recovery_mode=2 --- +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +7 1 1 +8 1 1 +9 1 1 +include/start_slave.inc +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +7 1 1 +8 1 1 +9 1 1 +10 1 1 +11 1 1 +12 1 1 +select @@global.gtid_executed; +@@global.gtid_executed + +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +drop table x; +include/rpl_end.inc +Binlog Info Found diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_ddl_high_priority.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_ddl_high_priority.result new file mode 100644 index 00000000..8a1fd1b9 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_ddl_high_priority.result @@ -0,0 +1,39 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +include/rpl_connect.inc [creating slave_block] +drop table if exists t1; +create table t1 (i int); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 +insert into t1 values (1), (2), (3); +connection slave +select * from t1; +i +1 +2 +3 +connection slave_block +lock tables t1 read; +connection master; +create high_priority index idx1 on t1 (i); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + KEY `idx1` (`i`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 +connection slave; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + KEY `idx1` (`i`) +) ENGINE=ROCKSDB DEFAULT CHARSET=latin1 +drop table t1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe.result new file mode 100644 index 00000000..352ceff2 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe.result @@ -0,0 +1,361 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Recovery from master pos"); +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 mtr uuid:1 +2 test uuid:4 +SET GLOBAL debug = '+d,crash_before_update_pos'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 mtr uuid:1 +2 test uuid:4 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 mtr uuid:1 +2 test uuid:7 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_after_update_pos_before_apply'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_before_writing_xid'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,half_binlogged_transaction'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_before'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_after_log'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_after_prepare'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_after'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe_optimized.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe_optimized.result new file mode 100644 index 00000000..a518de2b --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe_optimized.result @@ -0,0 +1,361 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Recovery from master pos"); +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 mtr +2 test uuid:4 +SET GLOBAL debug = '+d,crash_before_update_pos'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 mtr +2 test uuid:4 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 mtr +2 test uuid:5 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_after_update_pos_before_apply'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_before_writing_xid'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,half_binlogged_transaction'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_before'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_after_log'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_after_prepare'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_reset.inc +create table t1(a int, PRIMARY KEY(a)) ENGINE=ROCKSDB; +insert into t1 values(1); +insert into t1 values(2); +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +SET GLOBAL debug = '+d,crash_commit_after'; +insert into t1 values(3); +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:3 +use test; +select * from t1; +a +1 +2 +change master to master_auto_position = 1; +include/start_slave.inc +rename table t1 to test1; +use test; +select * from test1; +a +1 +2 +3 +use test; +select * from test1; +a +1 +2 +3 +drop table test1; +include/stop_slave.inc +change master to master_auto_position = 0; +include/start_slave.inc +use mysql; +select * from slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:4 +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe_wal_corrupt.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe_wal_corrupt.result new file mode 100644 index 00000000..e765e338 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_crash_safe_wal_corrupt.result @@ -0,0 +1,140 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +drop table if exists x; +select @@binlog_format; +@@binlog_format +ROW +create table x (id int primary key, value int, value2 int, index(value)) engine=rocksdb; +insert into x values (1,1,1); +insert into x values (2,1,1); +insert into x values (3,1,1); +insert into x values (4,1,1); +insert into x values (5,1,1); +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-7 + +--- slave state before crash --- +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-7 +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:7 +include/rpl_start_server.inc [server_number=2] + +--- slave state after crash recovery, slave stop, one transaction recovered--- +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-6 +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:6 + +--- slave state after restart, slave start --- +include/start_slave.inc +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-7 +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:7 +insert into x values (6,1,1); +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-8 +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:8 +insert into x values (7,1,1); +insert into x values (8,1,1); +insert into x values (9,1,1); +insert into x values (10,1,1); +insert into x values (11,1,1); +insert into x values (12,1,1); +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +7 1 1 +8 1 1 +9 1 1 +10 1 1 +11 1 1 +12 1 1 +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-14 +include/rpl_start_server.inc [server_number=2] + +--- slave state after crash recovery, slave stop, WAL was corrupted, point in time recovery with wal_recovery_mode=2 --- +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +7 1 1 +8 1 1 +9 1 1 +include/start_slave.inc +select * from x; +id value value2 +1 1 1 +2 1 1 +3 1 1 +4 1 1 +5 1 1 +6 1 1 +7 1 1 +8 1 1 +9 1 1 +10 1 1 +11 1 1 +12 1 1 +select @@global.gtid_executed; +@@global.gtid_executed +uuid:1-14 +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +1 test uuid:14 +drop table x; +include/rpl_end.inc +Binlog Info Found diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result new file mode 100644 index 00000000..2b5c5300 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result @@ -0,0 +1,16 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +create table t1 (a int primary key) engine=rocksdb; +insert into t1 values(1); +SET GLOBAL debug = '+d,crash_before_writing_xid'; +insert into t1 values(2); +ERROR HY000: Lost connection to server during query +include/rpl_reconnect.inc +SET GLOBAL debug = ``; +include/start_slave.inc +RocksDB: Last MySQL Gtid master_uuid:2 +drop table t1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_missing_columns_sk_update.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_missing_columns_sk_update.result new file mode 100644 index 00000000..19b0a191 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_missing_columns_sk_update.result @@ -0,0 +1,62 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +set @@sql_log_bin = 0; +CREATE TABLE `t1` ( +`a` int(10) unsigned NOT NULL DEFAULT '0', +`b` bigint(20) unsigned NOT NULL DEFAULT '0', +`c` bigint(20) unsigned NOT NULL DEFAULT '0', +`d` bigint(20) unsigned NOT NULL DEFAULT '0', +`e` varbinary(64) DEFAULT NULL, +`f` int(10) NOT NULL DEFAULT '0', +`g` int(10) NOT NULL DEFAULT '0', +`h` int(10) unsigned NOT NULL DEFAULT '0', +PRIMARY KEY (`a`,`b`), +KEY `key1` (`a`, `e`(1)), +KEY `key2` (`a`,`h`) +) ENGINE=RocksDB; +set @@sql_log_bin = 1; +set @@sql_log_bin = 0; +CREATE TABLE `t1` ( +`a` int(10) unsigned NOT NULL DEFAULT '0', +`b` bigint(20) unsigned NOT NULL DEFAULT '0', +`c` bigint(20) unsigned NOT NULL DEFAULT '0', +`d` bigint(20) unsigned NOT NULL DEFAULT '0', +`e` varbinary(64) DEFAULT NULL, +`f` int(10) NOT NULL DEFAULT '0', +`g` int(10) NOT NULL DEFAULT '0', +`x` TINYINT(3) UNSIGNED DEFAULT NULL, +`y` INT(10) DEFAULT NULL, +`h` int(10) unsigned NOT NULL DEFAULT '0', +PRIMARY KEY (`a`,`b`), +KEY `key1` (`a`, `e`(1)), +KEY `key2` (`a`,`h`) +) ENGINE=RocksDB; +set @@sql_log_bin = 1; +INSERT INTO t1 VALUES (1, 1, 1, 1, 'a', 1, 1, 1); +SELECT * FROM t1; +a b c d e f g h +1 1 1 1 a 1 1 1 +SELECT * FROM t1; +a b c d e f g x y h +1 1 1 1 a 1 1 NULL NULL 1 +UPDATE t1 SET h = 10 WHERE h = 1; +SELECT * FROM t1; +a b c d e f g h +1 1 1 1 a 1 1 10 +SELECT * FROM t1; +a b c d e f g x y h +1 1 1 1 a 1 1 NULL NULL 10 +SELECT COUNT(*) FROM t1 FORCE INDEX (key1) WHERE h = 10 AND a = 1; +COUNT(*) +1 +SELECT COUNT(*) FROM t1 FORCE INDEX (key2) WHERE h = 10 AND a = 1; +COUNT(*) +1 +SELECT COUNT(*) FROM t1 FORCE INDEX (PRIMARY) WHERE h = 10 AND a = 1; +COUNT(*) +1 +DROP TABLE t1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_mts_dependency_unique_key_conflicts.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_mts_dependency_unique_key_conflicts.result new file mode 100644 index 00000000..0eadc7de --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_mts_dependency_unique_key_conflicts.result @@ -0,0 +1,44 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +include/stop_slave.inc +set @save.slave_parallel_workers= @@global.slave_parallel_workers; +set @save.slave_use_idempotent_for_recovery= @@global.slave_use_idempotent_for_recovery; +set @save.mts_dependency_replication= @@global.mts_dependency_replication; +set @save.mts_dependency_order_commits= @@global.mts_dependency_order_commits; +set @save.debug= @@global.debug; +set @@global.slave_parallel_workers= 2; +set @@global.slave_use_idempotent_for_recovery= YES; +set @@global.mts_dependency_replication= STMT; +set @@global.mts_dependency_order_commits= false; +set @@global.debug= '+d,dbug.dep_wait_before_update_execution'; +include/start_slave.inc +create table t1 (a int primary key, b int unique key) engine = rocksdb; +insert into t1 values(1, 1); +include/sync_slave_sql_with_master.inc +include/stop_slave.inc +update t1 set b = 2 where a = 1; +insert into t1 values(2, 1); +include/start_slave.inc +set debug_sync="now wait_for signal.reached"; +select * from t1; +a b +1 1 +set debug_sync="now signal signal.done"; +include/sync_slave_sql_with_master.inc +select * from t1; +a b +2 1 +1 2 +drop table t1; +include/sync_slave_sql_with_master.inc +include/stop_slave.inc +set @@global.slave_parallel_workers= @save.slave_parallel_workers; +set @@global.mts_dependency_replication= @save.mts_dependency_replication; +set @@global.slave_use_idempotent_for_recovery= @save.slave_use_idempotent_for_recovery; +set @@global.mts_dependency_order_commits= @save.mts_dependency_order_commits; +set @@global.debug= @save.debug; +include/start_slave.inc +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_no_unique_check_on_lag.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_no_unique_check_on_lag.result new file mode 100644 index 00000000..905b56da --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_no_unique_check_on_lag.result @@ -0,0 +1,34 @@ +# +# Ensure skip_unique_check is set when lag exceeds lag_threshold +# +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Slave SQL: Could not execute Write_rows event on table test.t1"); +call mtr.add_suppression(".*Worker.*failed executing transaction"); +call mtr.add_suppression(".*The slave coordinator and worker threads are stopped"); +drop table if exists t1; +CREATE TABLE t1 (id int primary key, value int) engine=RocksDB; +set global reset_seconds_behind_master=1; +INSERT INTO t1 VALUES(1, 0); +INSERT INTO t1 VALUES(2, 0); +INSERT INTO t1 VALUES(3, 0); +INSERT INTO t1 VALUES(1, 1); +include/wait_for_slave_sql_error_and_skip.inc [errno=1062] +set global reset_seconds_behind_master=0; +include/stop_slave_io.inc +INSERT INTO t1 values (4,0); +INSERT INTO t1 VALUES(2, 1); +include/start_slave_io.inc +set global reset_seconds_behind_master=1; +insert into t1 values (5,0); +INSERT INTO t1 VALUES(3, 1); +include/wait_for_slave_sql_error_and_skip.inc [errno=1062] +# +# Cleanup +# +DROP TABLE t1; +set global reset_seconds_behind_master=1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_no_unique_check_on_lag_mts.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_no_unique_check_on_lag_mts.result new file mode 100644 index 00000000..6c58cb16 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_no_unique_check_on_lag_mts.result @@ -0,0 +1,31 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Slave SQL: Could not execute Write_rows event on table test.t1"); +call mtr.add_suppression(".*Worker.*failed executing transaction"); +call mtr.add_suppression(".*The slave coordinator and worker threads are stopped"); +drop table if exists t1; +CREATE TABLE t1 (id int primary key, value int) engine=RocksDB; +set global reset_seconds_behind_master=1; +INSERT INTO t1 VALUES(1, 0); +INSERT INTO t1 VALUES(2, 0); +INSERT INTO t1 VALUES(3, 0); +INSERT INTO t1 VALUES(1, 1); +include/wait_for_slave_sql_error_and_skip.inc [errno=1062] +set global reset_seconds_behind_master=0; +include/stop_slave_io.inc +INSERT INTO t1 values (4,0); +INSERT INTO t1 VALUES(2, 1); +include/start_slave_io.inc +set global reset_seconds_behind_master=1; +insert into t1 values (5,0); +INSERT INTO t1 VALUES(3, 1); +include/wait_for_slave_sql_error_and_skip.inc [errno=1062] +# +# Cleanup +# +DROP TABLE t1; +set global reset_seconds_behind_master=1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_2pc_crash_recover.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_2pc_crash_recover.result new file mode 100644 index 00000000..cf3fe03a --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_2pc_crash_recover.result @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS t1; +create table t1 (a int primary key, msg varchar(255)) engine=rocksdb; +SET GLOBAL ROCKSDB_ENABLE_2PC = ON; +SET SESSION debug_dbug="d,crash_commit_after_prepare"; +insert into t1 values (1, 'dogz'); +select * from t1; +a msg +SET GLOBAL ROCKSDB_ENABLE_2PC = ON; +SET SESSION debug_dbug="d,crash_commit_after_log"; +insert into t1 values (2, 'catz'), (3, 'men'); +select * from t1; +a msg +2 catz +3 men +SET GLOBAL ROCKSDB_ENABLE_2PC = ON; +SET SESSION debug_dbug="d,crash_commit_after"; +insert into t1 values (4, 'cars'), (5, 'foo'); +select * from t1; +a msg +2 catz +3 men +4 cars +5 foo +SET GLOBAL ROCKSDB_ENABLE_2PC = OFF; +SET SESSION debug_dbug="d,crash_commit_after_log"; +insert into t1 values (6, 'shipz'), (7, 'tankz'); +select * from t1; +a msg +2 catz +3 men +4 cars +5 foo +SET GLOBAL ROCKSDB_ENABLE_2PC = OFF; +SET SESSION debug_dbug="d,crash_commit_after"; +insert into t1 values (8, 'space'), (9, 'time'); +select * from t1; +a msg +2 catz +3 men +4 cars +5 foo +8 space +9 time +drop table t1; diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_slave_gtid_info_optimized.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_slave_gtid_info_optimized.result new file mode 100644 index 00000000..1f6acf32 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_slave_gtid_info_optimized.result @@ -0,0 +1,43 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +Make changes in master +create table test1 (a int primary key, b int) engine=rocksdb; +insert into test1 values (1, 1); +Make sure slave is up-to-date and mysql.slave_gtid_info is good +select * from test1; +a b +1 1 +select id, database_name, last_gtid from mysql.slave_gtid_info; +id database_name last_gtid +1 test UUID:2 +Make changes in master +insert into test1 values (2, 2); +Make sure slave is up-to-date and mysql.slave_gtid_info is good +select @@slave_gtid_info; +@@slave_gtid_info +OPTIMIZED +select * from test1; +a b +1 1 +2 2 +select * from mysql.slave_gtid_info; +Id Database_name Last_gtid +1 test UUID:3 +Make changes in master +insert into test1 values (3, 3); +insert into test1 values (4, 4); +Make sure slave is up-to-date and mysql.slave_gtid_info is good +select * from test1; +a b +1 1 +2 2 +3 3 +4 4 +select id, database_name, last_gtid from mysql.slave_gtid_info; +id database_name last_gtid +1 test UUID:5 +DROP TABLE IF EXISTS test1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_snapshot.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_snapshot.result new file mode 100644 index 00000000..f5e861fe --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_snapshot.result @@ -0,0 +1,222 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +DROP TABLE IF EXISTS t1; +# Establish connection con1 (user=root) +# Establish connection con2 (user=root) +# Establish connection con3 (user=root) +# Establish connection con4 (user=root) +# reset replication to guarantee that master-bin.000001 is used +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +RESET MASTER; +CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root"; +Warnings: +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +include/start_slave.inc +# Switch to connection con1 +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; +INSERT INTO t1 VALUES(1); +SET TRANSACTION ISOLATION LEVEL READ COMMITTED; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +ERROR HY000: Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT|SHARED|EXISTING SNAPSHOT in RocksDB Storage Engine. +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +ERROR HY000: Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT|SHARED|EXISTING SNAPSHOT in RocksDB Storage Engine. +ROLLBACK; +SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 531 UUID:1-2 +# Switch to connection con2 +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); +# Switch to connection con1 +SELECT * FROM t1; +a +1 +COMMIT; +SELECT * FROM t1; +a +1 +2 +3 +DROP TABLE t1; +# Switch to connection con1 +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; +INSERT INTO t1 VALUES(1); +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 1510 UUID:1-7 +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 1510 UUID:1-7 +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 1510 UUID:1-7 +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 1510 UUID:1-7 +# Switch to connection con2 +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); +# Switch to connection con1 +SELECT * FROM t1; +a +1 +SELECT * INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' FROM t1; +COMMIT; +# Switch to slave +CREATE TABLE t1_backup LIKE t1; +INSERT INTO t1_backup SELECT * FROM t1; +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +DELETE FROM t1; +LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' INTO TABLE t1; +SELECT * FROM t1; +a +1 +CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root",master_log_file="master-bin.000001",master_log_pos=binlog_pos; +Warnings: +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +include/start_slave.inc +SELECT * FROM t1; +a +1 +2 +3 +SELECT * FROM t1_backup; +a +1 +2 +3 +DROP TABLE t1_backup; +DROP TABLE t1; +# Switch to connection con1 +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; +INSERT INTO t1 VALUES(1); +# async queries from con2 +INSERT INTO t1 VALUES(2); +# async queries from con3 +INSERT INTO t1 VALUES(21); +# Switch to connection con1 +# Switch to connection con4 +INSERT INTO t1 VALUES(9); +# Switch to connection con1 +SELECT * INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' FROM t1; +COMMIT; +# reap async statements +# Switch to slave +CREATE TABLE t1_backup LIKE t1; +INSERT INTO t1_backup SELECT * FROM t1; +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +DELETE FROM t1; +LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' INTO TABLE t1; +CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root",master_log_file="master-bin.000001",master_log_pos=binlog_pos; +Warnings: +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +include/start_slave.inc +# sync and then query slave +ShouldBeZero +0 +DROP TABLE t1_backup; +DROP TABLE t1; +# Switch to connection con1 +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; +INSERT INTO t1 VALUES(1); +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 3688 UUID:1-18 +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 3688 UUID:1-18 +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 3688 UUID:1-18 +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000001 3688 UUID:1-18 +# Switch to connection con2 +INSERT INTO t1 VALUES(2); +INSERT INTO t1 VALUES(3); +# Switch to connection con1 +SELECT * FROM t1; +a +1 +SELECT * INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' FROM t1; +COMMIT; +# Switch to slave +CREATE TABLE t1_backup LIKE t1; +INSERT INTO t1_backup SELECT * FROM t1; +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +SET @@global.gtid_purged='gtid_executed_from_snapshot'; +DELETE FROM t1; +LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' INTO TABLE t1; +SELECT * FROM t1; +a +1 +CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root", master_auto_position=1; +Warnings: +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +include/start_slave.inc +SELECT * FROM t1; +a +1 +2 +3 +SELECT * FROM t1_backup; +a +1 +2 +3 +DROP TABLE t1_backup; +DROP TABLE t1; +# Switch to connection con1 +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=rocksdb; +INSERT INTO t1 VALUES(1); +# async queries from con2 +INSERT INTO t1 VALUES(2); +# async queries from con3 +INSERT INTO t1 VALUES(21); +# Switch to connection con1 +# Switch to connection con4 +INSERT INTO t1 VALUES(9); +# Switch to connection con1 +SELECT * INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' FROM t1; +COMMIT; +# reap async statements +# Switch to slave +CREATE TABLE t1_backup LIKE t1; +INSERT INTO t1_backup SELECT * FROM t1; +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +SET @@global.gtid_purged='gtid_executed_from_snapshot'; +DELETE FROM t1; +LOAD DATA INFILE '<MYSQLTEST_VARDIR>/tmp/rpl_rocksdb_snapshot.out.file' INTO TABLE t1; +CHANGE MASTER TO master_host="127.0.0.1",master_port=MASTER_PORT,master_user="root", master_auto_position=1; +Warnings: +Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. +Note 1760 Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +include/start_slave.inc +# sync and then query slave +ShouldBeZero +0 +DROP TABLE t1_backup; +DROP TABLE t1; +# Switch to connection default + close connections con1 and con2 +include/stop_slave.inc +CHANGE MASTER to master_auto_position=0; +include/start_slave.inc +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result new file mode 100644 index 00000000..57c1d082 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_snapshot_without_gtid.result @@ -0,0 +1,15 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +create table t1(a int primary key); +FLUSH LOGS; +insert into t1 values(1); +insert into t1 values(2); +FLUSH LOGS; +START TRANSACTION WITH CONSISTENT ROCKSDB SNAPSHOT; +File Position Gtid_executed +master-bin.000003 120 +drop table t1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_stress_crash.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_stress_crash.result new file mode 100644 index 00000000..d4920b14 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_rocksdb_stress_crash.result @@ -0,0 +1,28 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression(".*"); +include/stop_slave.inc +change master to master_auto_position=1; +include/start_slave.inc +call mtr.add_suppression('Slave: Error dropping database'); +stop slave sql_thread; +insert into test0.benchmark set state='slave is processing load'; +start slave sql_thread; +use test0; +insert into benchmark set state='slave ends load'; +use test; +select * from test1.benchmark into outfile 'benchmark.out'; +select ts from test0.benchmark where state like 'master started load' into @m_0; +select ts from test0.benchmark where state like 'master ends load' into @m_1; +select ts from test0.benchmark where state like 'slave takes on load' into @s_m0; +select ts from test0.benchmark where state like 'slave is supposed to finish with load' into @s_m1; +select ts from test0.benchmark where state like 'slave ends load' into @s_1; +select ts from test0.benchmark where state like 'slave is processing load' into @s_0; +select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out'; +include/stop_slave.inc +change master to master_auto_position=0; +include/start_slave.inc +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_skip_trx_api_binlog_format.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_skip_trx_api_binlog_format.result new file mode 100644 index 00000000..5559bf61 --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_skip_trx_api_binlog_format.result @@ -0,0 +1,27 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Master's binlog format is not ROW but rpl_skip_tx_api is enabled on the slave"); +set global rpl_skip_tx_api=ON; +set global rocksdb_unsafe_for_binlog=1; +create table t1(a int); +set session binlog_format=STATEMENT; +insert into t1 values(1); +include/wait_for_slave_sql_error.inc [errno=1756] +Last_SQL_Error = 'Master's binlog format is not ROW but rpl_skip_tx_api is enabled on the slave, this should only be used when master's binlog format is ROW.' +"Table after error" +select * from t1; +a +set global rpl_skip_tx_api=OFF; +include/start_slave.inc +include/sync_slave_sql_with_master.inc +"Table after error fixed" +select * from t1; +a +1 +drop table t1; +set global rocksdb_unsafe_for_binlog=0; +set global rpl_skip_tx_api=0; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_xa.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_xa.result new file mode 100644 index 00000000..86f73f2f --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_xa.result @@ -0,0 +1,61 @@ +include/master-slave.inc +[connection master] +connection master; +create table ti (a int, b int) engine=innodb; +create table t1 (a int, b int) engine=rocksdb; +insert into ti values(0, 0); +insert into t1 values(0, 0); +xa start 't'; +insert into ti values(1, 2); +insert into t1 values(1, 2); +xa end 't'; +xa prepare 't'; +xa commit 't'; +connection slave; +include/diff_tables.inc [master:t1, slave:t1] +connection master; +xa start 't'; +insert into ti values(3, 4); +insert into t1 values(3, 4); +xa end 't'; +xa prepare 't'; +xa rollback 't'; +connection slave; +include/diff_tables.inc [master:t1, slave:t1] +connection master; +SET pseudo_slave_mode=1; +create table t2 (a int) engine=rocksdb; +xa start 't'; +insert into ti values (5, 6); +insert into t1 values (5, 6); +xa end 't'; +xa prepare 't'; +xa start 's'; +insert into ti values (7, 8); +insert into t2 values (0); +xa end 's'; +xa prepare 's'; +include/save_master_gtid.inc +connection slave; +include/sync_with_master_gtid.inc +xa recover; +formatID gtrid_length bqual_length data +1 1 0 t +1 1 0 s +connection master; +xa commit 't'; +xa commit 's'; +SET pseudo_slave_mode=0; +Warnings: +Warning 1231 Slave applier execution mode not active, statement ineffective. +xa start 'r'; +insert into t1 values(7, 8); +xa end 'r'; +xa prepare 'r'; +xa commit 'r'; +connection slave; +include/diff_tables.inc [master:t1, slave:t1] +include/diff_tables.inc [master:t2, slave:t2] +connection master; +drop table ti, t1, t2; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_recovery.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_recovery.result new file mode 100644 index 00000000..89e93f6b --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_recovery.result @@ -0,0 +1,25 @@ +include/master-slave.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. +[connection master] +call mtr.add_suppression("Recovery from master pos"); +drop table if exists r1; +create table r1 (id1 int, id2 int, primary key (id1, id2), index i (id2)) engine=rocksdb; +insert into r1 values (1, 1000); +set global rocksdb_force_flush_memtable_now=1; +include/rpl_start_server.inc [server_number=2] +include/start_slave.inc +insert into r1 values (2,2000); +delete r1 from r1 force index (i) where id2=1000; +select id1,id2 from r1 force index (primary) where id1=1 and id2=1000; +id1 id2 +select id2 from r1 force index (i) where id1=1 and id2=1000; +id2 +set global rocksdb_compact_cf='default'; +select id1,id2 from r1 force index (primary) where id1=1 and id2=1000; +id1 id2 +select id2 from r1 force index (i) where id1=1 and id2=1000; +id2 +drop table r1; +include/rpl_end.inc diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result new file mode 100644 index 00000000..979e2cbf --- /dev/null +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result @@ -0,0 +1,29 @@ +include/master-slave.inc +[connection master] +connection master; +drop table if exists r1; +create table r1 (id1 int, id2 int, primary key (id1, id2), index i (id2)) engine=rocksdb; +insert into r1 values (1, 1000); +set sql_log_bin=0; +delete from r1 where id1=1 and id2=1000; +set sql_log_bin=1; +connection slave; +connection slave; +set global rocksdb_force_flush_memtable_now=1; +connection master; +insert into r1 values (1, 1000); +connection slave; +connection slave; +delete r1 from r1 force index (i) where id2=1000; +select id1,id2 from r1 force index (primary); +id1 id2 +select id2 from r1 force index (i); +id2 +set global rocksdb_compact_cf='default'; +select id1,id2 from r1 force index (primary); +id1 id2 +select id2 from r1 force index (i); +id2 +connection master; +drop table r1; +include/rpl_end.inc |