Bug #110889 binlog rotate optimize
Submitted: 3 May 2023 5:41 Modified: 3 May 2023 6:07
Reporter: alex xing (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S5 (Performance)
Version:8.0.32 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[3 May 2023 5:41] alex xing
Description:
For native logic, Binlog rotate needs to iterate over all files to get the index number of the next binlog file, which may cause performance jitter during the period of  binlog rotate. We can cache the largest binlog index number so that we can obtain next binlog index number  without iterate  all binlog files.

How to repeat:
just read the code

Suggested fix:
add binlog index cache just as the below patch
[3 May 2023 5:42] alex xing
a simple patch to describe the optimization

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: binlog_optimize.patch (text/plain), 4.79 KiB.

[3 May 2023 6:07] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
umesh