Commit 35de8326 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-31311: The test innodb.log_file_size_online occasionally hangs

log_t::write_checkpoint(), log_t::resize_start(): Invoke buf_flush_ahead()
with buf_pool.get_oldest_modification(0)+1 so that another checkpoint will
be invoked, to complete the log resizing.

Tested by: Oleg Smirnov (on Microsoft Windows, where this hung most often)
parent 26fc07b1
...@@ -1864,8 +1864,7 @@ inline void log_t::write_checkpoint(lsn_t end_lsn) noexcept ...@@ -1864,8 +1864,7 @@ inline void log_t::write_checkpoint(lsn_t end_lsn) noexcept
ib::info() << "Resized log to " << ib::bytes_iec{resizing_completed} ib::info() << "Resized log to " << ib::bytes_iec{resizing_completed}
<< "; start LSN=" << resizing; << "; start LSN=" << resizing;
else else
sql_print_error("InnoDB: Resize of log failed at " LSN_PF, buf_flush_ahead(end_lsn + 1, false);
get_flushed_lsn());
} }
/** Initiate a log checkpoint, discarding the start of the log. /** Initiate a log checkpoint, discarding the start of the log.
......
...@@ -497,7 +497,14 @@ log_t::resize_start_status log_t::resize_start(os_offset_t size) noexcept ...@@ -497,7 +497,14 @@ log_t::resize_start_status log_t::resize_start(os_offset_t size) noexcept
log_resize_release(); log_resize_release();
if (start_lsn) if (start_lsn)
{
mysql_mutex_lock(&buf_pool.flush_list_mutex);
lsn_t target_lsn= buf_pool.get_oldest_modification(0);
if (start_lsn < target_lsn)
start_lsn= target_lsn + 1;
mysql_mutex_unlock(&buf_pool.flush_list_mutex);
buf_flush_ahead(start_lsn, false); buf_flush_ahead(start_lsn, false);
}
return status; return status;
} }
......
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