Server IP : 172.67.216.182 / Your IP : 172.70.142.25 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 : |
# 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 ############################################################# # Author: Serge Kozlov <[email protected]> # Date: 03/17/2008 # Purpose: Testing cluster circular replication based on two # independent channels between two clusters ############################################################# --source include/have_ndb.inc --source suite/ndb_rpl/ndb_master-slave_2ch.inc --source include/have_binlog_format_mixed_or_row.inc --echo # Check server_id and set auto_increment_* variables --echo *** Check server_id of mysqld servers *** --connection master SHOW VARIABLES LIKE "server_id"; SET auto_increment_offset = 1; SET auto_increment_increment = 2; --connection master1 SHOW VARIABLES LIKE "server_id"; SET auto_increment_offset = 1; SET auto_increment_increment = 2; --connection slave SHOW VARIABLES LIKE "server_id"; SET auto_increment_offset = 2; SET auto_increment_increment = 2; --connection slave1 SHOW VARIABLES LIKE "server_id"; SET auto_increment_offset = 2; SET auto_increment_increment = 2; --echo # Preparing data. --echo *** Preparing data *** --connection master CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=ndb; let $wait_binlog_event= CREATE TABLE t1; --source include/wait_for_binlog_event.inc --connection master1 --source include/wait_for_binlog_event.inc --connection slave --source include/wait_for_binlog_event.inc --connection slave1 --source include/wait_for_binlog_event.inc --echo # # Testing # --echo *** Basic testing *** # insert data via all hosts --echo Insert rows via all hosts --disable_query_log let $counter= 10; while ($counter) { --connection master INSERT INTO t1(b,c) VALUES('master',1); --connection master1 INSERT INTO t1(b,c) VALUES('master1',1); --connection slave INSERT INTO t1(b,c) VALUES('slave',1); --connection slave1 INSERT INTO t1(b,c) VALUES('slave1',1); dec $counter; } --connection master --enable_query_log # Wait replication between clusters let $wait_condition= SELECT COUNT(*)=40 FROM t1 WHERE c = 1; --source include/wait_condition.inc --connection slave --source include/wait_condition.inc # Check data --echo Check data on both clusters let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; --echo *** Transaction testing *** # Start transaction for one mysqld and do mass of inserts for other. # Do it for for both clusters --connection master BEGIN; --connection slave1 BEGIN; let $counter= 100; --connection master --disable_query_log while ($counter) { --connection master INSERT INTO t1(b,c) VALUES('master',2); --connection master1 INSERT INTO t1(b,c) VALUES('master1',2); --connection slave INSERT INTO t1(b,c) VALUES('slave',2); --connection slave1 INSERT INTO t1(b,c) VALUES('slave1',2); dec $counter; } --connection master --enable_query_log COMMIT; --connection slave1 COMMIT; # Wait replication between clusters --connection master let $wait_condition= SELECT COUNT(*)=400 FROM t1 WHERE c = 2; --source include/wait_condition.inc --connection slave --source include/wait_condition.inc --echo Check data on both clusters let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; # Start transaction and then roll back --connection master BEGIN; --connection slave1 BEGIN; let $counter= 100; --connection master --disable_query_log while ($counter) { --connection master INSERT INTO t1(b,c) VALUES('master',3); --connection master1 INSERT INTO t1(b,c) VALUES('master1',3); --connection slave INSERT INTO t1(b,c) VALUES('slave',3); --connection slave1 INSERT INTO t1(b,c) VALUES('slave1',3); dec $counter; } --connection master --enable_query_log ROLLBACK; --connection slave1 ROLLBACK; # Wait replication between clusters --connection master let $wait_condition= SELECT COUNT(*)=200 FROM t1 WHERE c = 3; --source include/wait_condition.inc --connection slave --source include/wait_condition.inc --echo Check data on both clusters let $diff_tables= master:t1, slave:t1; source include/diff_tables.inc; # Clean up --connection master DROP TABLE IF EXISTS t1; --connection slave # Wait until table is dropped on slave. --let $query= SELECT COUNT(*) FROM t1 --source include/wait_for_query_to_fail.inc --echo --connection master # End of test 5.1 --source suite/ndb_rpl/ndb_master-slave_2ch_end.inc