⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
suite
/
rpl
/
t
/
View File Name :
rpl_set_gtid_mode_ongoing_wait_function.test
# ==== Purpose ==== # # 1) Test that it is not allowed to execute SET GTID_MODE = OFF when # there is an ongoing call to WAIT_FOR_EXECUTED_GTID_SET or # WAIT_FOR_EXECUTED_GTID_SET. # # ==== Implementation ==== # # Execute three iterations: # - In iterations 1 and 2, use WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS. # - In iterations 2 and 3, use WAIT_FOR_EXECUTED_GTID_SET. # # In each iteration, check that it is not allowed to set GTID_MODE=OFF # while the wait function is waiting; and check that it is allowed to # set all the other GTID_MODEs. In iteration 2, additionally check # that SET GTID_MODE=OFF is disallowed after releasing one of the # waiting threads. # # 2) Test that SELECT WAIT_FOR_EXECUTED_GTID_SET() gives an error if # gtid-mode=off. # Test sets GTID_MODE explicitly, so only meaningful to run in one GTID_MODE. --source include/not_gtid_enabled.inc # Not meaningful to run in more than one binlog_format. --source include/have_binlog_format_row.inc --source include/have_debug_sync.inc --source include/master-slave.inc --let $uuida= aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa --connection slave SET GLOBAL ENFORCE_GTID_CONSISTENCY = ON; --connection master SET GLOBAL ENFORCE_GTID_CONSISTENCY = ON; SET GLOBAL GTID_MODE = OFF_PERMISSIVE; --let $i= 0 while ($i < 3) { --echo ==== Iteration $i ==== # Set GTID_MODE --connection slave SET GLOBAL GTID_MODE = OFF_PERMISSIVE; SET GLOBAL GTID_MODE = ON_PERMISSIVE; SET GLOBAL GTID_MODE = ON; # Begin to wait. if ($i < 2) { --connection server_2 --let $id= `SELECT CONNECTION_ID()` # Multiply by 0 since the return value is nondeterministic. --send eval SELECT WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS('$uuida:1$i') * 0; --connection slave --let $wait_condition= SELECT COUNT(*) = 1 FROM performance_schema.threads WHERE PROCESSLIST_ID = $id AND PROCESSLIST_STATE = 'Waiting for the slave SQL thread to advance position' --source include/wait_condition_or_abort.inc } if ($i > 0) { --connection server_2_1 --let $id= `SELECT CONNECTION_ID()` SET @@SESSION.DEBUG_SYNC = 'begin_wait_for_executed_gtid_set SIGNAL reached_wait_function'; --send eval SELECT WAIT_FOR_EXECUTED_GTID_SET('$uuida:2$i'); --connection slave # Doesn't work because of BUG#20451305. #--let $wait_condition= SELECT COUNT(*) = 1 FROM performance_schema.threads WHERE PROCESSLIST_ID = $id AND PROCESSLIST_STATE = 'waiting for GTID to be written to binary log' #--source include/wait_condition_or_abort.inc SET @@SESSION.DEBUG_SYNC = 'now WAIT_FOR reached_wait_function'; } # Check that all GTID_MODEs except OFF are allowed. --connection slave SET GLOBAL GTID_MODE = ON; SET GLOBAL GTID_MODE = ON_PERMISSIVE; SET GLOBAL GTID_MODE = ON_PERMISSIVE; SET GLOBAL GTID_MODE = OFF_PERMISSIVE; SET GLOBAL GTID_MODE = OFF_PERMISSIVE; --error ER_CANT_SET_GTID_MODE SET GLOBAL GTID_MODE = OFF; # Release the waiters. if ($i < 2) { --connection master eval SET GTID_NEXT = '$uuida:1$i'; COMMIT; SET GTID_NEXT = 'AUTOMATIC'; --source include/sync_slave_sql_with_master.inc --connection server_2 --reap } # If $i==1, we released one waiter and the other is still ongoing, # so setting OFF is still an error. if ($i == 1) { --error ER_CANT_SET_GTID_MODE SET GLOBAL GTID_MODE = OFF; } if ($i > 0) { eval SET GTID_NEXT = '$uuida:2$i'; COMMIT; SET GTID_NEXT = 'AUTOMATIC'; --connection server_2_1 --reap } --connection slave SET GLOBAL GTID_MODE = OFF; --inc $i } --connection master SET GLOBAL GTID_MODE = OFF; --source include/sync_slave_sql_with_master.inc --echo # --echo # Test that SELECT WAIT_FOR_EXECUTED_GTID_SET() gives an error if --echo # gtid-mode=off. --echo # --error ER_GTID_MODE_OFF eval SELECT WAIT_FOR_EXECUTED_GTID_SET('master_uuid', 1-2); --connection slave SET GLOBAL ENFORCE_GTID_CONSISTENCY = OFF; --connection master SET GLOBAL ENFORCE_GTID_CONSISTENCY = OFF; --source include/rpl_end.inc