403Webshell
Server IP : 172.67.216.182  /  Your IP : 104.23.175.128
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_writeset_add_unique_key.test
# ==== Purpose ====
#
# This test verifies that when binlog_row_image=minimum and a table has
# both unique + primary key then there should not be any conflict running
# the transactions on this table on the soure and replica.
#
# ==== Requirements ====
# R1. In case of binlog_row_image=minimum, when generating read_sets and
# writesets, we should include unique key also such that transaction dependencies
# are calculated correctly and transactions do not fail on replica while running
# in parallel.
#
# ==== Implementation ====
#
# 1) Create source-replica topology.
# 2) Save the current variable values.
#    2.1) Save current binlog_row_image.
#    2.2) Save current tracking mode and extraction algorithm.
# 3) Setup neccesary variables on source.
#    3.1) Set the binlog_row_image to MINIMAL on source.
#    3.2) Set the global transaction extraction algorithm to XXHASH64
#         and the tracking mode to WRITESET.
# 4) Create table and procedure on source.
# 5) Switch to source and call procedure.
# 6) Clear system variables on source.
# 7) Cleanup.
#
# ==== References ====
#
# Bug#31636339 MTS IS UNUSABLE; ERRNO 3030, AND WORKER HA_ERR_FOUND_DUPP_KEY OR HA_ERR_LOCK_WAIT_TIMEOUT
#
--source include/have_binlog_format_row.inc
--source include/only_mts_slave_parallel_type_logical_clock.inc
--source include/only_mts_slave_parallel_workers.inc
--let $option_name = slave_transaction_retries
--let $option_operator = >
--let $option_value = 2
--source include/only_with_option.inc

--echo #
--echo # 1. Create source-replica topology.
--source include/master-slave.inc

--echo #
--echo # 2. Save the current variable values.
# 2.1. Save binlog_row_image value.
SET @old_binlog_row_image= @@binlog_row_image;
--source include/rpl_connection_master.inc

# 2.2. Save the current tracking mode and extraction algorithm.
--let $old_trx_tracker = `SELECT @@GLOBAL.BINLOG_TRANSACTION_DEPENDENCY_TRACKING`
--let $old_trx_write_set_extraction_session = `SELECT @@SESSION.TRANSACTION_WRITE_SET_EXTRACTION`
--let $old_trx_write_set_extraction_global = `SELECT @@GLOBAL.TRANSACTION_WRITE_SET_EXTRACTION`

--echo # 3. Setup neccesary variables on source.
--echo # 3.1 Set the binlog_row_image to MINIMAL on source.
--let $row_img_set=master:MINIMAL:N
--source include/rpl_row_img_set.inc

# 3.2 Set the global transaction extraction algorithm and tracking mode.
SET GLOBAL TRANSACTION_WRITE_SET_EXTRACTION = 'XXHASH64';
SET SESSION TRANSACTION_WRITE_SET_EXTRACTION = 'XXHASH64';
SET GLOBAL BINLOG_TRANSACTION_DEPENDENCY_TRACKING = WRITESET;

--echo #
--echo # 4. Create table and procedure on source.
CREATE TABLE t( a tinyint unsigned primary key, b tinyint, c int, d bigint,
f char(10), g char(255), h text, i longtext, unique key(g,f),
unique key(f,c), key(c,d,b), key(i(10),f(10),b)) ENGINE=InnoDB;

drop procedure if exists p;
delimiter |;
create procedure p(p_i bigint)
begin
  declare v_i bigint default 0;
  repeat
    replace into t values(
    floor(rand()*5),floor(rand()*5),floor(rand()*5),floor(rand()*5),
    floor(rand()*5),floor(rand()*5),floor(rand()*5),floor(rand()*5)
    ),
    (
    floor(rand()*5),floor(rand()*5),floor(rand()*5),floor(rand()*5),
    floor(rand()*5),floor(rand()*5),floor(rand()*5),floor(rand()*5)
    );
    set v_i=v_i+1;
  until v_i > p_i end repeat;
end|
delimiter ;|

--echo #
--echo #
--echo # 5. Switch to source and call procedure.
--source include/rpl_connection_master.inc
call p(1000);
# Sync replica's sql thread with source.
--source include/sync_slave_sql_with_master.inc

--echo #
--echo # 6. Clear system variables on source.
--echo #
--source include/rpl_connection_master.inc
SET GLOBAL binlog_row_image= @old_binlog_row_image;
SET SESSION binlog_row_image= @old_binlog_row_image;
--replace_result $old_trx_tracker OLD_TRX_TRACKER
--eval SET GLOBAL BINLOG_TRANSACTION_DEPENDENCY_TRACKING = $old_trx_tracker
--replace_result $old_trx_write_set_extraction_global OLD_TRX_WRITE_SET_EXTRACTION_GLOBAL
--eval SET GLOBAL TRANSACTION_WRITE_SET_EXTRACTION = $old_trx_write_set_extraction_global
--replace_result $old_trx_write_set_extraction_session OLD_TRX_WRITE_SET_EXTRACTION_SESSION
--eval SET SESSION TRANSACTION_WRITE_SET_EXTRACTION = $old_trx_write_set_extraction_session

# Supress the error warning on slave.
--source include/rpl_connection_slave.inc
CALL mtr.add_suppression("Worker .* failed executing transaction.*");

# 7. Cleanup.
--source include/rpl_connection_master.inc
DROP TABLE t;
DROP PROCEDURE p;
--source include/rpl_end.inc


Youez - 2016 - github.com/yon3zu
LinuXploit