403Webshell
Server IP : 172.67.216.182  /  Your IP : 108.162.227.19
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_gtids_table_disable_log_slave_updates.test
#
# ==== Purpose ====
#
# WL#6559 Optimize GTIDs for passive slave - store GTIDs in table
#
# Verify that we can store gtids into gtid_executed table for transactions
# on binlog rotation and report GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED
# correctly on slave when binlog is enabled and log_slave_updates is diabled.
#

--source include/not_group_replication_plugin.inc
--source include/have_gtid.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--let $rpl_gtid_utils= 1
--source include/master-slave.inc

--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`

CREATE TABLE IF NOT EXISTS t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1);
INSERT INTO t2 VALUES(1);
--echo #
--echo # Verify that transactions' gtids can be reported
--echo # from global.gtid_executed correctly.
--echo #
--let $assert_text= committed gtids MASTER_UUID:1-4
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-4"
--source include/assert.inc
--echo #
--echo # Store gtids MASTER_UUID:1-4 in gtid_executed table on binlog rotation
--echo #
FLUSH LOGS;
--replace_result $master_uuid MASTER_UUID
SELECT * FROM mysql.gtid_executed;


--source include/sync_slave_sql_with_master.inc
--echo #
--echo # connection slave
--echo #
--let $slave_uuid= `SELECT @@GLOBAL.SERVER_UUID`
--let $assert_text= committed gtids MASTER_UUID:1-4
--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1-4"
--source include/assert.inc
--echo #
--echo # Verify that slave thread stores gtid into gtid_executed table within
--echo # each transaction if binlog is on and log_slave_updated is disabled.
--echo #
--replace_result $master_uuid MASTER_UUID
SELECT * FROM mysql.gtid_executed;

INSERT INTO t1 VALUES(2);
INSERT INTO t2 VALUES(2);
--echo #
--echo # Verify that store gtids SLAVE_UUID:1-2 into gtid_executed table,
--echo # which is also compressed on binlog rotation.
--echo #

SET @old_compression_period= @@GLOBAL.GTID_EXECUTED_COMPRESSION_PERIOD;
SET @@GLOBAL.GTID_EXECUTED_COMPRESSION_PERIOD= 1;
FLUSH LOGS;
SET @@GLOBAL.GTID_EXECUTED_COMPRESSION_PERIOD= @old_compression_period;

--let $table= mysql.gtid_executed
--let $count= 2
--source include/wait_until_rows_count.inc

--replace_result $master_uuid MASTER_UUID
--eval SELECT * FROM mysql.gtid_executed where source_uuid="$master_uuid"
--replace_result $slave_uuid SLAVE_UUID
--eval SELECT * FROM mysql.gtid_executed where source_uuid="$slave_uuid"

--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--echo #
--echo # Verify that we can get the correct set of gtid_purged when purging
--echo # logs if binlog is enabled and log_slave_updates is disabled.
--echo #
--eval PURGE BINARY LOGS TO '$binlog_file'
--let $assert_text= purged gtids SLAVE_UUID:1-2,MASTER_UUID:1-4
--let $assert_cond= GTID_IS_EQUAL("[SELECT @@GLOBAL.GTID_PURGED]", "$slave_uuid:1-2,$master_uuid:1-4")
--source include/assert.inc

--echo #
--echo # Verify that we can get the correct set from 'gtid_executed' table
--echo # when executing a big transaction that exceeds the max size of the
--echo # binlog if binlog is enabled and log_slave_updates is disabled.
--echo #
SET @SIZE_DEFAULT=@@MAX_BINLOG_SIZE;
SET GLOBAL MAX_BINLOG_SIZE=4096;
SET @@GLOBAL.DEBUG= '+d, dont_compress_gtid_table';

--let $i= 1
BEGIN;
while ($i < 60) {
  --eval INSERT INTO t1 VALUES ($i);
  --inc $i
}
COMMIT;
SET GLOBAL DEBUG= @debug_save;
SET GLOBAL MAX_BINLOG_SIZE=@SIZE_DEFAULT;

--replace_result $master_uuid MASTER_UUID
--eval SELECT * FROM mysql.gtid_executed where source_uuid="$master_uuid"
--replace_result $slave_uuid SLAVE_UUID
--eval SELECT * FROM mysql.gtid_executed where source_uuid="$slave_uuid"

--connection master
DROP TABLE t1,t2;

--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit