• Marko Mäkelä's avatar
    MDEV-27593: Crashing on I/O error is unhelpful · 72928e64
    Marko Mäkelä authored
    buf_page_t::write_complete(), buf_page_write_complete(),
    IORequest::write_complete(): Add a parameter for passing
    an error code. If an error occurred, we will release the
    io-fix, buffer-fix and page latch but not reset the
    oldest_modification field. The block would remain in
    buf_pool.LRU and possibly buf_pool.flush_list, to be written
    again later, by buf_flush_page_cleaner(). If all page writes
    start consistently failing, all write threads should eventually
    hang in log_free_check() because the log checkpoint cannot
    be advanced to make room in the circular write-ahead-log ib_logfile0.
    
    IORequest::read_complete(): Add a parameter for passing
    an error code. If a read operation fails, we report the error
    and discard the page, just like we would do if the page checksum
    was not validated or the page could not be decrypted.
    This only affects asynchronous reads, due to linear or random read-ahead
    or crash recovery. When buf_page_get_low() invokes buf_read_page(),
    that will be a synchronous read, not involving this code.
    
    This was tested by randomly injecting errors in
    write_io_callback() and read_io_callback(), like this:
    
      if (!ut_rnd_interval(100))
        cb->m_err= 42;
    72928e64
buf0flu.h 5.84 KB