Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
It is possible to use Galera Cluster with replication. For example:
However, if the slave of the Galera Cluster needs to fail over to a new master node, then that can be complicated by the fact that the different nodes may have different GTID positions due to local transactions.
Nodes can have GTIDs for local transactions in the following scenarios:
- A DDL statement is executed with wsrep_OSU_method=RSU set.
- A DML statement writes to a non-InnoDB table.
- A DML statement writes to an InnoDB table with wsrep_on=OFF set.
We may want to come up with a way to disallow any statements that would cause local GTIDs in Galera Cluster.
For example, we could implement a new system variable called wsrep_disallow_local_gtids. If a user tries to execute a statement that would cause a local GTID, then it could trigger an error. For example:
SET GLOBAL wsrep_disallow_local_gtids=ON;
|
Query OK, 0 rows affected (0.000 sec)
|
|
SET SESSION wsrep_OSU_method='RSU';
|
Query OK, 0 rows affected (0.000 sec)
|
|
ALTER TABLE tab FORCE;
|
ERROR X (Y): You can't execute statements that would generate local GTIDs when
|
wsrep_disallow_local_gtids is set. Try disabling binary logging with "SET sql_log_bin=0"
|
to execute this statement.
|
Or:
SET GLOBAL wsrep_disallow_local_gtids=ON;
|
Query OK, 0 rows affected (0.000 sec)
|
|
SET SESSION wsrep_on=OFF;
|
Query OK, 0 rows affected (0.000 sec)
|
|
INSERT INTO innodb_tab VALUES (1, 'str');
|
ERROR X (Y): You can't execute statements that would generate local GTIDs when
|
wsrep_disallow_local_gtids is set. Try disabling binary logging with "SET sql_log_bin=0"
|
to execute this statement.
|
But users could still work around this by disabling binary logging. For example:
SET GLOBAL wsrep_disallow_local_gtids=ON;
|
Query OK, 0 rows affected (0.000 sec)
|
|
SET SESSION wsrep_on=OFF;
|
Query OK, 0 rows affected (0.000 sec)
|
|
SET SESSION sql_log_bin=0;
|
Query OK, 0 rows affected (0.000 sec)
|
|
INSERT INTO innodb_tab VALUES (1, 'str');
|
Query OK, 1 rows affected (0.000 sec)
|
Attachments
Issue Links
- relates to
-
MDEV-20720 Galera: Replicate MariaDB GTID to other nodes in the cluster
- Closed
-
MDEV-22905 Support DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS in replication handshake
- Closed
-
MDEV-25024 Document wsrep_mode to disallow local GTID
- Closed
-
MXS-2580 Clarify requirements of binlog router secondary masters
- Closed