Bug #94360 Contribution by Facebook: Don't force flush relay log info
Submitted: 16 Feb 2019 4:44 Modified: 8 Feb 2022 19:35
Reporter: FBContrib Admin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[16 Feb 2019 4:44] FBContrib Admin
Description:
Background innformation provided by Facebook:

With gtid enabled, flushing relay log info is not necessary. The force flushing is required to ensure recovery of MTS in non-gtid mode. The coordinator thread relies on positions in the relay log info repository during recovery. With GTID, this is not required and sql_thread doesn't even need to do any recovery. The slave (io_thread) uses auto-positioning directly.

Use case:

Small replication performance improvement not having to flush the relay log info unnecessarily.

Repo: https://github.com/mysql/mysql-server
Patch on top of 8.0.13: https://github.com/mysql/mysql-server/commit/e4924f36486f971f8a04252e01c803457a2c72f7

How to repeat:
See description

Suggested fix:
See contribution code attached
[16 Feb 2019 4:44] FBContrib Admin
Don't force flush relay log info 
(*) This code is contributed under the Facebook agreement

Contribution: fb_patch_106.txt (text/plain), 514 bytes.

[8 Feb 2022 19:35] Omer Barnir
Posted by developer:
 
The solution to the described problem was addressed as part of a larger 
effort that aimed not only to reduce the flushing frequency of replication 
related metadada but also reduce the dependency on position information 
when using GTIDs. The specific issue described in this contribution was 
addressed but under some constraints.

In 8.0.27 when configuration conditions are met (GTID_MODE=ON,
SOURCE_AUTO_POSITION=1, REQUIRE_ROW_FORMAT=1) the user can now
use on replication channels the option GTID_ONLY=1 that will
remove the per-transaction persistence of information associated
to what files and positions are being replicated, so only GTIDs
are used to track the replication/execution of transactions. 

Thanks to Facebook for offering the contribution
[16 Feb 2022 18:29] Margaret Fisher
Noted in the changelog entry for WL #7491 in 8.0.27. Thanks for offering the contribution!