File: rpl_replication_observers_example_is_stopping.result

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 (104 lines) | stat: -rw-r--r-- 4,726 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
include/have_replication_observers_example_plugin.inc
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]

############################################################
# 1. Install the plug-in and add error suppressions on slave
[connection master]
SET SESSION sql_log_bin= 0;
CALL mtr.add_suppression(".*Cannot replicate.*purged required binary logs.*");
SET SESSION sql_log_bin= 1;
[connection slave]
SET SESSION sql_log_bin= 0;
CALL mtr.add_suppression("Table 't1' already exists");
CALL mtr.add_suppression("Got fatal error 1236 from source when reading data from binary log");
SET SESSION sql_log_bin= 1;
include/install_replication_observers_example.inc

####################################################################
# 2. Create a table on master and generate workload to be replicated
[connection master]
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

########################################
# 3. Create the example_channel on slave
[connection slave]
CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_PORT=MASTER_MYPORT, SOURCE_USER='root', SOURCE_AUTO_POSITION=1 FOR CHANNEL 'example_channel';
Warnings:
Note	1759	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	1760	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.

#######################
# 4. SQL thread testing

#################################################
# 4.1 Prepare SQL thread to fail after started up
SET SESSION sql_log_bin= 0;
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
SET SESSION sql_log_bin= 1;
# Adding debug point 'validate_replication_observers_plugin_server_is_sql_stopping' to @@GLOBAL.debug
# Adding debug point 'pause_after_sql_thread_stop_hook' to @@GLOBAL.debug
[connection slave1]
SET SESSION sql_log_bin= 0;
INSERT INTO t1 VALUES (0);

#########################################################
# 4.2 Wait until SQL thread failed trying to apply events
[connection slave]
SET DEBUG_SYNC='now WAIT_FOR reached_sql_thread_started';
include/wait_for_slave_sql_error.inc [errno=1050 FOR CHANNEL 'example_channel']
# Removing debug point 'pause_after_sql_thread_stop_hook' from @@GLOBAL.debug
# Removing debug point 'validate_replication_observers_plugin_server_is_sql_stopping' from @@GLOBAL.debug
[connection slave1]
SET SESSION sql_log_bin= 1;
include/stop_slave.inc [FOR CHANNEL 'example_channel']
RESET SLAVE FOR CHANNEL 'example_channel';
Warnings:
Warning	1287	'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead

#######################
# 5. I/O thread testing

##########################################################################
# 5.1 Rotate and purge the binary log on master to make I/O thread to fail
[connection master]
FLUSH BINARY LOGS;
include/stop_dump_threads.inc

#################################################
# 5.2 Prepare I/O thread to fail after started up
[connection slave]
# Adding debug point 'validate_replication_observers_plugin_server_is_io_stopping' to @@GLOBAL.debug
# Adding debug point 'pause_after_io_thread_stop_hook' to @@GLOBAL.debug
[connection slave1]
SET SESSION sql_log_bin= 0;
INSERT INTO t1 VALUES (1);

###########################################################
# 5.3 Wait until I/O thread failed to replicate from master
[connection slave]
SET DEBUG_SYNC='now WAIT_FOR reached_io_thread_started';
include/wait_for_slave_io_error.inc [errno=13114 FOR CHANNEL 'example_channel']
# Removing debug point 'pause_after_io_thread_stop_hook' from @@GLOBAL.debug
# Removing debug point 'validate_replication_observers_plugin_server_is_io_stopping' from @@GLOBAL.debug
[connection slave1]
DROP TABLE t1;
SET SESSION sql_log_bin= 1;

############
# 6. Cleanup
[connection slave]
RESET SLAVE ALL FOR CHANNEL 'example_channel';
Warnings:
Warning	1287	'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
include/uninstall_replication_observers_example.inc
[connection master]
DROP TABLE t1;
RESET MASTER;
[connection slave]
include/start_slave.inc
include/rpl_end.inc