File: rpl_gitd_only_mta_configuration_check.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (109 lines) | stat: -rw-r--r-- 3,305 bytes parent folder | download
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
# ==== Purpose ====
#
# This test checks that:
#  Channels with GTID_ONLY always use the parallel applier
#  Channels with GTID_ONLY reset worker info on replica start
#
# ==== Requirements ====
#
# R1: A channel configured with GTID_ONLY always has at least
#     one applier worker
#
# ==== Implementation ====
#
# 1. Configure the channel with GTID_ONLY = 1
#    Add some data to populate repository tables
# 2. Restart the replica.
#    Check there is no worker info as it was purged after start
# 3. Set the number of applier workers to 0
#    Check the channel still has one worker.
# 4. Disable GTID_ONLY
#    Check the channel has no workers.
# 5. Cleanup
#
# ==== References ====
#
# WL#7491: GTID-based replication applier recovery and positioning
#

--source include/have_slave_repository_type_table.inc
--source include/have_binlog_format_row.inc
--let $rpl_skip_start_slave= 1
--source include/master-slave.inc

--echo
--echo ############################################################
--echo # 1. Configure the channel with GTID_ONLY = 1
--echo #    Add some data to populate repository tables

--source include/rpl_connection_slave.inc

CHANGE REPLICATION SOURCE TO REQUIRE_ROW_FORMAT = 1, GTID_ONLY = 1;

--source include/start_slave.inc

--source include/rpl_connection_master.inc

CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES(1);

--source include/sync_slave_sql_with_master.inc

--echo
--echo ############################################################
--echo # 2. Restart the replica.
--echo #    Check there is no worker info as it was purged after start

--let $rpl_server_number= 2
--let $rpl_server_parameters=--skip_replica_start=1
--source include/rpl_restart_server.inc

--let $assert_text= No info exists in the repository table
--let $assert_cond= `SELECT COUNT(*) = 0 FROM mysql.slave_worker_info`
--source include/assert.inc

--echo
--echo ############################################################
--echo # 3. Set the number of applier workers to 0
--echo #    Check the channel still has one worker.

--let $saved_replica_parallel_workers = `SELECT @@GLOBAL.replica_parallel_workers`
SET @@GLOBAL.replica_parallel_workers = 0;

 --source include/start_slave.inc

--let $assert_text= There is one worker runnning with id 1
--let $assert_cond= `SELECT COUNT(*) = 1 FROM performance_schema.replication_applier_status_by_worker WHERE worker_id=1`
--source include/assert.inc

--echo
--echo ############################################################
--echo # 4. Disable GTID_ONLY
--echo #    Check the channel has no workers.

--source include/stop_slave.inc

CHANGE REPLICATION SOURCE TO GTID_ONLY = 0;

--source include/start_slave.inc

--let $assert_text= There is no worker with an ID
--let $assert_cond= `SELECT COUNT(*) = 0 FROM performance_schema.replication_applier_status_by_worker WHERE worker_id=1`
--source include/assert.inc

--echo
--echo ############################################################
--echo # 5. Cleanup

--source include/rpl_connection_master.inc

DROP TABLE t1;

--source include/sync_slave_sql_with_master.inc

--disable_warnings
--replace_result $saved_replica_parallel_workers NUMBER_OF_WORKERS
--eval SET @@GLOBAL.replica_parallel_workers = $saved_replica_parallel_workers
--enable_warnings

--source include/rpl_end.inc