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
|
include/master-slave.inc [rpl_server_count=3]
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. Insert data on server1 and verify that its synced to the server 2.
#
[connection server_1]
CREATE TABLE t1 (a INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1);
include/rpl_sync.inc
[connection server_2]
include/assert.inc ['There is one row on replica']
#
# 2. Verify Asynchronous Replication Connection Failover is initially
# disabled. Also verify Asynchronous Replication is initially
# connected to server 1.
#
include/assert.inc ['Asynchronous Replication Connection Failover is disabled']
#
# 3. Enable Asynchronous Replication Connection Failover and set retry
# count and retry time to 2 and verify its enabled in
# performance_schema.replication_connection_configuration.
#
# Adding debug point 'async_conn_failover_disable_weight_check' to @@GLOBAL.debug
include/stop_slave.inc
CHANGE REPLICATION SOURCE TO SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=2, SOURCE_CONNECTION_AUTO_FAILOVER=1;
include/start_slave.inc
include/assert.inc ['Asynchronous Replication Connection Failover is enabled']
#
# 4. Add asynchronous connection failover server. Verify that they are
# inserted successfully in
# performance_schema.replication_asynchronous_connection_failover.
#
SELECT asynchronous_connection_failover_add_source('', '127.0.0.1', SERVER_MYPORT_3, '', 50);;
asynchronous_connection_failover_add_source('', '127.0.0.1', SERVER_MYPORT_3, '', 50)
The UDF asynchronous_connection_failover_add_source() executed successfully.
include/assert.inc ['There are three rows in performance_schema.replication_asynchronous_connection_failover']
#
# 5. Initialize rpl_async_conn_failover_crash dbug sync point and stop
# server 1. The initialized dbug sync point will crash server 2.
# Reconnect to server 2 and start replica on it.
#
include/rpl_start_server.inc [server_number=2]
# Adding debug point 'async_conn_failover_crash' to @@GLOBAL.debug
include/rpl_stop_server.inc [server_number=1]
include/rpl_reconnect.inc
include/start_slave.inc
#
# 6. Verify that asynchronous replication channel gets connected to
# server 3 and also verify that asynchronous replication tries
# connecting to server 1 two (retry_count=2) times.
#
include/assert_grep.inc [Assert that the IO thread tried five times connecting to server_1]
#
# 7. Clean up
#
[connection server_2]
include/stop_slave.inc
include/rpl_reset_slave.inc
SELECT asynchronous_connection_failover_delete_source('', '127.0.0.1', SERVER_MYPORT_3, '');;
asynchronous_connection_failover_delete_source('', '127.0.0.1', SERVER_MYPORT_3, '')
The UDF asynchronous_connection_failover_delete_source() executed successfully.
DROP TABLE t1;
[connection server_1]
include/rpl_start_server.inc [server_number=1]
DROP TABLE t1;
include/rpl_end.inc
|