← Back to team overview

maria-discuss team mailing list archive

fsync necessary for synchronous page flush?

 

Hello,

When a dirty page is flushed synchronously in buf_flush_write_block_low,
fsync is called in the following snippet. I am wondering why
we need this fsync for synchronous flush? The record should be in
the log already, so recovery should be able to successfully redo it
and apply to the disk during recovery. Maybe I am missing something here,
please let me know if I am wrong. Thanks much!

Xiaofei


/* When doing single page flushing the IO is done synchronously and we
flush the changes to disk only for the tablespace we are working on. */ if
(sync) { ut_ad(flush_type == BUF_FLUSH_SINGLE_PAGE);
fil_flush(buf_page_get_space(bpage));
/* true means we want to evict this page from the LRU list as well. */
buf_page_io_complete(bpage, true); }