403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.242.43
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/ndb_rpl/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb_rpl/t/ndb_rpl_batch.test
--source include/have_ndb.inc
--source include/have_binlog_format_mixed_or_row.inc
--source suite/ndb_rpl/ndb_master-slave.inc

#
# Simple test to check that slave_allow_batching has at least a /2 effect
# on round trips.
# Further testing could be added in the areas of
#  - Correlation of batch size to data written
#  - Slave batching and Blobs
#  - Slave batching and hidden/autoinc keys
#  - Batching within a multi-image event with 
#    slave_allow_batching=OFF
#

--connection master

use test;

--echo Create a couple of tables to defeat Binlog Injector's
--echo creation of multi-image events which can be batch-applied
--echo on the slave regardless of slave_allow_batching

create table t1 (pk int primary key, a varchar(8000)) engine=ndb;
create table t2 (pk int primary key, a varchar(8000)) engine=ndb;

--echo Insert some data which we can later delete
--echo This also serves to 'prime' the Slave, so that NdbApi
--echo access related to slave setup (last_replicated_epoch fetch etc)
--echo can be ignored.

insert into t1 values (1, repeat("I", 80)), (2, repeat("R", 80));

--sync_slave_with_master

--echo First pass with slave_allow_batching OFF
--connection slave
set global slave_allow_batching=OFF;
show variables like 'slave_allow_batching';
#show status like 'ndb_api%slave';
--source ndb_slave_exec_info_init.inc

--connection master

--echo Check out batching
--echo Transaction includes deletes + inserts, and
--echo two different tables, shouldn't be entirely batchable
--echo without slave_allow_batching

begin;
  delete from t1;
  insert into t1 values (3, repeat("I", 80)), (4, repeat("F", 80));
  insert into t2 values (5, repeat("B", 90)), (6, repeat("E", 90));
commit;

--sync_slave_with_master
--connection slave

#show status like 'ndb_api%slave';

--disable_query_log
--disable_result_log
SELECT @start_exec_count:=@init_wait_exec_complete_count_slave;
SELECT @start_pk_op_count:=@init_pk_op_count_slave;
--enable_result_log
--enable_query_log

--source ndb_slave_exec_info_init.inc

--disable_query_log
--disable_result_log
SELECT @batching_off_execs:=@init_wait_exec_complete_count_slave - @start_exec_count AS 'Exec_count';
SELECT @batching_off_pk_ops:=@init_pk_op_count_slave - @start_pk_op_count AS 'Pk_op_count';
--enable_result_log
--enable_query_log

--connection master
delete from t1;
delete from t2;
insert into t1 values (1, repeat("I", 80)), (2, repeat("R", 80));

--sync_slave_with_master
--connection slave
--echo Second pass with slave_allow_batching ON
set global slave_allow_batching=ON;
show variables like 'slave_allow_batching';
#show status like 'ndb_api%slave';
--source ndb_slave_exec_info_init.inc

--connection master

--echo Check out batching
--echo Transaction includes deletes + inserts, and
--echo two different tables, shouldn't be batchable
--echo without slave_allow_batching

begin;
  delete from t1;
  insert into t1 values (3, repeat("I", 80)), (4, repeat("F", 80));
  insert into t2 values (5, repeat("B", 90)), (6, repeat("E", 90));
commit;

--sync_slave_with_master
--connection slave

#show status like 'ndb_api%slave';

--echo Determine slave activity in terms of PK ops and execute() calls
--disable_query_log
--disable_result_log
SELECT @start_exec_count:=@init_wait_exec_complete_count_slave;
SELECT @start_pk_op_count:=@init_pk_op_count_slave;
--enable_result_log 
--enable_query_log

--source ndb_slave_exec_info_init.inc

--disable_query_log
--disable_result_log
SELECT @batching_on_execs:=@init_wait_exec_complete_count_slave - @start_exec_count AS 'Exec_count';
SELECT @batching_on_pk_ops:=@init_pk_op_count_slave - @start_pk_op_count AS 'Pk_op_count';
--enable_result_log 
--enable_query_log

--echo Check that test compared like-for-like, and that slave_allow_batching
--echo came out ahead by a factor of at least 2.
SELECT @batching_on_pk_ops = @batching_off_pk_ops AS 'Fair contest';
SELECT @batching_off_pk_ops >=4 as 'Batching can improve matters';
SELECT @batching_on_execs * 2 < @batching_off_execs AS 'slave_allow_batching works';

--echo Cleanup
--connection master
drop table t2;
drop table t1;
--sync_slave_with_master
--connection master

--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit