Skip to content

Commit

Permalink
MDEV-32511: Race condition between checkpoint and page write
Browse files Browse the repository at this point in the history
fil_aio_callback(): Invoke fil_node_t::complete_write() before
releasing any page latch, so that in case a log checkpoint is
executed roughly concurrently with the first write into a file
since the previous checkpoint, we will not miss a fdatasync()
or fsync() call to make the write durable.
  • Loading branch information
dr-m committed Oct 18, 2023
1 parent 3da5d04 commit cfd1788
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3445,18 +3445,18 @@ void fil_aio_callback(const IORequest &request)

if (!request.bpage)
{
request.node->complete_write();
ut_ad(!srv_read_only_mode);
if (request.type == IORequest::DBLWR_BATCH)
buf_dblwr.flush_buffered_writes_completed(request);
else
ut_ad(request.type == IORequest::WRITE_ASYNC);
write_completed:
request.node->complete_write();
}
else if (request.is_write())
{
request.node->complete_write();
buf_page_write_complete(request);
goto write_completed;
}
else
{
Expand Down

0 comments on commit cfd1788

Please sign in to comment.