| 1 |
--echo Testing NDB$EPOCH2 algorithm |
| 2 |
--echo NDB$EPOCH2 is almost the same as NDB$EPOCH, except that: |
| 3 |
--echo - The Primary / Secondary roles are controlled by a server variable |
| 4 |
--echo - Secondary I/U/D ops are 'reflected' back to the Secondary to handle |
| 5 |
--echo the delete vs delete limitations of NDB$EPOCH |
| 6 |
--echo |
| 7 |
--echo This testcase provides some regression coverage w.r.t. NDB$EPOCH, by |
| 8 |
--echo running many of the same tests on NDB$EPOCH2, but also switching |
| 9 |
--echo the cluster roles. |
| 10 |
--echo The main result differences w.r.t ndb_rpl_conflict_epoch.result are : |
| 11 |
--echo - Result file has 2 passes for different roles |
| 12 |
--echo - Master and Local server ids swapped in second run |
| 13 |
--echo - Delete-Delete-Insert (case 8) shows no divergence |
| 14 |
--echo |
| 15 |
|
| 16 |
--echo Prior to including the generic NDB$EPOCH test files, we setup the |
| 17 |
--echo conflict role variables |
| 18 |
|
| 19 |
#let $rpl_debug=1; |
| 20 |
|
| 21 |
let $clusterA_port=$MASTER_MYPORT; |
| 22 |
let $clusterB_port=$SLAVE_MYPORT; |
| 23 |
|
| 24 |
#let $clusterA_port=$SLAVE_MYPORT; |
| 25 |
#let $clusterB_port=$MASTER_MYPORT; |
| 26 |
#let $SWITCH_CLUSTER_ROLES=1; |
| 27 |
|
| 28 |
#echo $clusterA_port; |
| 29 |
#echo $clusterB_port; |
| 30 |
|
| 31 |
--echo Setup connections for use in this file |
| 32 |
--connect(clusterA,127.0.0.1,root,,test,$clusterA_port,) |
| 33 |
--connect(clusterB,127.0.0.1,root,,test,$clusterB_port,) |
| 34 |
|
| 35 |
--echo First we have Cluster A as Primary, Cluster B as Secondary |
| 36 |
--connection clusterA |
| 37 |
#SHOW VARIABLES LIKE '%server%'; |
| 38 |
SET GLOBAL ndb_applier_conflict_role="PRIMARY"; |
| 39 |
|
| 40 |
--connection clusterB |
| 41 |
#SHOW VARIABLES LIKE '%server%'; |
| 42 |
SET GLOBAL ndb_applier_conflict_role="SECONDARY"; |
| 43 |
|
| 44 |
--connection clusterA |
| 45 |
|
| 46 |
let $CONFLICT_ALG=NDB\$EPOCH2; |
| 47 |
let $SECONDARY_CONFLICT_ALG=\"NDB\$EPOCH2()\"; |
| 48 |
|
| 49 |
--source suite/ndb_rpl/t/ndb_rpl_conflict_epoch.inc |
| 50 |
|
| 51 |
--echo Next we have Cluster A as Secondary, Cluster B as Primary |
| 52 |
--connection clusterA |
| 53 |
SET GLOBAL ndb_applier_conflict_role="NONE"; |
| 54 |
SET GLOBAL ndb_applier_conflict_role="SECONDARY"; |
| 55 |
|
| 56 |
--connection clusterB |
| 57 |
SET GLOBAL ndb_applier_conflict_role="NONE"; |
| 58 |
SET GLOBAL ndb_applier_conflict_role="PRIMARY"; |
| 59 |
|
| 60 |
--echo We set a special control var to allow the generic scripts |
| 61 |
--echo to handle this topology |
| 62 |
let $SWITCH_CLUSTER_ROLES=1; |
| 63 |
|
| 64 |
--echo Remove some connections which can't be setup twice (ugly) |
| 65 |
--disconnect master |
| 66 |
--disconnect master1 |
| 67 |
--disconnect slave |
| 68 |
--disconnect slave1 |
| 69 |
|
| 70 |
--source suite/ndb_rpl/t/ndb_rpl_conflict_epoch.inc |
| 71 |
|
| 72 |
# TODO : Switch back to A Primary, B Secondary? |
| 73 |
|
| 74 |
--connection clusterA |
| 75 |
SET GLOBAL ndb_applier_conflict_role="NONE"; |
| 76 |
|
| 77 |
--connection clusterB |
| 78 |
SET GLOBAL ndb_applier_conflict_role="NONE"; |
| 79 |
|