File: rpl_replica_start_after_clone.inc

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 (103 lines) | stat: -rw-r--r-- 2,942 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
# ==== Purpose ====
#
# The purpose of this script is to test if when correctly configured we
# can clone a replica and it will start replicating on server start.
#
# ==== Usage ====
#
# This script uses no parameters, for its uses you can just include it.
#
#--source extra/rpl_tests/rpl_replica_start_after_clone.inc
#
# You can this point do extra validations.
# To clean the test setup you should invoke
#
#--source extra/rpl_tests/rpl_replica_start_after_clone_cleanup.inc
#
# ==== Setup ====
#
# The scrip will configure server 3 to clone server 2 that is a replica
# of server 1.
# It then validates server 3 is replicating from server 1
#
# ==== Implementation ====
#
# 1. Create connections to server3
# 2. Create a table for testing
# 3. Install clone on server 2
#    Configure server 3 to invoke clone
# 4. Execute a transaction on server 1, check 3 received it
#
# ==== References ====
#
# Bug#29995256: PRIVILEGE_CHECKS_USER NOT CLONED FOR RECOVERY CHANNEL
# WL#7491: GTID-based replication applier recovery and positioning
#


--echo #
--echo # 1. Create connections to server3

--connect(server_3,127.0.0.1,root,,test,$SERVER_MYPORT_3,)
--connect(server_3_1,127.0.0.1,root,,test,$SERVER_MYPORT_3,)

--echo #
--echo # 2. Create a table for testing

--let $rpl_connection_name= server_1
--source include/rpl_connection.inc

CREATE TABLE test.t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;

--source include/sync_slave_sql_with_master.inc

--echo #
--echo # 3. Install clone on server 2
--echo #    Configure server 3 to invoke clone

--let $rpl_connection_name= server_2
--source include/rpl_connection.inc

--replace_result $CLONE_PLUGIN CLONE_PLUGIN
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'

--let $rpl_connection_name= server_3
--source include/rpl_connection.inc

# Make server 3 run with mysqld_safe
--source include/spawn_monitoring_process.inc

# Install clone
--replace_result $CLONE_PLUGIN CLONE_PLUGIN
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'

# Set the clone valid donor list to include server 2
--replace_result $SERVER_MYPORT_2 SERVER2_PORT
--eval SET GLOBAL clone_valid_donor_list = 'localhost:$SERVER_MYPORT_2'

# Clone server 3 from server 2
--replace_result $SERVER_MYPORT_2 SERVER2_PORT
--eval CLONE INSTANCE FROM root@localhost:$SERVER_MYPORT_2 IDENTIFIED BY ''
--source include/wait_until_disconnected.inc

--let $rpl_server_number= 3
--source include/rpl_reconnect.inc

--echo #
--echo # 4. Execute a transaction on server 1, check 3 received it

--let $rpl_connection_name= server_1
--source include/rpl_connection.inc

INSERT INTO t1 VALUES (1);

--let $sync_slave_connection= server_3
--source include/sync_slave_sql_with_master.inc

--let $rpl_connection_name= server_3
--source include/rpl_connection.inc

--let $server_1_data = `SELECT COUNT(*) FROM test.t1`
--let $assert_text= All info from server 1 is present
--let $assert_cond= $server_1_data = 1
--source include/assert.inc