403Webshell
Server IP : 104.21.38.3  /  Your IP : 104.23.175.104
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/mysql-test/suite/group_replication/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/mysql-test/suite/group_replication/t/gr_certifier_message_same_member.test
################################################################################
# BUG#20776314 THE CERTIFIER BROADCAST THREAD IS PRONE TO CONCURRENCY PROBLEMS
#
# This test fixes the second issue with the bug :
#
# The member_id is introduced in to the member_vector before the member_id is
# checked. This generates the case of a same member sending the message again.
#
# Steps :
# 0. The test requires two servers: M1 and M2.
#
# 1. The test starts with two servers running group_replication, with a debug
#    flag set on one of the server. This debug flag inject duplicate member_id
#    in the members vector to simulate the case of the message being received
#    from a similar source.
#
# 2. After the first garbage collection round the
#    transaction_committed_all_member should be empty on server2 as the garbage
#    collection has not taken place. Here we also assert that the warning of the
#    same member sending the message again is generated.
#
# 3. We then remove the flag (although the code already does that) and rerun
#    the garbage collection. This time the transaction_committed_all_members is
#    not empty on server2.
#
# 4. Clean up.
################################################################################
--source include/big_test.inc
--source include/have_debug.inc
--source ../inc/have_group_replication_plugin.inc
--let $rpl_skip_group_replication_start= 1
--source ../inc/group_replication.inc

set session sql_log_bin=0;
call mtr.add_suppression("The member with address.*has already sent the stable set. Therefore discarding the second message.");
set session sql_log_bin=1;

--connection server1
SET @debug_save= @@GLOBAL.DEBUG;
SET @@GLOBAL.DEBUG= '+d,certifier_inject_duplicate_certifier_data_message';
--source ../inc/start_and_bootstrap_group_replication.inc

--connection server2
--source include/start_group_replication.inc

--echo ############################################################
--echo # Execute a transaction on the server1 which is propagated to the
--echo # second server and applied on both of them.
--connection server1
CREATE TABLE t1(i INT PRIMARY KEY);
--source include/rpl_sync.inc

--echo # Start the first round of garbage collection here. Since we have set the DBUG
--echo # flag on the second server we expect a message to be logged in the error log
--echo # as the same member sent the message.
--connection server2
--let $wait_timeout= 65
--let $wait_condition= SELECT Transactions_committed_all_members<>"" FROM performance_schema.replication_group_member_stats
--source include/wait_condition.inc

--echo # Transactions_committed_all_members has 1 transaction from when server 2 joined
--echo # No more info should have been received.
--connection server1
--let $expected_gtid="$group_replication_group_name:1"
--let $transactions_committed_all_members= query_get_value(SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats, Transactions_committed_all_members, 1)
--let $assert_text= Transactions committed on all members should only contain 1 transaction
--let $assert_cond= "$transactions_committed_all_members"= $expected_gtid
--source include/assert.inc

--echo # Asserting that the warning was indeed thrown.
--let $grep_file=$MYSQLTEST_VARDIR/tmp/group_replication_certifier_same_message.err
--let $grep_pattern=Therefore discarding the second message
--let $grep_output= print_count
--source include/grep_pattern.inc

INSERT INTO t1 VALUES(1);
--echo # Checking that the garbage collection is working fine.
--let $wait_timeout= 65
--let $wait_condition= SELECT Transactions_committed_all_members<>$expected_gtid FROM performance_schema.replication_group_member_stats
--source include/wait_condition.inc

--connection server1
SET @@GLOBAL.DEBUG= @debug_save;
DROP TABLE t1;
--source ../inc/group_replication_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit