Bug #104785 backup lock causes binlog_expire_logs_seconds invalid when the binlog is flushed
Submitted: 1 Sep 2021 8:20 Modified: 2 Sep 2021 15:30
Reporter: chengqing hu Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:MySQL8.0.26 OS:Any
Assigned to: CPU Architecture:Any

[1 Sep 2021 8:20] chengqing hu
Description:
The backup lock causes binlog_expire_logs_seconds to become invalid when binlog is flushed.

How to repeat:
1. set global binlog_expire_logs_seconds=10
2. flush binary logs;flush binary logs;flush binary logs;
3. wait 10s
4. LOCK INSTANCE FOR BACKUP;
5. show master logs;
6. flush binary logs;
7. show master logs;
you can see the expired binary log has not been removed.

Suggested fix:
"flush tables with read lock" won't cause this problem.So i don’t think "LOCK INSTANCE FOR BACKUP" should be.
[2 Sep 2021 15:30] MySQL Verification Team
Hi thanks for your report. I'm sure we have this bug already logged in but I can't find it. Verified as described.

thanks