[MDEV-24526] binlog rotate via FLUSH LOGS may obsolate binlog file for recovery too early Created: 2021-01-05  Updated: 2022-06-27  Resolved: 2021-04-21

Status: Closed
Project: MariaDB Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 10.2.38, 10.3.29, 10.4.19, 10.5.10

Type: Bug Priority: Critical
Reporter: Andrei Elkin Assignee: Andrei Elkin
Resolution: Fixed Votes: 0
Labels: binlog_checkpoint

Attachments: File _binlog_checkpoint_stress.test    
Issue Links:
Relates
relates to MDEV-24530 binlog-optimize-thread-scheduling=0 c... Open
relates to MDEV-24302 RESET MASTER hangs as Innodb does not... Closed
relates to MDEV-28948 FLUSH BINARY LOGS waits/hangs on mysq... Closed

 Description   

There's a race between FLUSH LOGS and binlog-group commit for Binlog-checkpoint notification which must be done *after* the committed group transactions' affected
data are flushed to disk. However the notification may happen before that fore the reason
FLUSH LOGS handler does to acquire necessary mutexes.

A test case follows with a patch to be committed soon.



 Comments   
Comment by Andrei Elkin [ 2021-01-05 ]

A relate issue is mentioned/linked.

Comment by Andrei Elkin [ 2021-01-07 ]

alice: We need to test this and MDEV-24302 (being committed shortly)
patch in stress environment. I'll attach mtr test that attempts that, but it won't be added to the patch as we need some tens of minutes running load (on both master and parallel slave).

Comment by Andrei Elkin [ 2021-01-07 ]

Attached test is run to pass for over 10 mins. It'd be great to have a RQG-based one and run longer on master and parallel slave, and with actual crash-recovery. alice, we need such test anyway to run periodically, so efforts to that direction now
are motivated by this bug fixes.

Comment by Sujatha Sivakumar (Inactive) [ 2021-01-13 ]

Hello Andrei,

Thank you for working on this issue. Code changes look good to my knowledge.
I have made some improvements to the test please have a look.
The test changes are pushed onto bb-10.2-andrei.

https://github.com/MariaDB/server/commit/3c5d708eeb56fd656a0b270004a16c8f041802b7

Thank you.

Comment by Andrei Elkin [ 2021-04-21 ]

2a7dd6442 pushed to 10.2.

Generated at Thu Feb 08 09:30:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.