Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.1.13
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)
|
Attachments
Issue Links
- relates to
-
MDEV-9856 wsrep_gtid_mode requires nodes to have the same log_bin path
- Closed
-
MDEV-20720 Galera: Replicate MariaDB GTID to other nodes in the cluster
- Closed