mariadb/mysql-test/suite/rpl/t/rpl_mdev10863.test
Michael Widenius d6d63f4844 MDEV-16421 Make system tables crash safe
Make all system tables in mysql directory of type
engine=Aria

Privilege tables are using transactional=1
Statistical tables are using transactional=0, to allow them
to be quickly updated with low overhead.
Help tables are also using transactional=0 as these are only
updated at init time.

Other changes:
- Aria store engine is now a required engine
- Update comment for Aria tables to reflect their new usage
- Fixed that _ma_reset_trn_for_table() removes unlocked table
  from transaction table list. This was needed to allow one
  to lock and unlock system tables separately from other
  tables, for example when reading a procedure from mysql.proc
- Don't give a warning when using transactional=1 for engines
  that is using transactions. This is both logical and also
  to avoid warnings/errors when doing an alter of a privilege
  table to InnoDB.
- Don't abort on warnings from ALTER TABLE for changes that
  would be accepted by CREATE TABLE.
- New created Aria transactional tables are marked as not movable
  (as they include create_rename_lsn).
- bootstrap.test was changed to kill orignal server, as one
  can't anymore have two servers started at same time on same
  data directory and data files.
- Disable maria.small_blocksize as one can't anymore change
  aria block size after system tables are created.
- Speed up creation of help tables by using lock tables.
- wsrep_sst_resync now also copies Aria redo logs.
2018-08-14 12:18:38 +03:00

105 lines
2.6 KiB
Text

--source include/have_innodb.inc
--let $rpl_topology=1->2
--source include/rpl_init.inc
# Test various aspects of parallel replication.
--connection server_2
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
SET @old_max_relay= @@GLOBAL.max_relay_log_size;
SET GLOBAL max_relay_log_size = 4096;
CHANGE MASTER TO master_use_gtid=slave_pos;
--source include/start_slave.inc
--connection server_1
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b VARCHAR(100)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, "a");
--save_master_pos
--connection server_2
--sync_with_master
--echo *** Create a long transaction that will span a relay log file. ***
--connection server_1
# Add some transactions in separate domains, that will cause the need to
# have a multi-valued restart position in the relay log for the SQL thread.
SET @old_domain= @@gtid_domain_id;
SET gtid_domain_id=10;
INSERT INTO t1 VALUES (10000, "domain 10");
SET gtid_domain_id=20;
INSERT INTO t1 VALUES (20000, "domain 20");
SET gtid_domain_id=@old_domain;
BEGIN;
--echo [lots of inserts omitted]
--disable_query_log
--let $count = 500
while ($count) {
eval INSERT INTO t1 VALUES (1000+$count, REPEAT("hulubulu??!?", 8));
dec $count;
}
--enable_query_log
COMMIT;
--save_master_pos
--connection server_2
--sync_with_master
--connection server_1
# Now do another one, to make the inuse_relaylog proceed to somewhere inside
# the first large transaction.
BEGIN;
--echo [lots of inserts omitted]
--disable_query_log
--let $count = 500
while ($count) {
eval INSERT INTO t1 VALUES (2000+$count, REPEAT("hulubulu??!?", 8));
dec $count;
}
--enable_query_log
COMMIT;
--save_master_pos
--connection server_2
--sync_with_master
# Stop and restart the SQL thread only.
# The bug was that the SQL thread would restart at the start
# of a relay log file, which could be in the middle of an event group.
# This way, part of that event group could be wrongly re-applied.
--source include/stop_slave_sql.inc
START SLAVE SQL_THREAD;
--source include/wait_for_slave_to_start.inc
--connection server_1
INSERT INTO t1 VALUES (100000, "More stuffs.");
INSERT INTO t1 VALUES (100001, "And even more");
--save_master_pos
--connection server_2
--sync_with_master
SELECT * FROM t1 WHERE a >= 100000 ORDER BY a;
# Clean up.
--connection server_2
--source include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
SET GLOBAL max_relay_log_size= @old_max_relay;
--source include/start_slave.inc
--connection server_1
ALTER TABLE mysql.gtid_slave_pos ENGINE=Aria;
DROP TABLE t1;
--source include/rpl_end.inc