Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.1.14
-
None
Description
Hi everybody,
According to the documentation, the gtid_current_pos should be updated with transactions from the slave threads as well:
https://mariadb.com/kb/en/mariadb/gtid/#gtid_current_pos
While this is not a problem in traditional replication setups (we can use slave_pos instead of current_pos) it can be a problem with setups with intermediate masters where the higher master is older version:
Server 1 (5.5) -> Server 2a (10.1) -> server 2b (10.1)
If we want to switch roles between 2a and 2b we stop replication from server 1 to 2a (to failover afterwards). However we cannot use gtid_slave_pos or gtid_current_pos because they are not updated:
MariaDB [mariadb]> select @@gtid_binlog_pos, @@gtid_slave_pos, @@gtid_current_pos;
|
+------------------------+--------------------------+--------------------------+
|
| @@gtid_binlog_pos | @@gtid_slave_pos | @@gtid_current_pos |
|
+------------------------+--------------------------+--------------------------+
|
| 0-201-55312,1-1-113229 | 0-201-55312,1-102-110354 | 0-201-55312,1-102-110354 |
|
+------------------------+--------------------------+--------------------------+
|
1 row in set (0.00 sec)
|
If we perform a transaction on server 2a the current_pos at least is updated:
MariaDB [mariadb]> insert into test values(NULL);
|
Query OK, 1 row affected (0.01 sec)
|
|
MariaDB [mariadb]> select @@gtid_binlog_pos, @@gtid_slave_pos, @@gtid_current_pos;
|
+--------------------------+--------------------------+--------------------------+
|
| @@gtid_binlog_pos | @@gtid_slave_pos | @@gtid_current_pos |
|
+--------------------------+--------------------------+--------------------------+
|
| 0-201-55312,1-101-113230 | 0-201-55312,1-102-110354 | 0-201-55312,1-101-113230 |
|
+--------------------------+--------------------------+--------------------------+
|
1 row in set (0.00 sec)
|
Please make it so that current_pos (and slave_pos?) is also updated from transaction that come in from old master, as the documentation states.
Attachments
Issue Links
- relates to
-
MDEV-17853 Document that gtid_binlog_pos can lag behind gtid_current_pos after RESET MASTER
-
- Closed
-
-
MDEV-16834 GTID current_pos easily breaks replication
-
- Closed
-
-
MDEV-17156 Local transactions on a Slave don't update GTID's gtid_current_pos after RESET MASTER on Slave (master_use_gtid value is not relevant)
-
- Closed
-
-
MDEV-20122 Deprecate MASTER_USE_GTID=Current_Pos to favor new MASTER_DEMOTE_TO_SLAVE option
-
- Closed
-
knielsen, tanj, I'm pretty sure I experienced a different issue. My gtid_current_pos did not get updated for multiple hundreds of transactions coming in from an old master.
Currently, the transaction on node 2b does get a GTID somewhere on the way. The gtid_slave_pos in domain 0 on that node increases with the transactions coming in (indirectly) from server 1. The issue I am reporting is that the same transaction on server 2a does not have a GTID (domain 0 in gtid_current_pos does not increase).
I don't need the transaction to get a new server_id or gtid_domain_id, I am fine with domain 0 and the server_id of server 1 (although back there it really wasn't a gtid transaction). If you think that's better or needed I have no problemw ith it though.
By the way, I am replicating from an ancient Percona server 5.6 (node 1) without GTID mode enabled. Sorry I did not mention that before, I don't think it makes a difference though.