Bug #92754 Contribution by Facebook: Relax restrictions on replicate_same_server_id wi ...
Submitted: 11 Oct 2018 19:06 Modified: 11 Apr 2019 13:02
Reporter: FBContrib Admin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.11 OS:Any
Assigned to: CPU Architecture:Any

[11 Oct 2018 19:06] FBContrib Admin
Description:
Background innformation provided by Facebook:
MySQL refuses to start if replicate_same_server_id is used along with log_slave_updates. The reason is to avoid possible infinite loops on the slave with circular replication topology. With GTID this is not possible as SQL thread filters out duplicate transactions.

This addresses bug#80291.

Repo: https://github.com/mysql/mysql-server
Patch on top of 8.0.11: https://github.com/mysql/mysql-server/commit/4f1d7cf5fcb11a3f84cff27e37100d7295e7d5ca
Facebook commits: https://github.com/facebook/mysql-5.6/commit/9847a78

How to repeat:
See description

Suggested fix:
See contribution code attached
[11 Oct 2018 19:06] FBContrib Admin
Relax restrictions on replicate_same_server_id with gtid_mode 
(*) This code is contributed under the Facebook agreement

Contribution: fb_patch_85.txt (text/plain), 1.23 KiB.

[5 Apr 2019 20:25] Omer Barnir
Thanks to Facebook for the contribution
[11 Apr 2019 13:02] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.17:

When binary logging is enabled on a replication slave, the combination of the --replicate-same-server-id and --log-slave-updates options on the slave can cause infinite loops in replication if the server is part of a circular replication topology. (In MySQL 8.0, binary logging is enabled by default, and slave update logging is the default when binary logging is enabled.) However, the use of global transaction identifiers (GTIDs) prevents this situation by skipping the execution of transactions that have already been applied. The restriction on this combination of options has therefore now been removed when gtid_mode=ON is set. With any other GTID mode, the server still does not start with this combination of options. As a safeguard against creating the problem situation after the server has started, you now cannot change the GTID mode to anything other than ON on a running server that has this combination of options set. Thanks to Facebook for the contribution.   

Documentation changes made to:
https://dev.mysql.com/doc/refman/8.0/en/replication-options-slave.html#option_mysqld_repli...
https://dev.mysql.com/doc/refman/8.0/en/replication-mode-change-online-disable-gtids.html