Commit cfd17881 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-32511: Race condition between checkpoint and page write

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.
parent 3da5d047
......@@ -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
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment