Linux ip-172-26-2-223 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64
Apache
: 172.26.2.223 | : 3.139.234.66
Cant Read [ /etc/named.conf ]
8.1.13
www
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
www /
server /
mysql /
mysql-test /
suite /
ndb_rpl /
t /
[ HOME SHELL ]
Name
Size
Permission
Action
disabled.def
919
B
-rw-r--r--
ndb_apply_status.frm
8.51
KB
-rw-r--r--
ndb_conflict_info.inc
3.79
KB
-rw-r--r--
ndb_conflict_info_epoch2.inc
3.2
KB
-rw-r--r--
ndb_conflict_info_epoch2_init....
1.33
KB
-rw-r--r--
ndb_conflict_info_init.inc
1.23
KB
-rw-r--r--
ndb_connect_to_primary.inc
160
B
-rw-r--r--
ndb_connect_to_secondary.inc
161
B
-rw-r--r--
ndb_dist_priv_check.inc
1.13
KB
-rw-r--r--
ndb_dist_priv_common.inc
6.89
KB
-rw-r--r--
ndb_dist_priv_default-master.o...
54
B
-rw-r--r--
ndb_dist_priv_default.test
975
B
-rw-r--r--
ndb_dist_priv_ndb-master.opt
54
B
-rw-r--r--
ndb_dist_priv_ndb.test
1.84
KB
-rw-r--r--
ndb_rpl_2innodb-master.opt
32
B
-rw-r--r--
ndb_rpl_2innodb-slave.opt
47
B
-rw-r--r--
ndb_rpl_2innodb.test
1.63
KB
-rw-r--r--
ndb_rpl_2multi_basic.inc
3.75
KB
-rw-r--r--
ndb_rpl_2multi_eng.inc
10.33
KB
-rw-r--r--
ndb_rpl_2myisam-master.opt
25
B
-rw-r--r--
ndb_rpl_2myisam-slave.opt
47
B
-rw-r--r--
ndb_rpl_2myisam.test
1.8
KB
-rw-r--r--
ndb_rpl_2ndb-slave.opt
58
B
-rw-r--r--
ndb_rpl_2ndb.test
858
B
-rw-r--r--
ndb_rpl_2other-slave.opt
45
B
-rw-r--r--
ndb_rpl_2other.test
2.18
KB
-rw-r--r--
ndb_rpl_add_column.test
3.81
KB
-rw-r--r--
ndb_rpl_apply_status-master.op...
28
B
-rw-r--r--
ndb_rpl_apply_status.test
1.5
KB
-rw-r--r--
ndb_rpl_auto_inc.test
4.18
KB
-rw-r--r--
ndb_rpl_bank.test
6.68
KB
-rw-r--r--
ndb_rpl_basic.test
11.65
KB
-rw-r--r--
ndb_rpl_batch.test
4.07
KB
-rw-r--r--
ndb_rpl_batch_handling.test
2.32
KB
-rw-r--r--
ndb_rpl_binlog_format_errors.t...
3.32
KB
-rw-r--r--
ndb_rpl_binlog_row_image_minim...
81
B
-rw-r--r--
ndb_rpl_binlog_row_image_minim...
293
B
-rw-r--r--
ndb_rpl_bitfield.test
8.11
KB
-rw-r--r--
ndb_rpl_blob.test
4.12
KB
-rw-r--r--
ndb_rpl_break_3_chain.cnf
1.59
KB
-rw-r--r--
ndb_rpl_break_3_chain.test
3.67
KB
-rw-r--r--
ndb_rpl_bug22045.test
2.4
KB
-rw-r--r--
ndb_rpl_bug_13440282.test
1.37
KB
-rw-r--r--
ndb_rpl_check_for_mixed.test
1014
B
-rw-r--r--
ndb_rpl_checksum.test
7.74
KB
-rw-r--r--
ndb_rpl_circular.test
4.42
KB
-rw-r--r--
ndb_rpl_circular_2ch.cnf
948
B
-rw-r--r--
ndb_rpl_circular_2ch.test
4.41
KB
-rw-r--r--
ndb_rpl_circular_2ch_rep_statu...
183
B
-rw-r--r--
ndb_rpl_circular_2ch_rep_statu...
11.9
KB
-rw-r--r--
ndb_rpl_circular_simplex.test
2.43
KB
-rw-r--r--
ndb_rpl_conflict_1.inc
5.15
KB
-rw-r--r--
ndb_rpl_conflict_basic.test
19.85
KB
-rw-r--r--
ndb_rpl_conflict_epoch.cnf
561
B
-rw-r--r--
ndb_rpl_conflict_epoch.inc
9.81
KB
-rw-r--r--
ndb_rpl_conflict_epoch.test
52
B
-rw-r--r--
ndb_rpl_conflict_epoch2.cnf
67
B
-rw-r--r--
ndb_rpl_conflict_epoch2.test
2.43
KB
-rw-r--r--
ndb_rpl_conflict_epoch2_extra....
37
B
-rw-r--r--
ndb_rpl_conflict_epoch2_extra....
31.45
KB
-rw-r--r--
ndb_rpl_conflict_epoch2_trans....
754
B
-rw-r--r--
ndb_rpl_conflict_epoch2_trans....
1.66
KB
-rw-r--r--
ndb_rpl_conflict_epoch_1.inc
18.75
KB
-rw-r--r--
ndb_rpl_conflict_epoch_ext.cnf
561
B
-rw-r--r--
ndb_rpl_conflict_epoch_ext.tes...
86
B
-rw-r--r--
ndb_rpl_conflict_epoch_extende...
868
B
-rw-r--r--
ndb_rpl_conflict_epoch_extende...
10.95
KB
-rw-r--r--
ndb_rpl_conflict_epoch_trans.c...
868
B
-rw-r--r--
ndb_rpl_conflict_epoch_trans.i...
27.77
KB
-rw-r--r--
ndb_rpl_conflict_epoch_trans.t...
58
B
-rw-r--r--
ndb_rpl_conflict_epoch_trans_e...
868
B
-rw-r--r--
ndb_rpl_conflict_epoch_trans_e...
92
B
-rw-r--r--
ndb_rpl_conflict_max-master.op...
28
B
-rw-r--r--
ndb_rpl_conflict_max.test
5.09
KB
-rw-r--r--
ndb_rpl_conflict_max_delete_wi...
28
B
-rw-r--r--
ndb_rpl_conflict_max_delete_wi...
4.92
KB
-rw-r--r--
ndb_rpl_conflict_old-master.op...
28
B
-rw-r--r--
ndb_rpl_conflict_old.test
5.11
KB
-rw-r--r--
ndb_rpl_conflict_read_tracking...
889
B
-rw-r--r--
ndb_rpl_conflict_read_tracking...
19.62
KB
-rw-r--r--
ndb_rpl_ctype_ucs2_def-master....
70
B
-rw-r--r--
ndb_rpl_ctype_ucs2_def.test
1.33
KB
-rw-r--r--
ndb_rpl_dd_advance.test
10.44
KB
-rw-r--r--
ndb_rpl_dd_basic.test
1.58
KB
-rw-r--r--
ndb_rpl_dd_partitions-master.o...
11
B
-rw-r--r--
ndb_rpl_dd_partitions-slave.op...
11
B
-rw-r--r--
ndb_rpl_dd_partitions.test
8.73
KB
-rw-r--r--
ndb_rpl_ddl_open_trans.test
360
B
-rw-r--r--
ndb_rpl_dist_priv.test
8.33
KB
-rw-r--r--
ndb_rpl_do_db-slave.opt
26
B
-rw-r--r--
ndb_rpl_do_db.test
1.73
KB
-rw-r--r--
ndb_rpl_do_table-slave.opt
29
B
-rw-r--r--
ndb_rpl_do_table.test
1.41
KB
-rw-r--r--
ndb_rpl_empty_epoch.test
1.12
KB
-rw-r--r--
ndb_rpl_gap_event-master.opt
24
B
-rw-r--r--
ndb_rpl_gap_event.test
2.26
KB
-rw-r--r--
ndb_rpl_get_binlog_events.inc
1.09
KB
-rw-r--r--
ndb_rpl_get_server_error_log.i...
553
B
-rw-r--r--
ndb_rpl_idempotent.test
5.72
KB
-rw-r--r--
ndb_rpl_ignore_db-master.opt
25
B
-rw-r--r--
ndb_rpl_ignore_db.test
1.27
KB
-rw-r--r--
ndb_rpl_init_rep_status.test
2.71
KB
-rw-r--r--
ndb_rpl_innodb2ndb-slave.opt
42
B
-rw-r--r--
ndb_rpl_innodb2ndb.test
714
B
-rw-r--r--
ndb_rpl_innodb_trans-slave.opt
25
B
-rw-r--r--
ndb_rpl_innodb_trans.test
1.54
KB
-rw-r--r--
ndb_rpl_last_conflict_epoch_va...
36
B
-rw-r--r--
ndb_rpl_last_conflict_epoch_va...
3.92
KB
-rw-r--r--
ndb_rpl_load.test
2.55
KB
-rw-r--r--
ndb_rpl_logging.test
3.96
KB
-rw-r--r--
ndb_rpl_mix_eng_trans.test
8.84
KB
-rw-r--r--
ndb_rpl_mix_innodb-master.opt
32
B
-rw-r--r--
ndb_rpl_mix_innodb.test
533
B
-rw-r--r--
ndb_rpl_mixed_tables-master.op...
13
B
-rw-r--r--
ndb_rpl_mixed_tables-slave.opt
61
B
-rw-r--r--
ndb_rpl_mixed_tables.test
8.35
KB
-rw-r--r--
ndb_rpl_multi.test
2.93
KB
-rw-r--r--
ndb_rpl_multi_binlog_update.cn...
1.83
KB
-rw-r--r--
ndb_rpl_multi_binlog_update.in...
6.78
KB
-rw-r--r--
ndb_rpl_multi_engine2.inc
2.56
KB
-rw-r--r--
ndb_rpl_multi_update2-slave.op...
42
B
-rw-r--r--
ndb_rpl_myisam2ndb-slave.opt
42
B
-rw-r--r--
ndb_rpl_myisam2ndb.test
890
B
-rw-r--r--
ndb_rpl_ndbapi-examples.test
996
B
-rw-r--r--
ndb_rpl_rep_error.test
14.2
KB
-rw-r--r--
ndb_rpl_rep_ignore-slave.opt
63
B
-rw-r--r--
ndb_rpl_rep_ignore.test
1.78
KB
-rw-r--r--
ndb_rpl_skip_gap_event-slave.o...
24
B
-rw-r--r--
ndb_rpl_skip_gap_event.test
2.39
KB
-rw-r--r--
ndb_rpl_slave_binlog_index.tes...
2.82
KB
-rw-r--r--
ndb_rpl_slave_conflict_role_va...
4.94
KB
-rw-r--r--
ndb_rpl_slave_lsu.cnf
57
B
-rw-r--r--
ndb_rpl_slave_lsu.test
5.87
KB
-rw-r--r--
ndb_rpl_slave_lsu_anyval.cnf
176
B
-rw-r--r--
ndb_rpl_slave_lsu_anyval.test
2.46
KB
-rw-r--r--
ndb_rpl_slave_replay.test
14.63
KB
-rw-r--r--
ndb_rpl_slave_restart.test
3.3
KB
-rw-r--r--
ndb_rpl_stm_innodb-master.opt
32
B
-rw-r--r--
ndb_rpl_stm_innodb.test
622
B
-rw-r--r--
ndb_rpl_sync.test
3.19
KB
-rw-r--r--
ndb_rpl_ui.test
2.29
KB
-rw-r--r--
ndb_rpl_ui2.test
957
B
-rw-r--r--
ndb_rpl_ui3.test
1.5
KB
-rw-r--r--
ndb_rpl_xxx_innodb.inc
6.25
KB
-rw-r--r--
ndb_slave_exec_info_init.inc
704
B
-rw-r--r--
ndb_sync_primary_to_secondary....
215
B
-rw-r--r--
ndb_sync_secondary_to_primary....
215
B
-rw-r--r--
ndb_trans_conflict_info.inc
1.71
KB
-rw-r--r--
ndb_trans_conflict_info_init.i...
1.5
KB
-rw-r--r--
ndb_trans_conflict_info_stable...
2.28
KB
-rw-r--r--
ndb_wait_for_zero_commit_ack_m...
569
B
-rw-r--r--
rpl_truncate_7ndb.test
1.78
KB
-rw-r--r--
rpl_truncate_7ndb_2.test
593
B
-rw-r--r--
select_ndb_apply_status.inc
505
B
-rw-r--r--
show_binlog_using_logname.inc
968
B
-rw-r--r--
show_mysqld_warnings.inc
780
B
-rw-r--r--
show_slave_max_replicated_epoc...
380
B
-rw-r--r--
wait_schema_logging.inc
2.33
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ndb_rpl_conflict_epoch_trans.inc
# # Test engine native conflict resolution for ndb # NDB$EPOCH[2]_TRANS() function # # --source include/have_ndb.inc --source include/have_binlog_format_mixed_or_row.inc --source suite/ndb_rpl/ndb_master-slave.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --echo Setup circular replication --disable_query_log --disable_result_log --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc RESET MASTER; STOP SLAVE; select @secondary_server_id:=(variable_value+0) from information_schema.global_variables where variable_name like 'server_id'; let $SECONDARY_SERVER_ID= query_get_value('select @secondary_server_id as v',v,1); select @secondary_port:=(variable_value+0) from information_schema.global_variables where variable_name like 'port'; let $SECONDARY_PORT= query_get_value('select @secondary_port as v',v,1); --source suite/ndb_rpl/t/ndb_connect_to_primary.inc RESET MASTER; STOP SLAVE; --eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$SECONDARY_PORT,master_user="root" START SLAVE; select @primary_server_id:=(variable_value+0) from information_schema.global_variables where variable_name like 'server_id'; let $PRIMARY_SERVER_ID= query_get_value('select @primary_server_id as v',v,1); select @primary_port:=(variable_value+0) from information_schema.global_variables where variable_name like 'port'; let $PRIMARY_PORT= query_get_value('select @primary_port as v',v,1); --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$PRIMARY_PORT,master_user="root" START SLAVE; --enable_result_log --enable_query_log --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Setup ndb_replication and t1$EX exceptions table --disable_warnings --disable_query_log --source suite/ndb_rpl/t/ndb_connect_to_primary.inc drop table if exists mysql.ndb_replication; CREATE TABLE mysql.ndb_replication (db VARBINARY(63), table_name VARBINARY(63), server_id INT UNSIGNED, binlog_type INT UNSIGNED, conflict_fn VARBINARY(128), PRIMARY KEY USING HASH (db,table_name,server_id)) ENGINE=NDB PARTITION BY KEY(db,table_name); --enable_warnings --enable_query_log if (!$PRIMARY_CONFLICT_ALG) { let $PRIMARY_CONFLICT_ALG=\"NDB\$EPOCH_TRANS()\"; } if (!$SECONDARY_CONFLICT_ALG) { let $SECONDARY_CONFLICT_ALG=NULL; } --echo Populate ndb_replication table as necessary eval replace into mysql.ndb_replication values ("test", "t1", $SECONDARY_SERVER_ID, 7, $SECONDARY_CONFLICT_ALG), ("test", "t1", $PRIMARY_SERVER_ID, 7, $PRIMARY_CONFLICT_ALG); eval replace into mysql.ndb_replication values ("test", "t2", $SECONDARY_SERVER_ID, 7, $SECONDARY_CONFLICT_ALG), ("test", "t2", $PRIMARY_SERVER_ID, 7, $PRIMARY_CONFLICT_ALG); create table test.t1 ( a int primary key, b varchar(2000)) engine=ndb; create table test.t2 ( a int primary key, b varchar(2000)) engine=ndb; --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Add some data insert into test.t1 values (1, "Initial data 1"), (2, "Initial data 2"), (3, "Initial data 3"), (4, "Initial data 4"), (5, "Initial data 5"), (6, "Initial data 6"), (7, "Initial data 7"), (8, "Initial data 8"), (9, "Initial data 9"), (10, "Initial data 10"); --echo Show basic row-level conflict detection --echo --------------------------------------- --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update t1 set b="Primary first change 2" where a=2; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc update t1 set b="Secondary first change 2" where a=2; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Primary should have rejected change from Secondary, keeping its value select * from t1 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Secondary should have been realigned to Primary select * from t1 order by a; --echo Show rollback of whole secondary transaction --echo -------------------------------------------- --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update t1 set b="Primary second change 4" where a=4; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc begin; update t1 set b="Secondary second change 4" where a=4; update t1 set b="Secondary second change 5" where a=5; commit; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Primary should have rejected secondary changes on both rows select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Secondary should have been realigned to Primary select * from test.t1 order by a; --echo Show rollback of dependent transaction as well --echo ---------------------------------------------- --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update t1 set b="Primary third change 1" where a=1; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc begin; update t1 set b="Secondary third change 3" where a=3; update t1 set b="Secondary third change 1" where a=1; # Conflict here commit; begin; update t1 set b="Secondary fourth change 3" where a=3; # Dependency on conflict here insert into t1 values (11,"Secondary fourth change 11"); commit; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Primary should have rejected all secondary changes select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info_stable.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Secondary should have been realigned to Primary select * from test.t1 order by a; --echo Show rollback of dependent transaction across different tables --echo -------------------------------------------------------------- --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update t1 set b="Primary fifth change 6" where a=6; select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc begin; update t1 set b="Secondary fifth change 6" where a=6; # Conflict row insert into t2 values (1, "Secondary fifth change 1"); insert into t2 values (2, "Secondary fifth change 2"); commit; begin; update t2 set b="Secondary sixth change 1" where a=2; # Dependent row insert into t2 values (3, "Secondary sixth change 2"); commit; select * from test.t1 order by a; select * from test.t2 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Primary should have rejected all secondary changes select * from test.t1 order by a; select * from test.t2 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info_stable.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Secondary should have been realigned to primary select * from test.t1 order by a; select * from test.t2 order by a; --echo Show that whole epoch is not rolled back --echo ---------------------------------------- # Whole epoch is rolled back when --ndb-serverid-transid-bits is 0! --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update t1 set b="Primary is king" where a=10; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc begin; update t1 set b="Secondary is emperor" where a=10; insert into t1 values (11, "Secondary is pleni-potentiary"); commit; begin; insert into t1 values (12, "Secondary ruled once"); insert into t1 values (13, "This history will not be lost"); insert into t1 values (14, "Look on my works ye mighty, and despair"); commit; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Primary should have rejected conflicting trans (emperor, pleni-potentiary) --echo but accepted unrelated trans (history) select * from t1 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Secondary should be aligned with Primary select * from t1 order by a; --echo Show that non-conflicting ancestors are not implicated --echo ------------------------------------------------------ --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update t1 set b="7 : Primary is king" where a=7; --echo Primary state select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc # 'Innocent' secondary transaction begin; update t1 set b="8 : Secondary innocent" where a=8; update t1 set b="9 : Secondary innocent" where a=9; commit; --echo Secondary with innocent select * from test.t1 order by a; # 'Guilty secondary transaction, affecting one of the same rows as innocent begin; update t1 set b="9 : Secondary guilty" where a=9; # Dependency on innocent update t1 set b="7 : Secondary guilty" where a=7; # Conflict row commit; --echo Secondary with guilty overlaid select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Primary cluster should have rejected 'guilty' secondary transaction, but --echo accepted 'innocent' secondary transaction. select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Secondary cluster should be realigned with Primary select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Classic banking example --echo ----------------------- eval replace into mysql.ndb_replication values ("test", "balances", $SECONDARY_SERVER_ID, 7, $SECONDARY_CONFLICT_ALG), ("test", "balances", $PRIMARY_SERVER_ID, 7, $PRIMARY_CONFLICT_ALG); # Transactions table may not need conflict-detection? eval replace into mysql.ndb_replication values ("test", "transactions", $SECONDARY_SERVER_ID, 7, $SECONDARY_CONFLICT_ALG), ("test", "transactions", $PRIMARY_SERVER_ID, 7, $PRIMARY_CONFLICT_ALG); create table test.balances (name varchar(100) primary key, balance int) engine=ndb; if (!$extended_exceptions_table) { create table test.transactions$EX (server_id int unsigned, master_server_id int unsigned, master_epoch bigint unsigned, count int unsigned, auto_key int not null, from_name varchar(100) not null, to_name varchar(100) not null, detail varchar(100) not null, primary key(server_id, master_server_id, master_epoch, count)) engine=ndb; } if ($extended_exceptions_table) { create table test.transactions$EX (ndb$server_id int unsigned, ndb$master_server_id int unsigned, ndb$master_epoch bigint unsigned, ndb$count int unsigned, auto_key int not null, from_name varchar(100) not null, to_name varchar(100) not null, detail varchar(100) not null, amount$old int, amount$new int, ndb$op_type enum('write_row','update_row', 'delete_row') not null, ndb$cft_cause enum('row_does_not_exist','row_already_exists','data_in_conflict','trans_in_conflict') not null, ndb$orig_transid bigint unsigned not null, primary key(ndb$server_id, ndb$master_server_id, ndb$master_epoch, ndb$count)) engine=ndb; } create table test.transactions (auto_key int auto_increment, from_name varchar(100), to_name varchar(100), detail varchar(100), amount int, primary key(auto_key, from_name, to_name, detail)) engine=ndb; --echo Initialise balances across both bank sites insert into test.balances values ("Larry", 100), ("Employee-1", 0), ("Employee-2", 0), ("Yacht dealer", 0), ("Newsagent", 0); --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc # Sync back to master, to ensure that what follows on slave, # is in a separate epoch transaction. # This is needed to get stable counts, not for correctness # FLUSH LOGS; # To give a position to sync --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Bank sites are disconnected --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Larry buys a yacht using Primary bank site begin; insert into test.transactions (from_name, to_name, detail, amount) values ("Larry", "Yacht dealer", "Yacht purchase", 50); update test.balances set balance = balance - 50 where name = "Larry"; update test.balances set balance = balance + 50 where name = "Yacht dealer"; commit; --echo Show yacht transaction records select * from test.transactions order by auto_key; select * from test.balances order by name; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Larry pays employees using Secondary bank site begin; insert into test.transactions (from_name, to_name, detail, amount) values ("Larry", "Employee-1", "Payment to Employee-1", 1); update test.balances set balance = balance - 1 where name = "Larry"; update test.balances set balance = balance + 1 where name = "Employee-1"; commit; begin; insert into test.transactions (from_name, to_name, detail, amount) values ("Larry", "Employee-2", "Payment to Employee-2", 1); update test.balances set balance = balance - 1 where name = "Larry"; update test.balances set balance = balance + 1 where name = "Employee-2"; commit; --echo Employee-2 buys yacht magazine using Secondary bank site begin; insert into test.transactions (from_name, to_name, detail, amount) values ("Employee-2", "Newsagent", "Buy yacht magazine", 1); update test.balances set balance = balance - 1 where name = "Employee-2"; update test.balances set balance = balance + 1 where name = "Newsagent"; commit; --echo Show employee transactions select * from test.transactions order by auto_key; select * from test.balances order by name; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Bank sites re-connected start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Records at Primary bank site select * from test.transactions order by auto_key; select * from test.balances order by name; --echo Exceptions at Primary bank site # Note count not included here as it's non-deterministic # (CompletedOperations list order related to actual completion order related to # universal randomness) if (!$extended_exceptions_table) { select server_id, master_server_id, auto_key, from_name, to_name, detail from test.transactions$EX order by auto_key, from_name, to_name, detail; } if ($extended_exceptions_table) { select ndb$server_id, ndb$master_server_id, auto_key, from_name, to_name, detail amount$old, amount$new, ndb$op_type, ndb$cft_cause from test.transactions$EX order by ndb$orig_transid, ndb$count; } --echo Conflict handling activity at Primary bank site --echo Expect : --echo 1 conflict from slave T1 on Larry's balance --echo 1 conflict from slave T2 on Larry's balance --echo =2 row conflicts --echo --echo 3 (user) transactions rejected --echo 9 rows rejected (3 per transaction) --echo Variability : # epoch transactions, # row conflicts detected --echo 1-3 2-3 --echo # detect_iter_count --echo 1-3 --echo We only check stable values --source suite/ndb_rpl/t/ndb_trans_conflict_info_stable.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Records at Secondary bank site select * from test.transactions order by auto_key; select * from test.balances order by name; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc drop table test.balances; drop table test.transactions; drop table test.transactions$EX; --echo Test mixing transactional and non transactional --echo ----------------------------------------------- --echo Remove old data from t1 --source suite/ndb_rpl/t/ndb_connect_to_primary.inc delete from test.t1; --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Define table with row-based epoch detection eval replace into mysql.ndb_replication values ("test", "t3", $SECONDARY_SERVER_ID, 7, NULL), ("test", "t3", $PRIMARY_SERVER_ID, 7, 'NDB\$EPOCH()'); create table t3 (a int primary key, b int) engine=ndb; create table t4 (a int primary key, b int) engine=ndb; create table t5 (a int primary key, b longtext) engine=ndb; --echo Insert some data insert into test.t1 values (1,1), (2,2), (3,3), (4,4), (5,5), (6,6); insert into test.t3 values (11,11), (12,12), (13,13), (14,14), (15,15), (16,16); insert into test.t4 values (21,21), (22,22), (23,23), (24,24), (25,25), (26,26); insert into test.t5 values (1, REPEAT("B", 10000)), (2, REPEAT("E", 10000)), (3, REPEAT("A", 10000)); --echo Allow to propagate --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc FLUSH LOGS; # Ensure Inserts are in previous epoch trans to what follows --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --echo Case 1 : Transactional detection affects row - based entries in same trans --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update test.t1 set b=100 where a=1; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc # t3 is in a table without trans conflict detection (but with row based) # t4 is in a table without any detection # t1 is in a table with trans conflict detection begin; update test.t3 set b=1100 where a=11; update test.t4 set b=2100 where a=21; update test.t1 set b=1000 where a=1; commit; --echo Show slave transaction effect select * from test.t1 order by a; select * from test.t3 order by a; select * from test.t4 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Expect Primary to have rejected whole trans across 3 tables select * from test.t1 order by a; select * from test.t3 order by a; select * from test.t4 order by a; --echo Expect 1 transaction rejected, 3 rows rejected --echo 1 conflict row, 1 epoch, 1 iteration --source suite/ndb_rpl/t/ndb_trans_conflict_info.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --echo Now restart rep to Secondary, and check realignment --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc select * from test.t1 order by a; select * from test.t3 order by a; select * from test.t4 order by a; --echo Case 2 : Row based detection does not affect other transaction entries --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc update test.t3 set b=1200 where a=12; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc # Transaction conflicts with master, on table without transactional # conflict detection # Conflict will be detected on row, but no other transaction state # will be reverted # begin; update test.t3 set b=1201 where a=12; update test.t4 set b=2200 where a=22; update test.t1 set b=2000 where a=2; commit; --echo Show effect of transaction on Secondary select * from test.t1 order by a; select * from test.t3 order by a; select * from test.t4 order by a; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Show effect of transaction on Primary --echo Only t3 should have been reverted select * from test.t1 order by a; select * from test.t3 order by a; select * from test.t4 order by a; --echo Expect all counters to be zero --source suite/ndb_rpl/t/ndb_trans_conflict_info.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --echo Show effect of transaction on Secondary --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc select * from test.t1 order by a; select * from test.t3 order by a; select * from test.t4 order by a; flush logs; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Case 3 : Check behaviour where table with Blob is implicated --echo in transactional conflict. Should result in Slave --echo stopping with an error. --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc STOP SLAVE; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Setup warning suppression --disable_query_log call mtr.add_suppression("Transaction conflict handling on table t5 failed as table has Blobs which cannot be refreshed"); call mtr.add_suppression("NDBCLUSTER Error_code: 1296"); --enable_query_log begin; update t1 set b= 11 where a=1; commit; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc begin; update t1 set b= 111 where a=1; # Conflict update t1 set b= 222 where a=2; # Implicated row update t5 set b= REPEAT("T", 10000) where a=3; # ImplicatedBlob update commit; --echo Show effect of transaction on Secondary select * from test.t1 order by a; select left(b,1), length(b) from test.t5 order by a; --echo Check that Primary Slave has stopped --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --let $slave_sql_errno=1296 --source include/wait_for_slave_sql_error.inc #SHOW SLAVE STATUS; --echo Restart Primary Slave set global sql_slave_skip_counter=1; START SLAVE; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo Restart Secondary Slave START SLAVE; flush logs; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc drop table test.t3; drop table test.t4; drop table test.t5; --echo Fix misalignment caused above --echo Makes following result sets look nicer update test.t1 set b=2 where a=2; --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo Show a simple row-level delete-delete conflict --echo PRIMARY: insert into test.t1 values (77, "A good year"); select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_trans_conflict_info_init.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo SECONDARY: stop slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo PRIMARY: --echo Primary Delete delete from test.t1 where a=77; --echo Show Primary contents select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo SECONDARY: select * from test.t1 order by a; --echo Secondary Delete->Insert in separate transactions --echo and potentially different epochs --echo Delete part with related transaction op begin; delete from test.t1 where a=77; insert into test.t1 values (73, "A superb year"); commit; --echo Unrelated transaction from Secondary begin; insert into test.t1 values (84, "A good vintage"); commit; # Optionally flush logs here to mix separate-epoch and # same-epoch --echo Optionally flush logs let $do_flush=query_get_value(SELECT (RAND() * 10) > 5 AS y, y, 1); if ($do_flush) { --disable_query_log --disable_result_log FLUSH LOGS; --enable_query_log --enable_result_log } --echo Following Insert from Secondary - potentially in different epoch begin; insert into test.t1 values (77, "Exceptional"); insert into test.t1 values (80, "Poor"); commit; --echo Show Secondary contents select * from test.t1 order by a; --echo Allow propagation to Primary --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --echo PRIMARY: --echo Expect: --echo - Delete-Delete conflict did not result in rejection of Secondary transaction --echo Therefore related row from Secondary Deleting transaction (73) is present --echo - Unrelated transaction from Secondary (84) is present --echo - Following insert on delete-delete conflict row (77) is not in conflict, --echo so both it and the related row from the same transaction (80) are present --echo select * from test.t1 order by a; --source suite/ndb_rpl/t/ndb_trans_conflict_info_stable.inc --echo Now sync with Secondary to show outcomes --echo NDB\$EPOCH_TRANS will have divergence as the Primary delete of --echo row 77 took out the newly inserted row 77. --echo NDB\$EPOCH2_TRANS will have no divergence as the Secondary insert --echo is reflected after the Primary delete, and re-inserts the value. --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc start slave; --source suite/ndb_rpl/t/ndb_connect_to_primary.inc --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc --echo SECONDARY: --echo select * from test.t1 order by a; # Cleanup --source suite/ndb_rpl/t/ndb_connect_to_primary.inc drop table mysql.ndb_replication; drop table test.t1; drop table test.t2; --source suite/ndb_rpl/t/ndb_sync_primary_to_secondary.inc --source suite/ndb_rpl/t/ndb_connect_to_secondary.inc flush logs; --source suite/ndb_rpl/t/ndb_sync_secondary_to_primary.inc --connection master stop slave; reset slave; #change master to master_host=''; --source include/rpl_end.inc # TODO # More complex dependencies
Close