1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00
Files
mariadb/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test
Andrei Elkin 176a788105 Bug #41732 rpl_ndb_circular_2ch needs an updated configuration file
There are two issues: 
      1. 6.0 uses the obsolate master-*** server options;
      2. the test is not deterministic in that although master vs slave consistency is
         fine, two runs of the test can have different results. The reason of the
         non-determinism is the combination of 
         a chosen way to demo results and the ndb_autoincrement_prefetch_sz feature.

The current patch fixes the 2nd issue by putting out results via diff_table macro
instead of the former run-sensitive method.
The 1st issue is going to be fixed by a separate patch to 6.0.
2009-02-02 22:31:01 +02:00

173 lines
4.1 KiB
Plaintext

#############################################################
# Author: Serge Kozlov <skozlov@mysql.com>
# Date: 03/17/2008
# Purpose: Testing cluster circular replication based on two
# independent channels between two clusters
#############################################################
--source include/have_ndb.inc
--source include/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_table_1=master:test.t1;
let $diff_table_2=slave:test.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_table_1=master:test.t1;
let $diff_table_2=slave:test.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_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
# Clean up
--connection master
DROP TABLE t1;
--connection slave
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
--echo
# End of test 5.1