Commit 536112dd authored by Jan Lindström's avatar Jan Lindström

MDEV-8195: InnoDB: Error: trying to access tablespace 11262 page no. 7,...

MDEV-8195: InnoDB: Error: trying to access tablespace 11262 page no. 7, InnoDB: but the tablespace does not exist or is just being dropped.

Analysis: Problem was that we did try to read from tablespace
that was being dropped.

Fixed by introducing a new function to find a tablespace only
if it is not being dropped currently and adding this check
before trying to read pages from tablespace.
parent 8635c4b4
This diff is collapsed.
...@@ -341,6 +341,26 @@ fil_space_get_by_id( ...@@ -341,6 +341,26 @@ fil_space_get_by_id(
return(space); return(space);
} }
/*******************************************************************//**
Returns the table space by a given id, NULL if not found. */
fil_space_t*
fil_space_found_by_id(
/*==================*/
ulint id) /*!< in: space id */
{
fil_space_t* space = NULL;
mutex_enter(&fil_system->mutex);
space = fil_space_get_by_id(id);
/* Not found if space is being deleted */
if (space && space->stop_new_ops) {
space = NULL;
}
mutex_exit(&fil_system->mutex);
return space;
}
/****************************************************************//** /****************************************************************//**
Get space id from fil node */ Get space id from fil node */
ulint ulint
......
...@@ -1252,6 +1252,13 @@ fil_system_exit(void); ...@@ -1252,6 +1252,13 @@ fil_system_exit(void);
/*==================*/ /*==================*/
#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_INNOCHECKSUM
/*******************************************************************//**
Returns the table space by a given id, NULL if not found. */
fil_space_t*
fil_space_found_by_id(
/*==================*/
ulint id); /*!< in: space id */
/*******************************************************************//** /*******************************************************************//**
Returns the table space by a given id, NULL if not found. */ Returns the table space by a given id, NULL if not found. */
fil_space_t* fil_space_t*
......
This diff is collapsed.
...@@ -344,6 +344,26 @@ fil_space_get_by_id( ...@@ -344,6 +344,26 @@ fil_space_get_by_id(
return(space); return(space);
} }
/*******************************************************************//**
Returns the table space by a given id, NULL if not found. */
fil_space_t*
fil_space_found_by_id(
/*==================*/
ulint id) /*!< in: space id */
{
fil_space_t* space = NULL;
mutex_enter(&fil_system->mutex);
space = fil_space_get_by_id(id);
/* Not found if space is being deleted */
if (space && space->stop_new_ops) {
space = NULL;
}
mutex_exit(&fil_system->mutex);
return space;
}
/****************************************************************//** /****************************************************************//**
Get space id from fil node */ Get space id from fil node */
ulint ulint
......
...@@ -1280,6 +1280,13 @@ fil_system_exit(void); ...@@ -1280,6 +1280,13 @@ fil_system_exit(void);
/*==================*/ /*==================*/
#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_INNOCHECKSUM
/*******************************************************************//**
Returns the table space by a given id, NULL if not found. */
fil_space_t*
fil_space_found_by_id(
/*==================*/
ulint id); /*!< in: space id */
/*******************************************************************//** /*******************************************************************//**
Returns the table space by a given id, NULL if not found. */ Returns the table space by a given id, NULL if not found. */
fil_space_t* fil_space_t*
......
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