403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.69.176.134
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/rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/rpl/t/rpl_mts_logical_clock_crash.test
--source include/not_group_replication_plugin.inc
--source include/have_debug.inc
--source include/have_innodb.inc
--source include/master-slave.inc
################################################################################
# Bug#18363515 MULTIPLE THREADED SLAVE MAY BE CRASHED BY STOP SLAVE SQL
#
# Worker error will crash MTS if coordinator is waiting for a free worker to
# dispatch next event. The crash happens because the caller of
# Mts_submode_logical_clock::get_least_occupied_worker() supposes it always
# return a valid worker. But that is not true. It may turn NULL when
# coordinator is aborted at the same time seeing a Worker has failed.
################################################################################
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE = InnoDB;
CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE = InnoDB;
--source include/sync_slave_sql_with_master.inc
--source include/stop_slave_sql.inc

--source include/rpl_connection_master.inc
SET @save_debug = @@GLOBAL.debug;

# make the following transactions to have a common commit parent
# so be parallelizable on slave.
SET GLOBAL debug = "d,set_commit_parent_100";

INSERT INTO t2 VALUES(99); # just a warmup load
BEGIN;
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
COMMIT;

BEGIN;
INSERT INTO t1 VALUES(3);
INSERT INTO t1 VALUES(4);
COMMIT;
# This one will force coordinator to wait for a free worker.
INSERT INTO t1 VALUES(5);

SET GLOBAL debug = @save_debug;
--source include/save_master_pos.inc

--source include/rpl_connection_slave.inc
SET @save_slave_parallel_type = @@GLOBAL.slave_parallel_type;
SET @save_slave_parallel_workers = @@GLOBAL.slave_parallel_workers;
SET @save_slave_transaction_retries = @@GLOBAL.slave_transaction_retries;

SET GLOBAL slave_parallel_type = LOGICAL_CLOCK;
SET GLOBAL slave_parallel_workers = 2;
SET GLOBAL slave_transaction_retries = 0;

# Inserts an offending row into slave's db. A worker will fail with
# the duplicate key error when applying master's transaction.
INSERT INTO t1 VALUES(1);

CALL mtr.add_suppression("Worker . Failed executing transaction.*");
CALL mtr.add_suppression(".*coordinator and worker threads are stopped.*");

# Block workers and make coordinator to wait for a free worker
LOCK TABLE t1 WRITE;

--let $rpl_connection_name= server_2
--source include/rpl_connection.inc
--source include/sync_slave_io.inc
--source include/start_slave_sql.inc

# Wait until coordinator already dispatches events to both workers.
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= = 'Waiting for table metadata lock'
--source include/wait_show_condition.inc

# Wait unti coordinator enters the wait status.
--let $show_statement= SHOW PROCESSLIST
--let $field= State
--let $condition= = 'Waiting for slave workers to process their queues'
--source include/wait_show_condition.inc

# Release metadata lock on t1, so workers can go ahead.
--source include/rpl_connection_slave.inc
UNLOCK TABLES;

# Workers encounter duplicate error and abort coordinator
--let $slave_sql_errno= convert_error(ER_DUP_ENTRY)
--source include/wait_for_slave_sql_to_stop.inc

SET GLOBAL slave_parallel_workers = @save_slave_parallel_workers;
SET GLOBAL slave_parallel_type = @save_slave_parallel_type;
SET GLOBAL slave_transaction_retries = @save_slave_transaction_retries;
# Remove the duplicate key from slave's db.
TRUNCATE t1;
--source include/start_slave_sql.inc

--source include/rpl_connection_master.inc
DROP TABLE t1;
DROP TABLE t2;
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit