| 1 |
################################################################################ |
| 2 |
# WL#6841 - GCS Replication: P_S table to show GCS kernel stats |
| 3 |
# |
| 4 |
# This test checks the basic functionality of the Group Replication |
| 5 |
# P_S for replication_connection_status table. |
| 6 |
# DDL and DML testing for this table is addressed in other tests. |
| 7 |
# |
| 8 |
# The follwing scenarios are tested: |
| 9 |
# 0. The test requires one server: M1. |
| 10 |
# 1. Checking that GR channel in replication_connection_status is not present |
| 11 |
# before group_replication on M1. |
| 12 |
# 2. Bootstrap start M1. Validate group_name to valid name and service_state=ON. |
| 13 |
# 3. On stop GR, validate group_name to valid name and service_state=OFF. |
| 14 |
# 4. Check that group_name is reset if mysql server restarts. |
| 15 |
# 5. Verify that the group_name and source_uuid are not preserved when plugin |
| 16 |
# is uninstalled. |
| 17 |
################################################################################ |
| 18 |
|
| 19 |
--let $group_replication_group_name= 8a94f356-aab3-11de-86aa-b80aa9429561 |
| 20 |
--source include/have_group_replication_plugin.inc |
| 21 |
|
| 22 |
--connection server1 |
| 23 |
# This is a valid name being given to the group name |
| 24 |
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name" |
| 25 |
|
| 26 |
# Checking the performance Schema output for the replication_connection_status table. |
| 27 |
# Channel only exists after start Group Replication. |
| 28 |
--let $group_name= query_get_value(SELECT Group_Name from performance_schema.replication_connection_status, Group_Name, 1) |
| 29 |
--let $assert_text= The value of group name should be $group_replication_group_name |
| 30 |
--let $assert_cond= "$group_name" = "No such row" |
| 31 |
--source include/assert.inc |
| 32 |
|
| 33 |
--let $service_state= query_get_value(SELECT Service_state from performance_schema.replication_connection_status, Service_state, 1) |
| 34 |
--let $assert_text= The value of service state before Group Replication start should be OFF |
| 35 |
--let $assert_cond= "$service_state" = "No such row" |
| 36 |
--source include/assert.inc |
| 37 |
|
| 38 |
# Start Group Replication |
| 39 |
--source include/start_and_bootstrap_group_replication.inc |
| 40 |
|
| 41 |
--let $group_name= query_get_value(SELECT Group_Name from performance_schema.replication_connection_status, Group_Name, 1) |
| 42 |
--let $assert_text= The value of group name should be $group_replication_group_name |
| 43 |
--let $assert_cond= "$group_name" = "$group_replication_group_name" |
| 44 |
--source include/assert.inc |
| 45 |
|
| 46 |
--let $service_state= query_get_value(SELECT Service_state from performance_schema.replication_connection_status, Service_state, 1) |
| 47 |
--let $assert_text= The value of service state after Group Replication start should be ON |
| 48 |
--let $assert_cond= "$service_state" = "ON" |
| 49 |
--source include/assert.inc |
| 50 |
|
| 51 |
# Stop Group Replication |
| 52 |
--source include/stop_group_replication.inc |
| 53 |
|
| 54 |
--let $group_name= query_get_value(SELECT Group_Name from performance_schema.replication_connection_status, Group_Name, 1) |
| 55 |
|
| 56 |
--let $assert_text= The value of group name should be $group_replication_group_name |
| 57 |
--let $assert_cond= "$group_name" = "$group_replication_group_name" |
| 58 |
--source include/assert.inc |
| 59 |
|
| 60 |
--let $service_state= query_get_value(SELECT Service_state from performance_schema.replication_connection_status, Service_state, 1) |
| 61 |
--let $assert_text= The value of service state after Group Replication stop should be OFF again |
| 62 |
--let $assert_cond= "$service_state" = "OFF" |
| 63 |
--source include/assert.inc |
| 64 |
|
| 65 |
# This restart tests that the plugin is still loaded on the server restart |
| 66 |
--source include/restart_mysqld.inc |
| 67 |
|
| 68 |
# After the server restart the group name is again set to NULL |
| 69 |
--let $group_name= query_get_value(SELECT Group_Name from performance_schema.replication_connection_status, Group_Name, 1) |
| 70 |
|
| 71 |
--let $assert_text= The value of group name should be NULL |
| 72 |
--let $assert_cond= "$group_Name"= "" |
| 73 |
--source include/assert.inc |
| 74 |
|
| 75 |
--let $source_uuid= query_get_value(SELECT Source_Uuid from performance_schema.replication_connection_status, Source_Uuid, 1) |
| 76 |
|
| 77 |
--let $assert_text= The value of source_uuid should be NULL |
| 78 |
--let $assert_cond= "$source_uuid"= "" |
| 79 |
--source include/assert.inc |
| 80 |
|
| 81 |
--source include/gr_clear_configuration.inc |