File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -86,14 +86,28 @@ function install_semiSync_plugin() {
8686 local mysql=" $mysql_header --host=$1 "
8787
8888 # At first, ensure that the command executes without any error. Then, run the command again and extract the output.
89- retry 120 ${mysql} -N -e ' SHOW PLUGINS;' | grep semisync
90- out=$( ${mysql} -N -e ' SHOW PLUGINS;' | grep semisync)
89+
90+ retry 120 ${mysql} -N -e ' SHOW PLUGINS;' | grep ' semisync_master'
91+ out=$( ${mysql} -N -e ' SHOW PLUGINS;' | grep ' semisync_master' )
92+ replicaStop=0
93+ if [[ -n " $out " ]]; then
94+ log " INFO" " previous version plugin is installed. Uninstalling the plugin..."
95+ retry 120 ${mysql} -e " STOP REPLICA;"
96+ retry 120 ${mysql} -e " UNINSTALL PLUGIN rpl_semi_sync_master;"
97+ retry 120 ${mysql} -e " UNINSTALL PLUGIN rpl_semi_sync_slave;"
98+ replicaStop=1
99+ fi
100+ retry 120 ${mysql} -N -e ' SHOW PLUGINS;' | grep semisync_source
101+ out=$( ${mysql} -N -e ' SHOW PLUGINS;' | grep semisync_source)
91102 if [[ -z " $out " ]]; then
92103 log " INFO" " semisync plugin is not installed. Installing the plugin..."
93104 retry 120 ${mysql} -e " INSTALL PLUGIN rpl_semi_sync_source SONAME 'semisync_source.so';"
94105 retry 120 ${mysql} -e " INSTALL PLUGIN rpl_semi_sync_replica SONAME 'semisync_replica.so';"
95106 reading_first_time=1
96107 log " INFO" " semi_sync plugin successfully installed"
108+ if [[ " $replicaStop " == 1 ]]; then
109+ retry 120 ${mysql} -e " START REPLICA;"
110+ fi
97111 else
98112 log " INFO" " Already semi_sync plugin is installed"
99113 fi
You can’t perform that action at this time.
0 commit comments