| 1 |
################################################################################ |
| 2 |
# This test proves that if Group Replication is installed via script |
| 3 |
# "install_group_replication_plugin.inc" then restart of MySQL Server does not |
| 4 |
# log any ERROR or WARNING. |
| 5 |
# |
| 6 |
# Test: |
| 7 |
# 0. The test requires one server. |
| 8 |
# 1. Uninstall and install Group Replication via inc file do not log error. |
| 9 |
# 2. Reboot server. |
| 10 |
# 3. Verify no ERROR is logged. |
| 11 |
# 4. Uninstall and install Group Replication via commands (not inc) log error. |
| 12 |
# 5. Reboot server. |
| 13 |
# 6. Verify ERROR is logged. |
| 14 |
# 7. Cleanup. |
| 15 |
# |
| 16 |
################################################################################ |
| 17 |
|
| 18 |
--source include/have_group_replication_plugin.inc |
| 19 |
--let $rpl_skip_group_replication_start= 1 |
| 20 |
--source include/group_replication.inc |
| 21 |
|
| 22 |
--let $group_replication_local_address= `SELECT @@GLOBAL.group_replication_local_address` |
| 23 |
--let $group_replication_group_seeds= `SELECT @@GLOBAL.group_replication_group_seeds` |
| 24 |
|
| 25 |
SET SESSION sql_log_bin=0; |
| 26 |
call mtr.add_suppression("Function 'group_replication' already exists"); |
| 27 |
call mtr.add_suppression("Couldn't load plugin named 'group_replication' with soname 'group_replication.*'"); |
| 28 |
SET SESSION sql_log_bin=1; |
| 29 |
|
| 30 |
--echo |
| 31 |
--echo # 1. Uninstall and install Group Replication via inc file do not log error. |
| 32 |
--source include/uninstall_group_replication_plugin.inc |
| 33 |
--source include/install_group_replication_plugin.inc |
| 34 |
--source include/clean_group_replication_install_entry.inc |
| 35 |
|
| 36 |
--echo |
| 37 |
--echo # 2. Reboot server. |
| 38 |
--let $allow_rpl_inited= 1 |
| 39 |
|
| 40 |
--let $restart_parameters=restart:--group_replication_local_address=$group_replication_local_address --group_replication_group_seeds=$group_replication_group_seeds --group_replication_group_name=$group_replication_group_name |
| 41 |
--replace_result $group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 42 |
--source include/restart_mysqld.inc |
| 43 |
|
| 44 |
--let $assert_text= 'INSTALL PLUGIN cleanup successful using clean_group_replication_install_entry.inc' |
| 45 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM mysql.plugin WHERE name="group_replication", count, 1] = 0 |
| 46 |
--source include/assert.inc |
| 47 |
|
| 48 |
--let $rpl_server_number= 1 |
| 49 |
--source include/rpl_reconnect.inc |
| 50 |
|
| 51 |
--echo |
| 52 |
--echo # 3. Verify no ERROR is logged. |
| 53 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 54 |
--let $assert_count = 0 |
| 55 |
--let $assert_select = Function 'group_replication' already exists |
| 56 |
--let $assert_text = Did not find the text Function 'group_replication' already exists |
| 57 |
--source include/assert_grep.inc |
| 58 |
|
| 59 |
--echo |
| 60 |
--echo # 4. Uninstall and install Group Replication via commands (not inc) log error. |
| 61 |
--source include/uninstall_group_replication_plugin.inc |
| 62 |
--source include/install_group_replication_plugin.inc |
| 63 |
|
| 64 |
--echo |
| 65 |
--echo # 5. Reboot server. |
| 66 |
--let $restart_parameters=restart:--group_replication_local_address=$group_replication_local_address --group_replication_group_seeds=$group_replication_group_seeds --group_replication_group_name=$group_replication_group_name |
| 67 |
--replace_result $group_replication_local_address GROUP_REPLICATION_LOCAL_ADDRESS $group_replication_group_seeds GROUP_REPLICATION_GROUP_SEEDS $group_replication_group_name GROUP_REPLICATION_GROUP_NAME |
| 68 |
--source include/restart_mysqld.inc |
| 69 |
|
| 70 |
--let $assert_text= 'INSTALL PLUGIN leaves entry in mysql.plugin table so cleanup is required done in group_replication_end.inc' |
| 71 |
--let $assert_cond= [SELECT COUNT(*) AS count FROM mysql.plugin WHERE name="group_replication", count, 1] = 1 |
| 72 |
--source include/assert.inc |
| 73 |
|
| 74 |
--let $rpl_server_number= 1 |
| 75 |
--source include/rpl_reconnect.inc |
| 76 |
|
| 77 |
--echo |
| 78 |
--echo # 6. Verify ERROR is logged. |
| 79 |
--let $assert_file= $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 80 |
--let $assert_count = 1 |
| 81 |
--let $assert_select = Function 'group_replication' already exists |
| 82 |
--let $assert_text = Found the text Function 'group_replication' already exists |
| 83 |
--source include/assert_grep.inc |
| 84 |
|
| 85 |
--echo |
| 86 |
--echo # 7. Cleanup. |
| 87 |
--source include/group_replication_end.inc |