mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
MDEV-30802 Assertion `index->is_btree() || index->is_ibuf()' failed in btr_search_guess_on_hash
Problem:
=======
- There is a race condition between purge and rollback of alter
operation. Alter rollback marks the index as corrupted.
At the same time, purge is working on the same index and leads
to assert failure. This is caused by
commit 7c0b9c6020
(MDEV-15250).
Solution:
=======
- After MDEV-15250, InnoDB logs the operation only at the
end of transaction commit and applies the log in
ha_innobase::commit_inplace_alter_table() and
also via dml thread. So there is no need for purge to work
on uncommitted index.
The assertion would fail in the test innodb.innodb-index-online
when the following call is added to the start of the function
row_purge_remove_sec_if_poss_leaf():
if (!index->is_committed()) sleep(5);
This commit is contained in:
parent
8096139b3a
commit
2fdacdcd69
2 changed files with 6 additions and 18 deletions
|
@ -1052,7 +1052,8 @@ struct dict_index_t {
|
|||
unsigned uncommitted:1;
|
||||
/*!< a flag that is set for secondary indexes
|
||||
that have not been committed to the
|
||||
data dictionary yet */
|
||||
data dictionary yet. Protected by
|
||||
MDL */
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/** whether this is a dummy index object */
|
||||
|
|
|
@ -613,13 +613,9 @@ row_purge_del_mark(
|
|||
|
||||
do
|
||||
{
|
||||
const auto type= node->index->type;
|
||||
if (type & (DICT_FTS | DICT_CORRUPT))
|
||||
if (node->index->type & (DICT_FTS | DICT_CORRUPT))
|
||||
continue;
|
||||
if (node->index->online_status > ONLINE_INDEX_CREATION)
|
||||
continue;
|
||||
if (UNIV_UNLIKELY(DICT_VIRTUAL & type) && !node->index->is_committed() &&
|
||||
node->index->has_new_v_col())
|
||||
if (!node->index->is_committed())
|
||||
continue;
|
||||
dtuple_t* entry= row_build_index_entry_low(node->row, nullptr,
|
||||
node->index, heap,
|
||||
|
@ -768,20 +764,11 @@ row_purge_upd_exist_or_extern_func(
|
|||
heap = mem_heap_create(1024);
|
||||
|
||||
do {
|
||||
const auto type = node->index->type;
|
||||
|
||||
if (type & (DICT_FTS | DICT_CORRUPT)) {
|
||||
if (node->index->type & (DICT_FTS | DICT_CORRUPT)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (UNIV_UNLIKELY(DICT_VIRTUAL & type)
|
||||
&& !node->index->is_committed()
|
||||
&& node->index->has_new_v_col()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (node->index->online_status
|
||||
> ONLINE_INDEX_CREATION) {
|
||||
if (!node->index->is_committed()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue