403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.69.176.159
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/extra/rpl_tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/extra/rpl_tests/rpl_semi_sync_after_sync.test
--echo #
--echo # Test on AFTER_SYNC wait point
--echo # #######################################################################
--echo # Case 1: Single statement transaction
--echo #
--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--let $yes_tx= query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx', Value, 1)
show status like "rpl_semi_sync_master_yes_tx";
SET DEBUG_SYNC= "after_call_after_sync_observer SIGNAL after_sync_done WAIT_FOR end";
--send INSERT INTO t1 VALUES(1);

--source include/rpl_connection_master.inc
SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";

show status like "rpl_semi_sync_master_yes_tx";
--let $assert_text= rpl_semi_sync_master_yes_tx increased 1
--disable_warnings
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
--enable_warnings
--source include/assert.inc

--let $assert_text= Table is empty right now.
--let $assert_cond= COUNT(*) = 0 FROM t1
--source include/assert.inc

--source include/sync_slave_sql_with_master.inc

--let $assert_text= Table has 1 record
--let $assert_cond= COUNT(*) = 1 FROM t1;
--source include/assert.inc

--source include/rpl_connection_master.inc
SET DEBUG_SYNC= "now SIGNAL end";

--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--reap

# Varify that after_commit hook is not executed.
--let $assert_text= rpl_semi_sync_master_yes_tx increased only 1
--disable_warnings
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
--enable_warnings
--source include/assert.inc

TRUNCATE t1;

--echo #
--echo # Test on AFTER_SYNC wait point
--echo # #######################################################################
--echo # Case 2: Real transaction
--echo #

--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--let $yes_tx= query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx', Value, 1)

SET DEBUG_SYNC= "after_call_after_sync_observer SIGNAL after_sync_done WAIT_FOR end";
BEGIN;
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
--send COMMIT

--source include/rpl_connection_master.inc
SET DEBUG_SYNC= "now WAIT_FOR after_sync_done";

--let $assert_text= rpl_semi_sync_master_yes_tx increased 1
--disable_warnings
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
--enable_warnings
--source include/assert.inc

--let $assert_text= Table is empty right now.
--let $assert_cond= COUNT(*) = 0 FROM t1
--source include/assert.inc

--source include/sync_slave_sql_with_master.inc

--let $assert_text= Table has two records
--let $assert_cond= COUNT(*) = 2 FROM t1;
--source include/assert.inc

--source include/rpl_connection_master.inc
SET DEBUG_SYNC= "now SIGNAL end";

--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--reap

# Varify that after_commit hook is not executed.
--let $assert_text= rpl_semi_sync_master_yes_tx increased only 1
--disable_warnings
--let $assert_cond= VARIABLE_VALUE = $yes_tx+1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
--enable_warnings
--source include/assert.inc

TRUNCATE t1;

--echo #
--echo # Test on AFTER_COMMIT wait point
--echo # #######################################################################
--echo # Verify after_sync hook will not be executed
--echo #
--let $yes_tx= query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx', Value, 1)
--let $no_tx= query_get_value(SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx', Value, 1)

SET GLOBAL rpl_semi_sync_master_wait_point= AFTER_COMMIT;
SET DEBUG_SYNC= "before_call_after_commit_observer SIGNAL engine_commit_done
                 WAIT_FOR end";
--send INSERT INTO t1 VALUES(1);

--source include/rpl_connection_master.inc
SET DEBUG_SYNC= "now WAIT_FOR engine_commit_done";

--let $assert_text= Table is empty right now.
--let $assert_cond= COUNT(*) = 1 FROM t1
--source include/assert.inc

--let $assert_text= rpl_semi_sync_master_yes_tx was not increased
--disable_warnings
--let $assert_cond= VARIABLE_VALUE = $yes_tx FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_yes_tx"
--enable_warnings
--source include/assert.inc

--let $assert_text= rpl_semi_sync_master_no_tx was not increased
--disable_warnings
--let $assert_cond= VARIABLE_VALUE = $no_tx FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = "rpl_semi_sync_master_no_tx"
--enable_warnings
--source include/assert.inc

SET DEBUG_SYNC= "now SIGNAL end";
--let $rpl_connection_name= server_1
--source include/rpl_connection.inc
--reap

SET DEBUG_SYNC= "RESET";
--source include/rpl_connection_master.inc
SET DEBUG_SYNC= "RESET";
SET GLOBAL rpl_semi_sync_master_wait_point= AFTER_SYNC;
TRUNCATE t1;
--source include/sync_slave_sql_with_master.inc

Youez - 2016 - github.com/yon3zu
LinuXploit