[MDEV-12024] InnoDB startup fails to wait for recv_writer_thread to finish Created: 2017-02-08  Updated: 2023-01-17  Resolved: 2017-02-08

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.0, 10.1, 10.2
Fix Version/s: 10.0.30, 10.1.22, 10.2.4

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: recovery, thread

Issue Links:
Relates
relates to MDEV-30422 Merge new release of InnoDB 5.7.41 to... Closed

 Description   

InnoDB crash recovery starts recv_writer_thread to keep track of page flushing. As part of startup, recv_recovery_from_checkpoint_finish() would normally wait for this thread to exit, by waiting for !recv_writer_thread_active.

However, it is possible that on a busy system, recv_writer_thread will not get scheduled for execution before recv_recovery_from_checkpoint_finish() executes the test. In this case, recv_writer_thread() could start executing later than it should. Ultimately this could end in an assertion failure, as was observed on buildbot for the recently added test innodb.log_file:

void
recv_recovery_rollback_active(void)
/*===============================*/
{
	ut_ad(!recv_writer_thread_active);

A simple fix would be to initialize `recv_writer_thread_active=true` in the thread creator, similar to what was done in MDEV-11638 some time ago.



 Comments   
Comment by Marko Mäkelä [ 2017-02-08 ]

070a8754c44: MDEV-12024 InnoDB startup fails to wait for recv_writer_thread to finish

Comment by Jan Lindström (Inactive) [ 2017-02-08 ]

ok to push, as you said this is trivial change.

Generated at Thu Feb 08 07:54:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.