[MDEV-9855] log_slave_updates is required for wsrep_gtid_mode Created: 2016-03-31  Updated: 2019-05-23  Resolved: 2019-05-23

Status: Closed
Project: MariaDB Server
Component/s: Galera, Replication
Affects Version/s: 10.1.13
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Jan Lindström (Inactive)
Resolution: Not a Bug Votes: 0
Labels: galera, gtid, replication

Issue Links:
Relates
relates to MDEV-9856 wsrep_gtid_mode requires nodes to hav... Closed
relates to MDEV-20720 Galera: Replicate MariaDB GTID to oth... Closed

 Description   

When wsrep_gtid_mode is ON, transactions replicated via Galera Cluster's replication should increment the GTID in the domain given by wsrep_gtid_domain_id on all nodes. This only seems to happen on all nodes if log_slave_updates is enabled.

For example, let's say that we have a 2-node Galera Cluster:

Node 1:

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'wsrep_gtid%';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| wsrep_gtid_domain_id | 3     |
| wsrep_gtid_mode      | ON    |
+----------------------+-------+
2 rows in set (0.00 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'log_slave_updates';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| log_slave_updates | OFF   |
+-------------------+-------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+-----------------------+
| Variable_name    | Value                 |
+------------------+-----------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-9 |
| gtid_current_pos | 0-1-5,1-1-63334,3-1-9 |
| gtid_slave_pos   |                       |
+------------------+-----------------------+
3 rows in set (0.00 sec)

Node 2:

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'wsrep_gtid%';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| wsrep_gtid_domain_id | 3     |
| wsrep_gtid_mode      | ON    |
+----------------------+-------+
2 rows in set (0.01 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'log_slave_updates';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| log_slave_updates | OFF   |
+-------------------+-------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+-----------------------+
| Variable_name    | Value                 |
+------------------+-----------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-9 |
| gtid_current_pos |                       |
| gtid_slave_pos   |                       |
+------------------+-----------------------+
3 rows in set (0.00 sec)

Now let's see how gtid_binlog_pos changes on each node.

Node 1:

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+------------------------+
| Variable_name    | Value                  |
+------------------+------------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-10 |
| gtid_current_pos | 0-1-5,1-1-63334,3-1-10 |
| gtid_slave_pos   |                        |
+------------------+------------------------+
3 rows in set (0.00 sec)

Node 2:

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+-----------------------+
| Variable_name    | Value                 |
+------------------+-----------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-9 |
| gtid_current_pos |                       |
| gtid_slave_pos   |                       |
+------------------+-----------------------+
3 rows in set (0.00 sec)
 
MariaDB [(none)]> select * from db1.tab1;
+----+------+
| id | str  |
+----+------+
|  1 | str1 |
|  2 | str2 |
+----+------+
2 rows in set (0.00 sec)

Let's try again with log_slave_updates enabled.

Node 1:

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'wsrep_gtid%';
+----------------------+-------+
| Variable_name        | Value |
+----------------------+-------+
| wsrep_gtid_domain_id | 3     |
| wsrep_gtid_mode      | ON    |
+----------------------+-------+
2 rows in set (0.00 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'log_slave_updates';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| log_slave_updates | ON    |
+-------------------+-------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+------------------------+
| Variable_name    | Value                  |
+------------------+------------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-10 |
| gtid_current_pos | 0-1-5,1-1-63334,3-1-10 |
| gtid_slave_pos   |                        |
+------------------+------------------------+
3 rows in set (0.00 sec)
 
MariaDB [(none)]> insert into db1.tab1 values (3, 'str3');
Query OK, 1 row affected (0.01 sec)
 
MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+------------------------+
| Variable_name    | Value                  |
+------------------+------------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-11 |
| gtid_current_pos | 0-1-5,1-1-63334,3-1-11 |
| gtid_slave_pos   |                        |
+------------------+------------------------+
3 rows in set (0.00 sec)

Node 2:

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%pos';
+------------------+------------------------+
| Variable_name    | Value                  |
+------------------+------------------------+
| gtid_binlog_pos  | 0-1-5,1-1-63334,3-1-11 |
| gtid_current_pos |                        |
| gtid_slave_pos   |                        |
+------------------+------------------------+
3 rows in set (0.00 sec)
 
MariaDB [(none)]> select * from db1.tab1;
+----+------+
| id | str  |
+----+------+
|  1 | str1 |
|  2 | str2 |
|  3 | str3 |
+----+------+
3 rows in set (0.00 sec)



 Comments   
Comment by Geoff Montee (Inactive) [ 2016-04-01 ]

I also just reported MDEV-9856 that may be related to this.

Comment by Jan Lindström (Inactive) [ 2019-05-23 ]

I would say this is not a bug. However, documentation could be improved on this area.

greenman Can you update the documentation.

Note that full GTID support is still to be announced later see https://jira.mariadb.org/browse/MDEV-10715

Comment by Geoff Montee (Inactive) [ 2019-05-23 ]

This is already documented here:

https://mariadb.com/kb/en/library/using-mariadb-gtids-with-mariadb-galera-cluster/#enabling-wsrep-gtid-mode

Generated at Thu Feb 08 07:37:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.