403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.164.61
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_lock_tables_unblock.test
################################################################################
# This test verifies that during in GR the set super_read_only is blocked
# due to a table being locked. Subsequently, an unlock of the table in another
# connection will unblock the setting of super_read_only mode and the recovery
# proceeds further.
#
# Test:
# 0. The test requires two servers: M1 and M2.
# 1. With both members ONLINE. Group replication is then blocked on one of
#    the node M1.
# 2. Add some data on the remaining member of the GROUP.
# 3. On the member which is not a member of the GROUP lock the table and start
#    GR so that it enters the recovering stage. This should be blocked as the
#    set super_read_only cannot execute further.
# 4. In another connection unlock the tables and see that the recovery proceeds
#    and the data exists on the two members.
# 5. Clean up.
################################################################################

--source include/not_windows.inc
--source ../inc/have_group_replication_plugin.inc
--source ../inc/group_replication.inc

--connection server2
CREATE TABLE t1 (i INT PRIMARY KEY);
--source include/rpl_sync.inc

--connection server1
--source include/stop_group_replication.inc

--connection server2
INSERT INTO t1 VALUES(1);

--echo # Add lock tables here to block setting super_read_only mode on server.
--connection server_1
LOCK TABLE t1 WRITE;

--echo # Start GR on the server. It should be blocked as we have a table locked.
--connection server1
--disable_query_log
--eval SET GLOBAL group_replication_group_name= "$group_replication_group_name"
--enable_query_log
--send START GROUP_REPLICATION

--echo # Ensure that the server is actually blocked while setting the
--echo # super_read_only mode.
--let $rpl_connection_name= server_1_1
--source include/rpl_connection.inc
--let $wait_condition=SELECT COUNT(*)=1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE State = 'Waiting for global read lock' and Info = 'PLUGIN: SET GLOBAL super_read_only= 1'
--source include/wait_condition.inc

--connection server_1
UNLOCK TABLES;

--connection server1
--reap

--let $group_replication_member_state= ONLINE
--source ../inc/gr_wait_for_member_state.inc

--echo # Add ASSERT to check that the recovery passes successfully and a row
--echo # is inserted.
--let $assert_text= There should be one row inserted in the table.
--let $assert_cond= [SELECT COUNT(*) FROM t1] = 1
--source include/assert.inc

--echo # Cleanup
DROP TABLE t1;

--source ../inc/group_replication_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit