Skip to content

Commit

Permalink
Fix PS-5678 (Parallel doublewrite mustcrash server on I/O error)
Browse files Browse the repository at this point in the history
buf_dblwr_flush_buffered_writes must crash server on an I/O error to
the doublewrite, as there is no way to continue flushing in such
event: proceeding with write to the data file defeats the purpose of
the doublewrite buffer. This was done in upstream legacy doublewrite,
however parallel doublewrite implementation changed the write call
from fil_io (which fails on error) to os_file_write (which returns
error to caller).

Fix by checking the return code of os_file_write and calling ib::fatal
on error.
  • Loading branch information
laurynas-biveinis committed Jun 10, 2019
1 parent fc5fca4 commit 0f810d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions storage/innobase/buf/buf0dblwr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1331,8 +1331,13 @@ buf_dblwr_flush_buffered_writes(
* srv_doublewrite_batch_size * UNIV_PAGE_SIZE);
#endif

os_file_write(io_req, parallel_dblwr_buf.path, parallel_dblwr_buf.file,
write_buf, file_pos, len);
dberr_t err = os_file_write(io_req, parallel_dblwr_buf.path,
parallel_dblwr_buf.file, write_buf,
file_pos, len);
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::fatal() << "Parallel doublewrite buffer write failed, "
"crashing the server to avoid data loss";
}

ut_ad(dblwr_shard->first_free <= srv_doublewrite_batch_size);

Expand Down

0 comments on commit 0f810d7

Please sign in to comment.