mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-32269 InnoDB after ALTER TABLE…IMPORT TABLESPACE may not be crash safe
mtr_t::commit(): If IMPORT TABLESPACE is first-time-dirtying blocks, acquire both log_sys.mutex and log_sys.flush_order_mutex to assign a valid m_commit_lsn so that the block will be inserted into the correct position of buf_pool.flush_list. This fixes occasional debug assertion failures when running the regression test suite. Reviewed by: Vladislav Lesin
This commit is contained in:
parent
968061fd9c
commit
89a5a8d234
1 changed files with 8 additions and 2 deletions
|
@ -453,10 +453,16 @@ void mtr_t::commit()
|
|||
{
|
||||
ut_ad(m_log_mode == MTR_LOG_NO_REDO);
|
||||
ut_ad(m_log.size() == 0);
|
||||
m_commit_lsn= log_sys.get_lsn();
|
||||
lsns= { m_commit_lsn, PAGE_FLUSH_NO };
|
||||
if (UNIV_UNLIKELY(m_made_dirty)) /* This should be IMPORT TABLESPACE */
|
||||
{
|
||||
mysql_mutex_lock(&log_sys.mutex);
|
||||
m_commit_lsn= log_sys.get_lsn();
|
||||
mysql_mutex_lock(&log_sys.flush_order_mutex);
|
||||
mysql_mutex_unlock(&log_sys.mutex);
|
||||
}
|
||||
else
|
||||
m_commit_lsn= log_sys.get_lsn();
|
||||
lsns= { m_commit_lsn, PAGE_FLUSH_NO };
|
||||
}
|
||||
|
||||
if (m_freed_pages)
|
||||
|
|
Loading…
Reference in a new issue