403Webshell
Server IP : 172.67.216.182  /  Your IP : 162.158.170.34
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test
###############################################################################
# Bug#17638477 UNINSTALL AND INSTALL SEMI-SYNC PLUGIN CAUSES SLAVES TO BREAK
#  Problem: Uninstallation of Semi sync plugin should be blocked when it is
#  in use.
#  Test case: Uninstallation of semi sync should be allowed
#   On Master:
#     1) When there is no dump thread
#     2) When there are no semi sync slaves (i.e., async replication).
#   On Slave:
#     1) When there is no I/O thread
#     2) When there are no semi sync enabled I/O thread (i.e.,async replication).
###############################################################################

--source include/have_semisync_plugin.inc
--source include/not_embedded.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc

###############################################################################
# Case 1: Uninstallation of semi sync plugins should be allowed when it is
#  not in use i.e., when asynchronous replication is active.
###############################################################################
# Step 1.1: Install semi sync master plugin on master
--replace_result $SEMISYNC_MASTER_PLUGIN SEMISYNC_MASTER_PLUGIN
eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';

# Step 1.2: Install semi sync slave plugin on slave
--connection slave
--replace_result $SEMISYNC_SLAVE_PLUGIN SEMISYNC_SLAVE_PLUGIN
eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';

# Step 1.3: Uninstallation of semisync plugin on master and slave should be
#  allowed at this state as there is no semi sync replication enabled between
#  master and slave.
UNINSTALL PLUGIN rpl_semi_sync_slave;
--connection master
UNINSTALL PLUGIN rpl_semi_sync_master;

# Step 1.4: Check that replication is working fine at the end of the test case.
CREATE TABLE t1(i int);
INSERT INTO t1 values (1);
DROP TABLE t1;
--sync_slave_with_master

###############################################################################
# Case 2: Uninstallation of semi sync plugins should be disallowed
#  when it is in use i.e., when semi sync replication is active
###############################################################################
# Step 2.1: Install and enable semi sync replication between master and slave
--source include/install_semisync.inc

# Step 2.2: Check that rpl_semi_sync_slave uninstallation on Slave is not
#  possible at this state
--connection slave
call mtr.add_suppression("Plugin 'rpl_semi_sync_slave' cannot be uninstalled now");
--error ER_PLUGIN_CANNOT_BE_UNINSTALLED
UNINSTALL PLUGIN rpl_semi_sync_slave;

# Step 2.3: Check that rpl_semi_sync_master uninstallation on Master is not
#  possible at this state
--connection master
call mtr.add_suppression("Plugin 'rpl_semi_sync_master' cannot be uninstalled now");
--error ER_PLUGIN_CANNOT_BE_UNINSTALLED
UNINSTALL PLUGIN rpl_semi_sync_master;

# Step 2.4: Check that replication is working fine at the end of the test case.
CREATE TABLE t1(i int);
INSERT INTO t1 values (2);
DROP TABLE t1;
--sync_slave_with_master

# Step 2.5: Make sure rpl_semi_sync_master_status on Master and
# rpl_semi_sync_slave_staus on Slave are ON
--let $slave_status=[show status like "Rpl_semi_sync_slave_status", Value, 1]
--let assert_cond= "$slave_status" = "ON"
--let assert_text= semi sync slave status should be ON.
--source include/assert.inc

--connection master
--let $master_status=[show status like "Rpl_semi_sync_master_status", Value, 1]
--let assert_cond= "$master_status" = "ON"
--let assert_text= semi sync master status should be ON.
--source include/assert.inc

--let $master_clients=[show status like "Rpl_semi_sync_master_clients", Value, 1]
--let assert_cond= $master_clients = 1
--let assert_text= semi sync master clients should be 1.
--source include/assert.inc

###############################################################################
# Case 3: Uninstallation of semi sync plugin should be disallowed when there
#  are semi sync slaves even though rpl_semi_sync_master_enabled= OFF;.
###############################################################################
# Step 3.1: Disable semi sync on master
--connection master
SET GLOBAL rpl_semi_sync_master_enabled = OFF;

# Step 3.2: Check that still Rpl_semi_sync_master_clients is 1
--let $master_clients=[show status like "Rpl_semi_sync_master_clients", Value, 1]
--let assert_cond= $master_clients = 1
--let assert_text= semi sync master clients should be 1.
--source include/assert.inc

# Step 3.3: Since Rpl_semi_sync_master_clients is 1, uninstallation of
#  rpl_semi_sync_master should be disallowed.
--error ER_PLUGIN_CANNOT_BE_UNINSTALLED
UNINSTALL PLUGIN rpl_semi_sync_master;

###############################################################################
# Case 4: Uninstallation of semi sync plugin should be allowed when it is not
#  in use. Same as Case 1 but this case is to check the case after enabling and
#  disabling semi sync replication.
###############################################################################

# Step 4.1: Stop IO thread on slave.
--connection slave
--source include/stop_slave.inc

# Step 4.2: Disable semi sync on slave.
SET GLOBAL rpl_semi_sync_slave_enabled = OFF;

# Step 4.3: Start IO thread on slave.
--source include/start_slave.inc

# Step 4.4: Uninstall semi sync plugin, it should be successful now.
UNINSTALL PLUGIN rpl_semi_sync_slave;

# Step 4.5: On Master, wait until semi sync slaves is '0'.
--connection master
--let $status_var= Rpl_semi_sync_master_clients
--let $status_var_value= 0
--source include/wait_for_status_var.inc

# Step 4.6: So uninstalling semi sync plugin should be allowed
UNINSTALL PLUGIN rpl_semi_sync_master;

# Step 4.7: Check that replication is working fine at the end of the test case
CREATE TABLE t1(i int);
INSERT INTO t1 values (3);
DROP TABLE t1;
--sync_slave_with_master

# Cleanup
source include/rpl_end.inc;

Youez - 2016 - github.com/yon3zu
LinuXploit