[MDEV-25024] Document wsrep_mode to disallow local GTID Created: 2021-03-02  Updated: 2021-04-20  Resolved: 2021-04-20

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Galera
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Jan Lindström (Inactive) Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-20715 Implement system variable to disallow... Closed

 Description   

Added a new wsrep_mode feature DISALLOW_LOCAL_GTID for this. 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.

If user has set wsrep_mode=DISALLOW_LOCAL_GTID these operations produce a error ERROR HY000: Galera replication not supported.



 Comments   
Comment by Jan Lindström (Inactive) [ 2021-03-02 ]

Example 1:

MariaDB [test]> CREATE TABLE tab(a int not null primary key) engine=innodb;
Query OK, 0 rows affected (0.040 sec)
 
MariaDB [test]> SET GLOBAL wsrep_mode = DISALLOW_LOCAL_GTID;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> SET SESSION wsrep_OSU_method='RSU';
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [test]> ALTER TABLE tab FORCE;
ERROR 4165 (HY000): Galera replication not supported
MariaDB [test]> SHOW WARNINGS;
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                                                                   |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error   | 4165 | Galera replication not supported                                                                                                                                                          |
| Warning | 1290 | You can't execute statements that would generate local GTIDs when wsrep_mode = DISALLOW_LOCAL_GTID is set. Try disabling binary logging with SET sql_log_bin=0 to execute this statement. |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.001 sec)

Comment by Jan Lindström (Inactive) [ 2021-03-02 ]

Example 2:

MariaDB [test]> CREATE TABLE tab(a int not null primary key) engine=innodb;
Query OK, 0 rows affected (0.039 sec)
 
MariaDB [test]> SET SESSION wsrep_on=OFF;
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> INSERT INTO tab VALUES (1);
ERROR 4165 (HY000): Galera replication not supported
MariaDB [test]> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                                                                   |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error   | 4165 | Galera replication not supported                                                                                                                                                          |
| Warning | 1290 | You can't execute statements that would generate local GTIDs when wsrep_mode = DISALLOW_LOCAL_GTID is set. Try disabling binary logging with SET sql_log_bin=0 to execute this statement. |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.001 sec)

Comment by Jan Lindström (Inactive) [ 2021-03-02 ]

Example 3:

MariaDB [test]> CREATE TABLE tab1(a int not null primary key) engine=MyISAM;
Query OK, 0 rows affected (0.021 sec)
 
MariaDB [test]> INSERT INTO tab1 VALUES (1);
ERROR 4165 (HY000): Galera replication not supported
MariaDB [test]> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                                                                   |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error   | 4165 | Galera replication not supported                                                                                                                                                          |
| Warning | 1290 | You can't execute statements that would generate local GTIDs when wsrep_mode = DISALLOW_LOCAL_GTID is set. Try disabling binary logging with SET sql_log_bin=0 to execute this statement. |
+---------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.001 sec)
 
MariaDB [test]> SET GLOBAL wsrep_mode='DISALLOW_LOCAL_GTID,REPLICATE_MYISAM';
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> INSERT INTO tab1 VALUES (1);
Query OK, 1 row affected (0.021 sec)

Comment by Ian Gilfillan [ 2021-04-20 ]

Was documented at https://mariadb.com/kb/en/galera-cluster-system-variables/#wsrep_mode

Generated at Thu Feb 08 09:34:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.