| 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 |
[connection slave] |
| 7 |
include/gtid_utils.inc |
| 8 |
[connection master] |
| 9 |
|
| 10 |
# Setup |
| 11 |
|
| 12 |
[connection slave] |
| 13 |
CALL mtr.add_suppression("You need to use --log-bin to make --binlog-format work"); |
| 14 |
SET @save_replica_parallel_workers= @@global.replica_parallel_workers; |
| 15 |
SET @save_replica_parallel_type= @@global.replica_parallel_type; |
| 16 |
Warnings: |
| 17 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 18 |
SET @save_replica_preserve_commit_order= @@global.replica_preserve_commit_order; |
| 19 |
SET GLOBAL replica_parallel_type = 'LOGICAL_CLOCK'; |
| 20 |
Warnings: |
| 21 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 22 |
SET GLOBAL replica_parallel_workers= 8; |
| 23 |
SET GLOBAL replica_preserve_commit_order= ON; |
| 24 |
include/start_slave.inc |
| 25 |
[connection master] |
| 26 |
SET @save_binlog_transaction_dependency_tracking= @@global.binlog_transaction_dependency_tracking; |
| 27 |
Warnings: |
| 28 |
Warning 1287 '@@binlog_transaction_dependency_tracking' is deprecated and will be removed in a future release. |
| 29 |
SET @@global.binlog_transaction_dependency_tracking = COMMIT_ORDER; |
| 30 |
Warnings: |
| 31 |
Warning 1287 '@@binlog_transaction_dependency_tracking' is deprecated and will be removed in a future release. |
| 32 |
[connection master] |
| 33 |
CREATE TABLE t1(a INT PRIMARY KEY); CREATE TABLE t2 (i INTEGER) PARTITION BY RANGE(i) PARTITIONS 2 SUBPARTITION BY HASH(i) (PARTITION p0 VALUES LESS THAN(100) (SUBPARTITION sp00, SUBPARTITION sp01), PARTITION p1 VALUES LESS THAN(200) (SUBPARTITION sp10, SUBPARTITION sp11));; |
| 34 |
include/sync_slave_sql_with_master.inc |
| 35 |
|
| 36 |
# Block slave sql applier threads |
| 37 |
|
| 38 |
[connection slave] |
| 39 |
BEGIN; INSERT INTO t1 VALUES (1);; |
| 40 |
[connection slave] |
| 41 |
[connection slave] |
| 42 |
|
| 43 |
# Generate the transactions which can be applied in parallel on slave |
| 44 |
|
| 45 |
[connection master] |
| 46 |
# Adding debug point 'set_commit_parent_100' to @@GLOBAL.debug |
| 47 |
BEGIN; INSERT INTO t1 VALUES (1); COMMIT; BEGIN; INSERT INTO t1 VALUES (2); COMMIT; ALTER TABLE t2 ANALYZE PARTITION p0; BEGIN; INSERT INTO t1 VALUES (4); COMMIT;; |
| 48 |
Table Op Msg_type Msg_text |
| 49 |
test.t2 analyze status OK |
| 50 |
[connection server_1] |
| 51 |
BEGIN; INSERT INTO t1 VALUES (5); COMMIT; BEGIN; INSERT INTO t1 VALUES (6); COMMIT; BEGIN; INSERT INTO t1 VALUES (7); COMMIT;; |
| 52 |
# Removing debug point 'set_commit_parent_100' from @@GLOBAL.debug |
| 53 |
|
| 54 |
# Verify the transactions are ordered correctly on slave |
| 55 |
|
| 56 |
[connection server_2] |
| 57 |
include/assert.inc [Verify table t1 is empty] |
| 58 |
[connection slave] |
| 59 |
include/assert.inc [Exactly 0 GTIDs should have been committed since last invocation] |
| 60 |
|
| 61 |
# Rollback the first insert so that slave applier threads can |
| 62 |
# unblock and proceed. Verify the transactions are applied. |
| 63 |
|
| 64 |
[connection slave] |
| 65 |
ROLLBACK;; |
| 66 |
|
| 67 |
# On slave, verify no additional transaction is added after first |
| 68 |
# insert was blocked i.e. ALTER TABLE .. ANALYZE PARTITION is not |
| 69 |
# bypassing commit order. |
| 70 |
|
| 71 |
include/assert.inc [No additional transaction is added on slave after first insert was blocked] |
| 72 |
|
| 73 |
# Cleanup |
| 74 |
|
| 75 |
[connection master] |
| 76 |
DROP TABLE t1; |
| 77 |
DROP TABLE t2; |
| 78 |
SET GLOBAL binlog_transaction_dependency_tracking=@save_binlog_transaction_dependency_tracking; |
| 79 |
Warnings: |
| 80 |
Warning 1287 '@@binlog_transaction_dependency_tracking' is deprecated and will be removed in a future release. |
| 81 |
include/sync_slave_sql_with_master.inc |
| 82 |
include/stop_slave.inc |
| 83 |
SET GLOBAL replica_parallel_type= @save_replica_parallel_type; |
| 84 |
Warnings: |
| 85 |
Warning 1287 '@@replica_parallel_type' is deprecated and will be removed in a future release. |
| 86 |
SET GLOBAL replica_parallel_workers= @save_replica_parallel_workers; |
| 87 |
SET GLOBAL replica_preserve_commit_order= @save_replica_preserve_commit_order; |
| 88 |
include/start_slave.inc |
| 89 |
include/gtid_utils_end.inc |
| 90 |
include/rpl_end.inc |