| 1 |
include/master-slave.inc [rpl_server_count=3] |
| 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 |
# |
| 7 |
# 1. Insert data on server1 and verify that its synced to the server 2. |
| 8 |
# |
| 9 |
[connection server_1] |
| 10 |
CREATE TABLE t1 (a INT) ENGINE = InnoDB; |
| 11 |
INSERT INTO t1 VALUES (1); |
| 12 |
include/rpl_sync.inc |
| 13 |
[connection server_2] |
| 14 |
include/assert.inc ['There is one row on replica'] |
| 15 |
# |
| 16 |
# 2. Verify Asynchronous Replication Connection Failover is initially |
| 17 |
# disabled. Also verify Asynchronous Replication is initially |
| 18 |
# connected to server 3. |
| 19 |
# |
| 20 |
include/assert.inc ['Asynchronous Replication Connection Failover is disabled'] |
| 21 |
# |
| 22 |
# 3. Enable Asynchronous Replication Connection Failover and set retry |
| 23 |
# count and retry time to 2 and verify its enabled in |
| 24 |
# performance_schema.replication_connection_configuration. |
| 25 |
# |
| 26 |
include/stop_slave.inc |
| 27 |
CHANGE REPLICATION SOURCE TO SOURCE_CONNECT_RETRY=1, SOURCE_RETRY_COUNT=2, SOURCE_CONNECTION_AUTO_FAILOVER=1; |
| 28 |
include/start_slave.inc |
| 29 |
include/assert.inc ['Asynchronous Replication Connection Failover is enabled'] |
| 30 |
# |
| 31 |
# 4. Add three asynchronous connection failover servers including |
| 32 |
# server 1 to which it is currently connected. Verify that they are |
| 33 |
# inserted successfully in |
| 34 |
# performance_schema.replication_asynchronous_connection_failover. |
| 35 |
# |
| 36 |
SELECT asynchronous_connection_failover_add_source('', '127.0.0.1', SERVER_MYPORT_1, '', 70);; |
| 37 |
asynchronous_connection_failover_add_source('', '127.0.0.1', SERVER_MYPORT_1, '', 70) |
| 38 |
The UDF asynchronous_connection_failover_add_source() executed successfully. |
| 39 |
SELECT asynchronous_connection_failover_add_source('', '127.0.0.1', SERVER_MYPORT_3, '', 50);; |
| 40 |
asynchronous_connection_failover_add_source('', '127.0.0.1', SERVER_MYPORT_3, '', 50) |
| 41 |
The UDF asynchronous_connection_failover_add_source() executed successfully. |
| 42 |
SELECT asynchronous_connection_failover_add_source('', '127.0.0.1', 40001, '', 40);; |
| 43 |
asynchronous_connection_failover_add_source('', '127.0.0.1', 40001, '', 40) |
| 44 |
The UDF asynchronous_connection_failover_add_source() executed successfully. |
| 45 |
include/assert.inc ['There are three rows in performance_schema.replication_asynchronous_connection_failover'] |
| 46 |
# |
| 47 |
# 5. Initialize async_conn_failover_wait_new_sender dbug sync point |
| 48 |
# and stop server 2. The initialized dbug sync point will block replica |
| 49 |
# IO thread after getting sender list from |
| 50 |
# performance_schema.replication_asynchronous_connection_failover. Add |
| 51 |
# one more sender configuration detail and verify total four sender |
| 52 |
# details are inserted. It also verifies in |
| 53 |
# async_conn_failover_wait_new_sender dbug point that sender list has |
| 54 |
# total three rows i.e. server1, 3 and 4. After stopping server1 there |
| 55 |
# there were no senders to connect so it resets and would consider all |
| 56 |
# according to wl#12649 FR8. |
| 57 |
# |
| 58 |
SET @old_debug= @@global.debug; |
| 59 |
SET GLOBAL debug = '+d,async_conn_failover_wait_new_sender, async_conn_failover_check_interim_sender'; |
| 60 |
include/rpl_stop_server.inc [server_number=1] |
| 61 |
[connection server_2] |
| 62 |
SET DEBUG_SYNC= 'now WAIT_FOR wait_for_new_sender_selection'; |
| 63 |
SELECT asynchronous_connection_failover_add_source('', '127.0.0.1', 50001, '', 80);; |
| 64 |
asynchronous_connection_failover_add_source('', '127.0.0.1', 50001, '', 80) |
| 65 |
The UDF asynchronous_connection_failover_add_source() executed successfully. |
| 66 |
include/assert.inc ['There are four rows in performance_schema.replication_asynchronous_connection_failover'] |
| 67 |
# |
| 68 |
# 6. Now unblock async_conn_failover_wait_new_sender dbug sync point. |
| 69 |
# After unblocking the dbug sync point verifies that only two senders |
| 70 |
# are returned, the server 2 which failed and server 5 which was |
| 71 |
# inserted after asynchronous connection failover process started were |
| 72 |
# skipped. |
| 73 |
# |
| 74 |
SET GLOBAL debug = '-d,async_conn_failover_wait_new_sender'; |
| 75 |
SET DEBUG_SYNC= 'now SIGNAL continue_connect_new_sender'; |
| 76 |
# |
| 77 |
# 7. Verify that asynchronous replication channel gets connected to |
| 78 |
# server 3 and also verify that asynchronous replication tries |
| 79 |
# connecting to server 1 two (retry_count=2) times. |
| 80 |
# |
| 81 |
include/assert_grep.inc [Assert that the IO thread tried two times connecting to server_1] |
| 82 |
# |
| 83 |
# 8. It verifies that out of total four senders in |
| 84 |
# performance_schema.replication_asynchronous_connection_failover it |
| 85 |
# will only consider three servers skipping the last failing sender. |
| 86 |
# It verifies that |
| 87 |
# async_conn_failover_wait_new_sender dbug point that sender list has |
| 88 |
# total three rows. As the sender list os not exhausted it does not |
| 89 |
# consider wl#12649 FR8 and remove the last failing sender from sender |
| 90 |
# to be considered for async failover connection. |
| 91 |
# |
| 92 |
include/rpl_start_server.inc [server_number=1] |
| 93 |
[connection server_2] |
| 94 |
SET GLOBAL debug = '+d,async_conn_failover_wait_new_4sender'; |
| 95 |
include/rpl_stop_server.inc [server_number=3] |
| 96 |
[connection server_2] |
| 97 |
SET DEBUG_SYNC= 'now WAIT_FOR wait_for_new_4sender_selection'; |
| 98 |
SET GLOBAL debug = '-d,async_conn_failover_wait_new_4sender'; |
| 99 |
SET DEBUG_SYNC= 'now SIGNAL continue_connect_new_4sender'; |
| 100 |
# |
| 101 |
# 9. Clean up |
| 102 |
# |
| 103 |
[connection server_1] |
| 104 |
DROP TABLE t1; |
| 105 |
[connection server_2] |
| 106 |
SET GLOBAL debug= @old_debug; |
| 107 |
include/stop_slave.inc |
| 108 |
include/rpl_reset_slave.inc |
| 109 |
SELECT asynchronous_connection_failover_delete_source('', '127.0.0.1', SERVER_MYPORT_1, '');; |
| 110 |
asynchronous_connection_failover_delete_source('', '127.0.0.1', SERVER_MYPORT_1, '') |
| 111 |
The UDF asynchronous_connection_failover_delete_source() executed successfully. |
| 112 |
SELECT asynchronous_connection_failover_delete_source('', '127.0.0.1', SERVER_MYPORT_3, '');; |
| 113 |
asynchronous_connection_failover_delete_source('', '127.0.0.1', SERVER_MYPORT_3, '') |
| 114 |
The UDF asynchronous_connection_failover_delete_source() executed successfully. |
| 115 |
SELECT asynchronous_connection_failover_delete_source('', '127.0.0.1', 40001, '');; |
| 116 |
asynchronous_connection_failover_delete_source('', '127.0.0.1', 40001, '') |
| 117 |
The UDF asynchronous_connection_failover_delete_source() executed successfully. |
| 118 |
SELECT asynchronous_connection_failover_delete_source('', '127.0.0.1', 50001, '');; |
| 119 |
asynchronous_connection_failover_delete_source('', '127.0.0.1', 50001, '') |
| 120 |
The UDF asynchronous_connection_failover_delete_source() executed successfully. |
| 121 |
DROP TABLE IF EXISTS t1; |
| 122 |
include/rpl_start_server.inc [server_number=3] |
| 123 |
include/rpl_end.inc |