mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
Support for galera GTID consistency thru cluster. All nodes in cluster should have same GTID for replicated events which are originating from cluster. Cluster originating commands need to contain sequential WSREP GTID seqno Ignore manual setting of gtid_seq_no=X. In master-slave scenario where master is non galera node replicated GTID is replicated and is preserved in all nodes. To have this - domain_id, server_id and seqnos should be same on all nodes. Node which bootstraps the cluster, to achieve this, sends domain_id and server_id to other nodes and this combination is used to write GTID for events that are replicated inside cluster. Cluster nodes that are executing non replicated events are going to have different GTID than replicated ones, difference will be visible in domain part of gtid. With wsrep_gtid_domain_id you can set domain_id for WSREP cluster. Functions WSREP_LAST_WRITTEN_GTID, WSREP_LAST_SEEN_GTID and WSREP_SYNC_WAIT_UPTO_GTID now works with "native" GTID format. Fixed galera tests to reflect this chances. Add variable to manually update WSREP GTID seqno in cluster Add variable to manipulate and change WSREP GTID seqno. Next command originating from cluster and on same thread will have set seqno and cluster should change their internal counter to it's value. Behavior is same as using @@gtid_seq_no for non WSREP transaction.
50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
#
|
|
# Test that GRA_* files are generated on applier failure and are readable.
|
|
#
|
|
|
|
--source include/galera_cluster.inc
|
|
--source include/have_innodb.inc
|
|
|
|
# Save original auto_increment_offset values.
|
|
--let $node_1=node_1
|
|
--let $node_2=node_2
|
|
--source include/auto_increment_offset_save.inc
|
|
|
|
--connection node_2
|
|
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
|
|
let $restore_wsrep_ignore_apply_errors = `SELECT @@GLOBAL.wsrep_ignore_apply_errors`;
|
|
SET GLOBAL wsrep_ignore_apply_errors=0;
|
|
|
|
# Create applier failure
|
|
SET SESSION wsrep_on=OFF;
|
|
CREATE TABLE t1 (f1 INTEGER);
|
|
|
|
--connection node_1
|
|
CREATE TABLE t1 (f1 INTEGER);
|
|
|
|
# node 2 should detect an error and leave the cluster
|
|
--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
|
--source include/wait_condition.inc
|
|
|
|
--connection node_2
|
|
--let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
|
|
--source include/wait_condition.inc
|
|
|
|
# Make sure the GRA file produced is readable and contains the failure
|
|
|
|
--replace_regex /SET TIMESTAMP=[0-9]+/SET TIMESTAMP=<TIMESTAMP>/ /pseudo_thread_id=[0-9]+/pseudo_thread_id=<PSEUDO_THREAD_ID>/
|
|
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log
|
|
|
|
# restart and reconnect node_2
|
|
--source include/kill_galera.inc
|
|
--source include/wait_until_disconnected.inc
|
|
--source include/start_mysqld.inc
|
|
|
|
--eval SET GLOBAL wsrep_ignore_apply_errors = $restore_wsrep_ignore_apply_errors
|
|
DROP TABLE t1;
|
|
|
|
CALL mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on");
|
|
|
|
# Restore original auto_increment_offset values.
|
|
--source include/auto_increment_offset_restore.inc
|