| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
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. |
| 5 |
[connection master] |
| 6 |
# Adding debug point 'dbug.mta.force_clock_diff_eq_0' to @@GLOBAL.debug |
| 7 |
SET @save_replica_parallel_type = @@GLOBAL.replica_parallel_type; |
| 8 |
Warnings: |
| 9 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 10 |
SET @save.replica_parallel_workers= @@global.replica_parallel_workers; |
| 11 |
SET @save_replica_transaction_retries= @@global.replica_transaction_retries; |
| 12 |
SET @save_replica_preserve_commit_order= @@global.replica_preserve_commit_order; |
| 13 |
# Test for PARALLEL_DATABASE |
| 14 |
SET GLOBAL replica_parallel_type = 'DATABASE'; |
| 15 |
Warnings: |
| 16 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 17 |
SET @@global.replica_parallel_workers= 4; |
| 18 |
SET @@global.replica_preserve_commit_order=0; |
| 19 |
include/start_slave.inc |
| 20 |
# Scenario 1: With two workers, check if Seconds_Behind_Master is |
| 21 |
# calculated correctly when all the workers are waiting. |
| 22 |
CREATE TABLE t1 (f1 INT); |
| 23 |
CREATE DATABASE test2; |
| 24 |
USE test2; |
| 25 |
CREATE TABLE t2 (f1 INT); |
| 26 |
include/sync_slave_sql_with_master.inc |
| 27 |
LOCK TABLE test.t1 WRITE; |
| 28 |
LOCK TABLE test2.t2 WRITE; |
| 29 |
USE test; |
| 30 |
INSERT INTO t1 VALUES (1); |
| 31 |
USE test2; |
| 32 |
INSERT INTO t2 VALUES (1); |
| 33 |
include/sync_slave_io_with_master.inc |
| 34 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 35 |
SET DEBUG_SYNC="RESET"; |
| 36 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 37 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 38 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 39 |
include/assert.inc [Seconds_Behind_Master must be between 5 and upper_bound] |
| 40 |
UNLOCK TABLES; |
| 41 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 42 |
SET DEBUG_SYNC="RESET"; |
| 43 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 44 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 45 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 46 |
include/assert.inc [Seconds_Behind_Master must be between 2 and upper_bound] |
| 47 |
UNLOCK TABLES; |
| 48 |
include/sync_slave_sql_with_master.inc |
| 49 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 50 |
SET DEBUG_SYNC="RESET"; |
| 51 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 52 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 53 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 54 |
include/assert.inc [Seconds_Behind_Master must be 0] |
| 55 |
# Scenario 2: With two workers, check if Seconds_Behind_Master is |
| 56 |
# calculated correctly when first worker compeletes first. |
| 57 |
LOCK TABLE test2.t2 WRITE; |
| 58 |
USE test; |
| 59 |
INSERT INTO t1 VALUES (1); |
| 60 |
USE test2; |
| 61 |
INSERT INTO t2 VALUES (1); |
| 62 |
include/sync_slave_io_with_master.inc |
| 63 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 64 |
SET DEBUG_SYNC="RESET"; |
| 65 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 66 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 67 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 68 |
include/assert.inc [Seconds_Behind_Master must be between 2 and upper_bound] |
| 69 |
UNLOCK TABLES; |
| 70 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 71 |
SET DEBUG_SYNC="RESET"; |
| 72 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 73 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 74 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 75 |
include/assert.inc [Seconds_Behind_Master must be 0] |
| 76 |
# Scenario 3: With three workers, check if Seconds_Behind_Master is |
| 77 |
# calculated correctly when second worker completes first. |
| 78 |
CREATE DATABASE test3; |
| 79 |
USE test3; |
| 80 |
CREATE TABLE t3 (f1 INT); |
| 81 |
include/sync_slave_sql_with_master.inc |
| 82 |
LOCK TABLE test.t1 WRITE; |
| 83 |
LOCK TABLE test3.t3 WRITE; |
| 84 |
USE test; |
| 85 |
INSERT INTO t1 VALUES (1); |
| 86 |
use test2; |
| 87 |
INSERT INTO t2 VALUES (1); |
| 88 |
USE test3; |
| 89 |
INSERT INTO t3 VALUES (1); |
| 90 |
include/sync_slave_io_with_master.inc |
| 91 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 92 |
SET DEBUG_SYNC="RESET"; |
| 93 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 94 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 95 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 96 |
include/assert.inc [Seconds_Behind_Master must be between 7 and upper_bound] |
| 97 |
UNLOCK TABLES; |
| 98 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 99 |
SET DEBUG_SYNC="RESET"; |
| 100 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 101 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 102 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 103 |
include/assert.inc [Seconds_Behind_Master must be between 2 and upper_bound] |
| 104 |
UNLOCK TABLES; |
| 105 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 106 |
SET DEBUG_SYNC="RESET"; |
| 107 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 108 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 109 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 110 |
include/assert.inc [Seconds_Behind_Master must be 0] |
| 111 |
DROP TABLE test.t1; |
| 112 |
DROP DATABASE test2; |
| 113 |
DROP DATABASE test3; |
| 114 |
include/sync_slave_sql_with_master.inc |
| 115 |
include/stop_slave.inc |
| 116 |
# Test for LOGICAL_CLOCK |
| 117 |
SET GLOBAL replica_parallel_type = 'LOGICAL_CLOCK'; |
| 118 |
Warnings: |
| 119 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 120 |
SET GLOBAL replica_parallel_workers = 3; |
| 121 |
SET GLOBAL replica_preserve_commit_order=1; |
| 122 |
include/start_slave.inc |
| 123 |
# Scenario 1: With two workers, check if Seconds_Behind_Master is |
| 124 |
# calculated correctly when two statements are applied in parallel on |
| 125 |
# one database and both the workers are blocked to to lock. |
| 126 |
USE test; |
| 127 |
CREATE TABLE t1 (a int); |
| 128 |
CREATE TABLE t2 (a int); |
| 129 |
INSERT INTO t1 SET a=1; |
| 130 |
include/sync_slave_sql_with_master.inc |
| 131 |
LOCK TABLE test.t1 WRITE, test.t2 WRITE; |
| 132 |
BEGIN; |
| 133 |
INSERT INTO t1 SET a=2; |
| 134 |
BEGIN; |
| 135 |
INSERT INTO t2 SET a=4; |
| 136 |
COMMIT; |
| 137 |
COMMIT; |
| 138 |
include/sync_slave_io_with_master.inc |
| 139 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 140 |
SET DEBUG_SYNC="RESET"; |
| 141 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 142 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 143 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 144 |
include/assert.inc [Seconds_Behind_Master must be between 3 and upper_bound] |
| 145 |
UNLOCK TABLES; |
| 146 |
include/sync_slave_sql_with_master.inc |
| 147 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 148 |
SET DEBUG_SYNC="RESET"; |
| 149 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 150 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 151 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 152 |
include/assert.inc [Seconds_Behind_Master must be 0] |
| 153 |
# Scenario 2: With two workers, check if Seconds_Behind_Master is |
| 154 |
# calculated correctly when the first worker is blocked. |
| 155 |
INSERT INTO t1 SET a=1; |
| 156 |
include/sync_slave_sql_with_master.inc |
| 157 |
LOCK TABLE test.t1 WRITE; |
| 158 |
LOCK TABLE test.t2 WRITE; |
| 159 |
BEGIN; |
| 160 |
INSERT INTO t1 SET a=2; |
| 161 |
BEGIN; |
| 162 |
INSERT INTO t2 SET a=3; |
| 163 |
COMMIT; |
| 164 |
COMMIT; |
| 165 |
include/sync_slave_io_with_master.inc |
| 166 |
UNLOCK TABLES; |
| 167 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 168 |
SET DEBUG_SYNC="RESET"; |
| 169 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 170 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 171 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 172 |
include/assert.inc [Seconds_Behind_Master must be between 2 and upper_bound] |
| 173 |
UNLOCK TABLES; |
| 174 |
include/sync_slave_sql_with_master.inc |
| 175 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 176 |
SET DEBUG_SYNC="RESET"; |
| 177 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 178 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 179 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 180 |
include/assert.inc [Seconds_Behind_Master must be 0] |
| 181 |
# Scenario 3: With three workers, check if Seconds_Behind_Master is |
| 182 |
# calculated correctly when two workers working on table from the same |
| 183 |
# database and 3rd worker working on another database. |
| 184 |
CREATE DATABASE second_test; |
| 185 |
CREATE TABLE second_test.t3 (f1 INT); |
| 186 |
INSERT INTO test.t1 SET a=1; |
| 187 |
LOCK TABLE test.t1 WRITE; |
| 188 |
LOCK TABLE test.t2 WRITE; |
| 189 |
LOCK TABLE second_test.t3 WRITE; |
| 190 |
BEGIN; |
| 191 |
INSERT INTO second_test.t3 VALUES (1); |
| 192 |
BEGIN; |
| 193 |
INSERT INTO test.t1 SET a=2; |
| 194 |
BEGIN; |
| 195 |
INSERT INTO test.t2 SET a=3; |
| 196 |
COMMIT; |
| 197 |
COMMIT; |
| 198 |
COMMIT; |
| 199 |
include/sync_slave_io_with_master.inc |
| 200 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 201 |
SET DEBUG_SYNC="RESET"; |
| 202 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 203 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 204 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 205 |
include/assert.inc [Seconds_Behind_Master must be between 2 and upper_bound] |
| 206 |
UNLOCK TABLES; |
| 207 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 208 |
SET DEBUG_SYNC="RESET"; |
| 209 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 210 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 211 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 212 |
include/assert.inc [Seconds_Behind_Master must be between 3 and upper_bound] |
| 213 |
UNLOCK TABLES; |
| 214 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 215 |
SET DEBUG_SYNC="RESET"; |
| 216 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 217 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 218 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 219 |
include/assert.inc [Seconds_Behind_Master must be between 4 and upper_bound] |
| 220 |
UNLOCK TABLE; |
| 221 |
# Adding debug point 'mta_checkpoint' to @@GLOBAL.debug |
| 222 |
SET DEBUG_SYNC="RESET"; |
| 223 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_start"; |
| 224 |
SET DEBUG_SYNC="now WAIT_FOR mta_checkpoint_end"; |
| 225 |
# Removing debug point 'mta_checkpoint' from @@GLOBAL.debug |
| 226 |
include/assert.inc [Seconds_Behind_Master must be 0] |
| 227 |
DROP TABLE test.t1; |
| 228 |
DROP TABLE test.t2; |
| 229 |
DROP DATABASE second_test; |
| 230 |
include/sync_slave_sql_with_master.inc |
| 231 |
include/stop_slave.inc |
| 232 |
# Removing debug point 'dbug.mta.force_clock_diff_eq_0' from @@GLOBAL.debug |
| 233 |
SET @@GLOBAL.replica_parallel_type= @save_replica_parallel_type; |
| 234 |
Warnings: |
| 235 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 236 |
SET @@global.replica_parallel_workers= @save.replica_parallel_workers; |
| 237 |
SET @@global.replica_transaction_retries= @save_replica_transaction_retries; |
| 238 |
SET @@global.replica_preserve_commit_order= @save_replica_preserve_commit_order; |
| 239 |
include/start_slave.inc |
| 240 |
include/rpl_end.inc |