403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.164.119
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/extra/rpl_tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/extra/rpl_tests/rpl_ignore_super_read_only.test
# ==== Purpose ====
#
# Verify that we permit replication operations with super_read_only=ON.
#
# ==== Implementation ====
#
# 1) SET GLOBAL super_read_only to 1 on slave
# 2) Execute 'STOP SLAVE' command
# 3) Execute 'CHANGE REPLICATION FILTER' command
# 4) Execute 'CHANGE MASTER TO' command
# 5) Execute 'RESET SLAVE FOR CHANNEL <channel_name>' command
# 7) Execute 'RESET SLAVE ALL FOR CHANNEL <channel_name>' command
# 8) Execute 'RESET SLAVE' command
# 9) Execute 'START SLAVE' command
# 10) Execute 'RESET MASTER' command (with GTID_MODE=ON will assert)
# 11) Execute 'FLUSH BINARY LOGS' command (with GTID_MODE=ON will assert)
# 12) Execute 'SET GLOBAL gtid_purged='aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:1''
# command
# 13) Restart Slave and verify that slave_master_info table is updated during
#     shutdown.
# 14) Check that replication works fine
# 15) Restore GLOBAL super_read_only to 0
#
# ==== References ====
#
# Bug#22097534: SUPER_READ_ONLY ABORTS STOP SLAVE IF
#               RELAY_LOG_INFO_REPOSITORY=TABLE, DBG CRASH
# Bug#22857926: ASSERTION `! IS_SET()' AT SQL_ERROR.CC:38 IN READ_ONLY MODE FOR
#               MANY RPL CMDS.
# Bug#26414532: MYSQLRPLSYNC ERRORS OUT BECAUSE SLAVE IS USING --SUPER-READ-ONLY
#               OPTION
# Bug#27675107: SUPER_READ_ONLY WITH MASTER_INFO_REPOSITORY=TABLE BREAKS
#               REPLICATION ON RESTART

if (!$autocommit_opt)
{
    --die !!!ERROR IN TEST: you must set $autocommit_opt
}

--source include/rpl_connection_master.inc
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1);
DROP TABLE t1;
--source include/sync_slave_sql_with_master.inc

--let $saved_value_super= `SELECT @@GLOBAL.super_read_only`
--let $saved_value= `SELECT @@GLOBAL.read_only`
--let $saved_autocommit= `SELECT @@GLOBAL.autocommit`
SET GLOBAL super_read_only= 1;
--eval SET AUTOCOMMIT= $autocommit_opt
SHOW VARIABLES like '%autocommit%';

--echo ####################################################################
--echo # Test Case1: STOP SLAVE command
--echo ####################################################################
--source include/stop_slave.inc

--echo ####################################################################
--echo # Test Case2: CHANGE REPLICATION FILTER command
--echo ####################################################################
CHANGE REPLICATION FILTER REPLICATE_DO_DB=(test);
CHANGE REPLICATION FILTER REPLICATE_DO_DB=();

--echo ####################################################################
--echo # Test Case3: CHANGE MASTER command
--echo ####################################################################
CHANGE MASTER TO MASTER_CONNECT_RETRY=20;
CHANGE MASTER TO MASTER_HOST='dummy' FOR CHANNEL 'aaa';

--echo ####################################################################
--echo # Test Case4: RESET SLAVE FOR CHANNEL/RESET SLAVE ALL/RESET SLAVE
--echo # commands
--echo ####################################################################
RESET SLAVE FOR CHANNEL 'aaa';
RESET SLAVE ALL FOR CHANNEL 'aaa';
RESET SLAVE;

--echo ####################################################################
--echo # Test Case5: START SLAVE command
--echo ####################################################################
--source include/start_slave.inc
--source include/rpl_connection_master.inc
--source include/sync_slave_sql_with_master.inc

# Check that mysql.gtid_executed table is empty.
--let $assert_text= mysql.gtid_executed table must have zero records
--let $assert_cond= [SELECT count(*) FROM mysql.gtid_executed] = 0
--source include/assert.inc

--echo ####################################################################
--echo # Test Case6: FLUSH BINARY LOGS command
--echo ####################################################################
# FLUSH BINARY LOGS asserts when it is trying to update gtid_executed table
# during binary log rotation.
FLUSH BINARY LOGS;

# Check that an entry is updated in gtid_executed table without causing any
# assert.
--disable_query_log
if ( `SELECT @@GLOBAL.GTID_MODE = "ON"` )
{
    --let $table=mysql.gtid_executed
    --let $count=1
    --source include/wait_until_rows_count.inc
}
--enable_query_log

--echo ####################################################################
--echo # Test Case7: RESET MASTER command
--echo ####################################################################
RESET MASTER;

--echo ####################################################################
--echo # Test Case8: SET GLOBAL GTID_PURGED command
--echo ####################################################################
--let $master_uuid=`SELECT @@SERVER_UUID`
--replace_result $master_uuid MASTER_UUID
--eval SET GLOBAL gtid_purged= '$master_uuid:1'

--echo ####################################################################
--echo # Test Case9: Server Restart
--echo ####################################################################

# Restart Slave and verify that slave_master_info table is updated during shutdown.
--let $io_pos_before_restart = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1)
--let $rpl_server_number = 2
--source include/rpl_restart_server.inc
--let $io_pos_after_restart = query_get_value("SHOW SLAVE STATUS", Read_Master_Log_Pos, 1)

# Assert that IO thread Read_Master_Log_Pos before and after restart are same.
--let $assert_text= Read_Master_Log_Pos before and after restart are same.
--let $assert_cond= $io_pos_before_restart = $io_pos_after_restart
--source include/assert.inc

# Restart slave threads
--source include/start_slave.inc
--source include/rpl_connection_master.inc
--source include/sync_slave_sql_with_master.inc

--echo "Clean up"
# Reset slave to clean state
--replace_result $saved_autocommit SAVED_AUTOCOMMIT
--eval SET AUTOCOMMIT= $saved_autocommit
--replace_result $saved_value_super SAVED_SUPER_READ_ONLY
--eval SET GLOBAL super_read_only= $saved_value_super
--replace_result $saved_value SAVED_READ_ONLY
--eval SET GLOBAL read_only= $saved_value

# Start fresh slave
--source include/stop_slave.inc
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 2 ####
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root'
--source include/start_slave.inc

--source include/rpl_connection_master.inc
--source include/sync_slave_sql_with_master.inc

--source include/rpl_reset.inc

Youez - 2016 - github.com/yon3zu
LinuXploit