[MDEV-28292] Allow both --replicate-same-server-id=on and --log-slave-updates=on to be enabled at the same time Created: 2022-04-11 Updated: 2022-07-26 Resolved: 2022-04-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Daniel Lenski | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Enabling both log-slave-updates and replicate-same-server-id simultaneously is possible in MySQL 8.0+ thanks to GTID. This is a useful feature to guarantee durability in certain replication configurations. MariaDB should add this capability. This requires adding new code to gracefully ignore duplicated GTIDs. I am willing to write this code but request advice from upstream core contributors on how to properly do it. Research
TestingI modified MariaDB 10.6 to allow the combination of these two flags:
Then I set the combination of the two flags in rpl_circular_for_4_hosts.test, an MTR test of circular replication with a 4-server configuration:
With both of these flags, the servers start up successfully, but the test fails after one of the slaves is stopped and attempts to restart. This is due to errors with duplicate transactions:
The above might be solvable by gracefully dropping duplicate GTIDs, but I need upstream guidance on how to properly proceed with this. |
| Comments |
| Comment by Daniel Lenski [ 2022-04-11 ] |
|
MDEV-23990 is a very similar issue from ~2 years ago, but appears to be specifically focused on Galera replication. |
| Comment by Daniel Black [ 2022-04-12 ] |
|
Elkin commented "So to answer the question, yes, to support the combination is feasible." |
| Comment by Andrei Elkin [ 2022-04-12 ] |
|
Thanks, danblack. Let me be more specific. The semisync enablement does not mean the semisync actual mode of the slave operation - that's just a formal setting (of readiness) and can be lifted altogether. |
| Comment by Daniel Lenski [ 2022-04-12 ] |
|
Thank you! elkin wrote:
Does this mean that both replicate-same-server-id=on and log-slave-updates=on can be enabled as long as gtid-strict-mode=on and rpl_semi_sync_slave_enabled=1 are also enabled? I didn't fully understand your comment about "the semisync enablement." |
| Comment by Andrei Elkin [ 2022-04-14 ] |
|
dlenski: to the semisync enablement, The gtid strict mode ON role is to not let re-execution of the same gtid transactions. |
| Comment by Otto Kekäläinen [ 2022-04-25 ] |
|
Using gtid-strict-mode=on is the correct path forward, thus closing this issue. The docs at https://mariadb.com/kb/en/gtid/#gtid_strict_mode and a couple mentions of GTID at https://mariadb.com/kb/en/mariadb-vs-mysql-compatibility/ are a bit thin, but I don't have any suggestions to improve them right now. |