Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.5.3, 10.6.0, 10.7(EOL), 10.8(EOL), 10.9(EOL)
Description
This was found while testing MDEV-13542.
mysqld: /data/Server/bb-10.6-MDEV-13542L/storage/innobase/buf/buf0flu.cc:175: void buf_pool_t::insert_into_flush_list(buf_block_t*, lsn_t): Assertion `((&(&log_sys.flush_order_mutex)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&log_sys.flush_order_mutex)->m_mutex)->thread))' failed.
|
The corresponding source code is:
void buf_pool_t::insert_into_flush_list(buf_block_t *block, lsn_t lsn) |
{
|
mysql_mutex_assert_not_owner(&mutex);
|
mysql_mutex_assert_owner(&log_sys.flush_order_mutex);
|
The assertion fails, because log_sys.flush_order_mutex is not being held, even though it is supposed to be.
This could lead to incorrect log checkpoints being written, that is, invalid crash recovery or backup. The fix is simple:
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
|
index 2feb5a0583f..f13b677742b 100644
|
--- a/storage/innobase/mtr/mtr0mtr.cc
|
+++ b/storage/innobase/mtr/mtr0mtr.cc
|
@@ -1263,4 +1263,6 @@ void mtr_t::modify(const buf_block_t &block)
|
}
|
iteration.functor.found->type= static_cast<mtr_memo_type_t>
|
(iteration.functor.found->type | MTR_MEMO_MODIFY);
|
+ if (is_block_dirtied(&block))
|
+ m_made_dirty= true;
|
} |
The flag mtr_t::m_made_dirty will inform mtr_t::commit() to acquire the mutex.
Attachments
Issue Links
- is caused by
-
MDEV-12353 Efficient InnoDB redo log record format
- Closed
-
MDEV-22107 Restore accidentally orphaned MTR_MEMO_MODIFY
- Closed