403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.189.158
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_gtid_retrieve_last_trx.test
#
# ==== Purpose ====
#
# This test ensures that a fully retrieved transaction will not be asked to be
# retrieved again by the IO thread.
#
# The test first creates a transactional table and add some data on it. Then,
# it issues a "RESET MASTER" on the slave to make the slave to clean its
# GTID_EXECUTED, but the Retrieved_Gtid_Set is kept untouched.
# A restart in the IO thread with this situation should not make the IO thread
# to retrieve the last received transaction again. The test case test this by
# verifying the table consistency after syncing the slave SQL thread.
#
# The second part of the test repeats the above procedure making the last
# transaction to be retrieved by IO thread to be a DDL (without XID or
# QUERY(COMMIT) events to mark its end).
#
# The third part of the test repeats the first part procedure by inserting
# data into a non-transactional table.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#17943188: SHOW SLAVE STATUS/RETRIEVED_GTID_SET MAY HAVE PARTIAL TRX OR
#               MISS COMPLETE TRX
# BUG#18629623: INCONSISTENT DATA IN GTID (RESET MASTER, STOP SLAVE, START
#               SLAVE)
#
--source include/not_group_replication_plugin.inc
--source include/have_gtid.inc
--source include/have_innodb.inc
--source include/have_myisam.inc
--source include/master-slave.inc

# Get the master UUID to filter displayed data
--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID`

#
# First part
#

# Put some data into master, finishing with a DML
CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);

# Sync slave with master
--source include/sync_slave_sql_with_master.inc

# Clean GTIDs on slave, so if a already retrieved transaction be asked
# again to the master, the transaction will be applied again, generating
# data inconsistency.
RESET MASTER;

# Restart the slave threads
--source include/stop_slave.inc
--source include/start_slave.inc

# Make sure the SQL thread is synced before checking consistency
--source include/rpl_connection_master.inc
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Check t1 consistency
--source include/rpl_connection_master.inc
--let $diff_tables= master:t1, slave:t1
--source include/diff_tables.inc

#
# Second part
#

# Now finishing with a DDL (no XID or QUERY(COMMIT) at the end of trx)
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;

# Sync slave with master
--source include/sync_slave_sql_with_master.inc

# Clean GTIDs on slave, so if a already retrieved transaction be asked
# again to the master, the transaction will be applied again, generating
# data inconsistency.
RESET MASTER;

# Restart the slave threads
--source include/stop_slave.inc
--source include/start_slave.inc

# Make sure the SQL thread is synced without errors
--source include/rpl_connection_master.inc
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Put some data into master into a non-trx table, finishing with a DML
--source include/rpl_connection_master.inc
INSERT INTO t2 VALUES (1);

# Sync slave with master
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Clean GTIDs on slave, so if a already retrieved transaction be asked
# again to the master, the transaction will be applied again, generating
# data inconsistency.
RESET MASTER;

# Restart the slave threads
--source include/stop_slave.inc
--source include/start_slave.inc

# Make sure the SQL thread is synced before checking consistency
--source include/rpl_connection_master.inc
--let $ignore_gtids_on_sync= 1
--source include/sync_slave_sql_with_master.inc

# Check t1 consistency
--source include/rpl_connection_master.inc
--let $diff_tables= master:t2, slave:t2
--source include/diff_tables.inc

#
# Cleanup
#

# Save slave Retrieved_Gtid_Set to add it as slave's GTID_PURGED
--source include/rpl_connection_slave.inc
--let $slave_gtid_purged= query_get_value(SHOW SLAVE STATUS, Retrieved_Gtid_Set, 1)
RESET MASTER;
--replace_result $master_uuid MASTER_UUID
--eval SET @@GLOBAL.GTID_PURGED='$slave_gtid_purged'

--source include/rpl_connection_master.inc
DROP TABLE t1, t2;
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit