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