403Webshell
Server IP : 104.21.38.3  /  Your IP : 104.23.175.175
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/binlog/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/binlog/t/binlog_gtid_exhausted.test
###############################################################################
# Bug#21276561: FAILURE TO GENERATE GTID LEADS TO INCONSISTENCY
#
# Problem:
# =======
# If generating a GTID for a transaction fails, the  transaction is not written
# to the binary log but still gets  committed, which potentially leads to
# master/slave data inconsistency.
#
# Test:
# =====
# Simulate a scenario such that generation of GTID number reaches its maximum
# value and the new GTID cannot be generated because of that. Verify that this
# fatal error case is appropriately handled as per the binlog_error_action
# value specified by user.
###############################################################################
--source include/have_innodb.inc
--source include/have_gtid.inc
# This test case is binlog_format agnostic
--source include/have_binlog_format_statement.inc
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc

call mtr.add_suppression("An error occurred during flush stage of the commit");
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");

--let $assert_file = $MYSQLTEST_VARDIR/tmp/binlog_gtid_exhausted.err

#Test case 1:
SET GLOBAL binlog_error_action=IGNORE_ERROR;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
# @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
# Hence execute RESET MASTER.
RESET MASTER;
SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805');
INSERT INTO t1 VALUES (1);
--error ER_GNO_EXHAUSTED
INSERT INTO t1 VALUES (2);

# BUG26035544 Assert that an error was logged to the server error log.
--let $assert_select = Impossible to generate GTID: the integer component reached the maximum value. Restart the server with a new server_uuid. Hence turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
--let $assert_count = 1
--let $assert_text = ER_GNO_EXHAUSTED found in server error log
--source include/assert_grep.inc

# Check that transaction is committed
--let $assert_cond = COUNT(*) = 2 FROM t1;
--let $assert_text = Count of elements in t1 should be 2.
--source include/assert.inc
--source include/restart_mysqld.inc

RESET MASTER;
DROP TABLE t1;

#Test case 2:
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
# @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty.
# Hence execute RESET MASTER.
RESET MASTER;
SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805');
INSERT INTO t1 VALUES (1);
SET GLOBAL binlog_error_action=ABORT_SERVER;
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--error ER_BINLOG_LOGGING_IMPOSSIBLE
INSERT INTO t1 VALUES (2);

--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

RESET MASTER;
DROP TABLE t1;

# BUG26035544 Assert that an error was logged to the server error log.
--let $assert_select = Binary logging not possible. Message: Impossible to generate GTID: the integer component reached the maximum value. Restart the server with a new server_uuid. Server is being stopped.
--let $assert_count = 1
--let $assert_text = ER_GNO_EXHAUSTED server is being stopped found in server error log
--source include/assert_grep.inc

Youez - 2016 - github.com/yon3zu
LinuXploit