[MDEV-9145] Make --gtid-ignore-duplicates work for user transactions also Created: 2015-11-17 Updated: 2023-07-12 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Affects Version/s: | 10.0.21 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Thomas Jassmann | Assignee: | Kristian Nielsen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos 7.1 |
||
| Description |
|
I have two Mariadb 10.0.21 servers replicating from each others. log_slave_updates A Table like CREATE TABLE `Table1` ( is identical on all servers, a dataset with PKey=104 doesn't exist on each server. on server 1 with domainid=1 and serverid=1 before the error:
on server 2 with domainid=2 and serverid=2 before the error:
Inserting a dataset to the third server with domainid 4 and serverid 4 and pointing mysqlbinlog to the correct file and pos coordinates results in the output:
parsed and applied on server 1 like :
breaks replication on server 1:
server 2 is okay:
Both servers applied the Insert 4-4-73. gtid_ignore_duplicates=ON doesn't solve the problem. gtid_strict_mode=OFF. Pointing Replicate_Ignore_Server_Ids to 4 helps but isn't an option since server 1 and Why does server 1 try to reapply the dataset from server 2 (log_slave_updates=ON)? |
| Comments |
| Comment by Elena Stepanova [ 2015-11-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, I don't understand from the description where the 3rd server stands in your replication topology.
what does it mean in terms of replication? Which replicates from which, and how? And what does
mean – parsed and applied by whom/what? How is it related to server3? Please also attach your cnf files for all servers. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Thomas Jassmann [ 2015-11-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The 3rd server is an additional master, that means, it receives inserts and updates, but is not connected to server1 and server2 via mysql slave replication threads. Information from server3 is extracted from it's binary logs by mysqlbinlog wich contain valid gtid_domain_id, server_id and for all other servers new gtid_seqno. The resulting sql-statments then were injected by a C-Programm using libmysqlclient_r.so.18 in one single connection to server1. For me, it looks like the (update of the) value, the mysql process uses to decide wether a gtid is duplicate or not is handled different in the replication slave thread on the one and in a standard user connection on the other hand. config of server1:
config of server 2:
config of server 3:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Thomas Jassmann [ 2015-11-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
What kind of feedback do you need ? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kristian Nielsen [ 2016-01-15 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It is a bit hard to follow, but my guess is that the following is happening. A replication ring is set up between server1 (server_id=1) and server2 Now a transaction is injected on server1 with server_id explicitly set to 4. This causes the transaction to replicate to server2, and then back to The normal --replicate-ignore-server-ids=0 protection against re-apply of a The --gtid-ignore-duplicate does not activate because it only protects Basically, for a ring topology to work, transactions originating on a server Or the server_id could be set to 1 when the transaction is originally | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-01-19 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
TomJass, does the comment above explain for you results that you are getting, and ways to avoid the problem? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Thomas Jassmann [ 2016-01-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm able to avoid the problem. I think this comes nearest to Kristian's last proposal. At the moment I'm injecting the mysqlbinlog output replication data without explictliy setting session.gtid_domain_id, session.server_id and session.gtid_seq_no as generated by the originating server. The disadvantage is, the binlogs of the different servers contain now different id's for the same transactions, the real gtid of the transaction is lost. Is there a plan by you and your team to treat session.gtid_domain_id, session.server_id and session.gtid_seq_no set in a user session the same like in the replication threads ? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2016-01-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
For discussion on further plans and such, assigning to Kristian. |