mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
MDEV-20648 InnoDB: Failing assertion: !(*node)->being_extended, innodb.log_data_file_size failed in buildbot, assertion `!space->is_stopping()'
InnoDB should check whether the tablespace is being deleted while extending the tablespace.
This commit is contained in:
parent
676987c4a1
commit
f080863501
1 changed files with 26 additions and 14 deletions
|
@ -1038,15 +1038,14 @@ fil_space_extend_must_retry(
|
|||
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
Reserves the fil_system mutex and tries to make sure we can open at least one
|
||||
/** Reserves the fil_system mutex and tries to make sure we can open at least one
|
||||
file while holding it. This should be called before calling
|
||||
fil_node_prepare_for_io(), because that function may need to open a file. */
|
||||
fil_node_prepare_for_io(), because that function may need to open a file.
|
||||
@param[in] space_id tablespace id
|
||||
@return whether the tablespace is usable for io */
|
||||
static
|
||||
void
|
||||
fil_mutex_enter_and_prepare_for_io(
|
||||
/*===============================*/
|
||||
ulint space_id) /*!< in: space id */
|
||||
bool
|
||||
fil_mutex_enter_and_prepare_for_io(ulint space_id)
|
||||
{
|
||||
for (ulint count = 0;;) {
|
||||
mutex_enter(&fil_system->mutex);
|
||||
|
@ -1059,7 +1058,7 @@ fil_mutex_enter_and_prepare_for_io(
|
|||
fil_space_t* space = fil_space_get_by_id(space_id);
|
||||
|
||||
if (space == NULL) {
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
||||
fil_node_t* node = UT_LIST_GET_LAST(space->chain);
|
||||
|
@ -1074,6 +1073,10 @@ fil_mutex_enter_and_prepare_for_io(
|
|||
the insert buffer. The insert buffer is in
|
||||
tablespace 0, and we cannot end up waiting in
|
||||
this function. */
|
||||
} else if (space->is_stopping() && !space->is_being_truncated) {
|
||||
/* If the tablespace is being deleted then InnoDB
|
||||
shouldn't prepare the tablespace for i/o */
|
||||
return false;
|
||||
} else if (!node || node->is_open()) {
|
||||
/* If the file is already open, no need to do
|
||||
anything; if the space does not exist, we handle the
|
||||
|
@ -1144,6 +1147,8 @@ fil_mutex_enter_and_prepare_for_io(
|
|||
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Try to extend a tablespace if it is smaller than the specified size.
|
||||
|
@ -1160,7 +1165,10 @@ fil_space_extend(
|
|||
bool success;
|
||||
|
||||
do {
|
||||
fil_mutex_enter_and_prepare_for_io(space->id);
|
||||
if (!fil_mutex_enter_and_prepare_for_io(space->id)) {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
} while (fil_space_extend_must_retry(
|
||||
space, UT_LIST_GET_LAST(space->chain), size,
|
||||
&success));
|
||||
|
@ -1537,7 +1545,9 @@ fil_space_t* fil_system_t::read_page0(ulint id)
|
|||
|
||||
/* It is possible that the tablespace is dropped while we are
|
||||
not holding the mutex. */
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
if (!fil_mutex_enter_and_prepare_for_io(id)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fil_space_t* space = fil_space_get_by_id(id);
|
||||
|
||||
|
@ -1610,14 +1620,16 @@ fil_space_get_first_path(
|
|||
ut_ad(fil_system);
|
||||
ut_a(id);
|
||||
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
if (!fil_mutex_enter_and_prepare_for_io(id)) {
|
||||
fail_exit:
|
||||
mutex_exit(&fil_system->mutex);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
space = fil_space_get_space(id);
|
||||
|
||||
if (space == NULL) {
|
||||
mutex_exit(&fil_system->mutex);
|
||||
|
||||
return(NULL);
|
||||
goto fail_exit;
|
||||
}
|
||||
|
||||
ut_ad(mutex_own(&fil_system->mutex));
|
||||
|
|
Loading…
Reference in a new issue