| 1 |
################################################################################ |
| 2 |
# This test checks that the stable set is updated on ONLINE members when a new |
| 3 |
# member joins. |
| 4 |
# |
| 5 |
# Test: |
| 6 |
# 0. The test requires two servers: M1 and M2. |
| 7 |
# 1. Set DEBUG point to ensure the certification garbage collector is not |
| 8 |
# executed. Bootstrap start a group on M1. |
| 9 |
# 2. Check the stable set is empty on M1. |
| 10 |
# 3. Add some data on M1. |
| 11 |
# 4. Start GR on M2. |
| 12 |
# 5. On M1, validate that the stable set now contains the transactions previous |
| 13 |
# to M2 entry. |
| 14 |
# 6. Clean up. |
| 15 |
################################################################################ |
| 16 |
|
| 17 |
--source include/have_debug.inc |
| 18 |
--let $group_replication_group_name= 6d387320-185d-11e6-bdf4-0800200c9a66 |
| 19 |
--source include/have_group_replication_plugin.inc |
| 20 |
--let $rpl_skip_group_replication_start= 1 |
| 21 |
--source include/group_replication.inc |
| 22 |
|
| 23 |
--echo # |
| 24 |
--echo # Start the first member |
| 25 |
--echo # |
| 26 |
|
| 27 |
--let $rpl_connection_name= server1 |
| 28 |
--source include/rpl_connection.inc |
| 29 |
|
| 30 |
SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_broadcast_thread_big_period'; |
| 31 |
|
| 32 |
--source include/start_and_bootstrap_group_replication.inc |
| 33 |
|
| 34 |
--echo # |
| 35 |
--echo # Check the stable set is empty |
| 36 |
--echo # |
| 37 |
|
| 38 |
--let $transactions_committed_all_members= query_get_value(SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid), Transactions_committed_all_members, 1) |
| 39 |
--let $assert_text= 'Transactions_committed_all_members should be empty' |
| 40 |
--let $assert_cond= "$transactions_committed_all_members" = "" |
| 41 |
--source include/assert.inc |
| 42 |
|
| 43 |
--echo # |
| 44 |
--echo # Add some data to the group |
| 45 |
--echo # |
| 46 |
|
| 47 |
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; |
| 48 |
INSERT INTO t1 VALUES (1); |
| 49 |
|
| 50 |
--echo # |
| 51 |
--echo # Add a new guy to the group |
| 52 |
--echo # |
| 53 |
|
| 54 |
--let $rpl_connection_name= server2 |
| 55 |
--source include/rpl_connection.inc |
| 56 |
|
| 57 |
--source include/start_group_replication.inc |
| 58 |
|
| 59 |
--echo # |
| 60 |
--echo # The stable set now contains the transactions previous to member 2 entry |
| 61 |
--echo # |
| 62 |
|
| 63 |
--let $rpl_connection_name= server1 |
| 64 |
--source include/rpl_connection.inc |
| 65 |
|
| 66 |
# The Stable set update happens before the execution of the View Change event |
| 67 |
--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "6d387320-185d-11e6-bdf4-0800200c9a66:1-4" |
| 68 |
--source include/wait_condition.inc |
| 69 |
|
| 70 |
--let $transactions_committed_all_members= query_get_value(SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid), Transactions_committed_all_members, 1) |
| 71 |
--let $assert_text= 'Transactions_committed_all_members should have the transactions previous to member 2 entry' |
| 72 |
--let $assert_cond= "$transactions_committed_all_members" = "6d387320-185d-11e6-bdf4-0800200c9a66:1-3" |
| 73 |
--source include/assert.inc |
| 74 |
|
| 75 |
--echo # |
| 76 |
--echo # Cleaning |
| 77 |
--echo # |
| 78 |
|
| 79 |
DROP TABLE t1; |
| 80 |
SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_broadcast_thread_big_period'; |
| 81 |
|
| 82 |
--source include/group_replication_end.inc |