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
|
################################################################################
# This test checks that the stable set is updated on ONLINE members when a new
# member joins.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. Set DEBUG point to ensure the certification garbage collector is not
# executed. Bootstrap start a group on M1.
# 2. Check the stable set is empty on M1.
# 3. Add some data on M1.
# 4. Start GR on M2.
# 5. On M1, validate that the stable set now contains the transactions previous
# to M2 entry.
# 6. Clean up.
################################################################################
--source include/have_debug.inc
--let $group_replication_group_name= 6d387320-185d-11e6-bdf4-0800200c9a66
--source include/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source include/group_replication.inc
--echo #
--echo # Start the first member
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
SET @@GLOBAL.DEBUG= '+d,group_replication_certifier_broadcast_thread_big_period';
--source include/start_and_bootstrap_group_replication.inc
--echo #
--echo # Check the stable set is empty
--echo #
--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)
--let $assert_text= 'Transactions_committed_all_members should be empty'
--let $assert_cond= "$transactions_committed_all_members" = ""
--source include/assert.inc
--echo #
--echo # Add some data to the group
--echo #
CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
--echo #
--echo # Add a new guy to the group
--echo #
--let $rpl_connection_name= server2
--source include/rpl_connection.inc
--source include/start_group_replication.inc
--echo #
--echo # The stable set now contains the transactions previous to member 2 entry
--echo #
--let $rpl_connection_name= server1
--source include/rpl_connection.inc
# The Stable set update happens before the execution of the View Change event
--let $wait_condition= SELECT @@GLOBAL.GTID_EXECUTED = "6d387320-185d-11e6-bdf4-0800200c9a66:1-4"
--source include/wait_condition.inc
--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)
--let $assert_text= 'Transactions_committed_all_members should have the transactions previous to member 2 entry'
--let $assert_cond= "$transactions_committed_all_members" = "6d387320-185d-11e6-bdf4-0800200c9a66:1-3"
--source include/assert.inc
--echo #
--echo # Cleaning
--echo #
DROP TABLE t1;
SET @@GLOBAL.DEBUG= '-d,group_replication_certifier_broadcast_thread_big_period';
--source include/group_replication_end.inc
|