| 1 |
|
| 2 |
############################################################ |
| 3 |
# 0. Start GR on two servers |
| 4 |
############################################################ |
| 5 |
include/group_replication.inc |
| 6 |
Warnings: |
| 7 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 8 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 9 |
[connection server1] |
| 10 |
|
| 11 |
##################################################################### |
| 12 |
# 1. With both members ONLINE. Execute some transactions on server1. |
| 13 |
##################################################################### |
| 14 |
[connection server1] |
| 15 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 16 |
INSERT INTO t1 VALUES (1); |
| 17 |
include/rpl_sync.inc |
| 18 |
[connection server1] |
| 19 |
[connection server2] |
| 20 |
[connection server1] |
| 21 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 0 on server 1'] |
| 22 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 4 on server 2'] |
| 23 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 2 on server 1'] |
| 24 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 0 on server 2'] |
| 25 |
[connection server2] |
| 26 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 0 on server 1'] |
| 27 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 4 on server 2'] |
| 28 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 2 on server 1'] |
| 29 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 0 on server 2'] |
| 30 |
|
| 31 |
##################################################################### |
| 32 |
# 2. Testing of column COUNT_TRANSACTIONS_LOCAL_ROLLBACK. |
| 33 |
##################################################################### |
| 34 |
[connection server1] |
| 35 |
SET @debug_save= @@GLOBAL.DEBUG; |
| 36 |
SET @@GLOBAL.DEBUG= '+d,certifier_force_1_negative_certification'; |
| 37 |
[connection server2] |
| 38 |
SET @debug_save= @@GLOBAL.DEBUG; |
| 39 |
SET @@GLOBAL.DEBUG= '+d,certifier_force_1_negative_certification'; |
| 40 |
[connection server1] |
| 41 |
INSERT INTO t1 VALUES (2); |
| 42 |
ERROR 40000: Plugin instructed the server to rollback the current transaction. |
| 43 |
INSERT INTO t1 VALUES (3); |
| 44 |
include/rpl_sync.inc |
| 45 |
[connection server1] |
| 46 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 0 on server 1'] |
| 47 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 5 on server 2'] |
| 48 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 4 on server 1'] |
| 49 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 0 on server 2'] |
| 50 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 1 on server 1'] |
| 51 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 0 on server 2'] |
| 52 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 1'] |
| 53 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 2'] |
| 54 |
[connection server2] |
| 55 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 0 on server 1'] |
| 56 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 5 on server 2'] |
| 57 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 4 on server 1'] |
| 58 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 0 on server 2'] |
| 59 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 1 on server 1'] |
| 60 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 0 on server 2'] |
| 61 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 1'] |
| 62 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 2'] |
| 63 |
|
| 64 |
##################################################################### |
| 65 |
# 3. Testing of column COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE. |
| 66 |
##################################################################### |
| 67 |
[connection server1] |
| 68 |
SET @@GLOBAL.DEBUG='+d,block_applier_updates'; |
| 69 |
[connection server2] |
| 70 |
[connection server1] |
| 71 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 10 on server 1'] |
| 72 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 0 on server 2'] |
| 73 |
[connection server2] |
| 74 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 10 on server 1'] |
| 75 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 0 on server 2'] |
| 76 |
[connection server1] |
| 77 |
SET DEBUG_SYNC = "now WAIT_FOR applier_read_blocked"; |
| 78 |
SET @@GLOBAL.DEBUG='-d,block_applier_updates'; |
| 79 |
SET DEBUG_SYNC = "now SIGNAL resume_applier_read"; |
| 80 |
[connection server2] |
| 81 |
include/rpl_sync.inc |
| 82 |
[connection server1] |
| 83 |
SET DEBUG_SYNC= 'RESET'; |
| 84 |
|
| 85 |
##################################################################### |
| 86 |
# 4. Assert values are correct in table replication_group_member_stats. |
| 87 |
##################################################################### |
| 88 |
[connection server1] |
| 89 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 0 on server 1'] |
| 90 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 0 on server 2'] |
| 91 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 10 on server 1'] |
| 92 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 5 on server 2'] |
| 93 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 4 on server 1'] |
| 94 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 10 on server 2'] |
| 95 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 1 on server 1'] |
| 96 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 0 on server 2'] |
| 97 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 1'] |
| 98 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 2'] |
| 99 |
[connection server2] |
| 100 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 0 on server 1'] |
| 101 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE should be 0 on server 2'] |
| 102 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 10 on server 1'] |
| 103 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_REMOTE_APPLIED should be 5 on server 2'] |
| 104 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 4 on server 1'] |
| 105 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_PROPOSED should be 10 on server 2'] |
| 106 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 1 on server 1'] |
| 107 |
include/assert.inc ['The value of COUNT_TRANSACTIONS_LOCAL_ROLLBACK should be 0 on server 2'] |
| 108 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 1'] |
| 109 |
include/assert.inc ['The value of COUNT_CONFLICTS_DETECTED should be 1 on server 2'] |
| 110 |
[connection server1] |
| 111 |
include/diff_tables.inc [server1:performance_schema.replication_group_member_stats, server2:performance_schema.replication_group_member_stats] |
| 112 |
|
| 113 |
##################################################################### |
| 114 |
# 5. Clean up(debug flag and tables). |
| 115 |
##################################################################### |
| 116 |
[connection server1] |
| 117 |
SET @@GLOBAL.DEBUG= @debug_saved; |
| 118 |
[connection server2] |
| 119 |
SET @@GLOBAL.DEBUG= @debug_saved; |
| 120 |
[connection server1] |
| 121 |
DROP TABLE t1; |
| 122 |
include/group_replication_end.inc |