Commit b862c797 authored by Shaohua Wang's avatar Shaohua Wang Committed by Marko Mäkelä

BUG#24315031 FAILING ASSERTION: !TABLE->CAN_BE_EVICTED

Analysis:
the old table is dropped, just after it's added into drop list,
and new table with the same name is created, then we try to drop
the new table in background.

Solution:
Don't drop a table in background if table->to_be_dropped is false.
Reviewed-by: default avatarJimmy Yang <jimmy.yang@oracle.com>
RB: 13414
parent 9ce1ea6f
......@@ -2888,6 +2888,10 @@ row_drop_tables_for_mysql_in_background(void)
return(n_tables + n_tables_dropped);
}
DBUG_EXECUTE_IF("row_drop_tables_in_background_sleep",
os_thread_sleep(5000000);
);
table = dict_table_open_on_name(drop->table_name, FALSE, FALSE,
DICT_ERR_IGNORE_NONE);
......@@ -2898,6 +2902,16 @@ row_drop_tables_for_mysql_in_background(void)
goto already_dropped;
}
if (!table->to_be_dropped) {
/* There is a scenario: the old table is dropped
just after it's added into drop list, and new
table with the same name is created, then we try
to drop the new table in background. */
dict_table_close(table, FALSE, FALSE);
goto already_dropped;
}
ut_a(!table->can_be_evicted);
dict_table_close(table, FALSE, FALSE);
......@@ -3766,6 +3780,13 @@ row_drop_table_for_mysql(
}
}
DBUG_EXECUTE_IF("row_drop_table_add_to_background",
row_add_table_to_background_drop_list(table->name.m_name);
err = DB_SUCCESS;
goto funct_exit;
);
/* TODO: could we replace the counter n_foreign_key_checks_running
with lock checks on the table? Acquire here an exclusive lock on the
table, and rewrite lock0lock.cc and the lock wait in srv0srv.cc so that
......
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