mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
merge with XtraDB as of Percona-Server-5.5.30-rel30.1
This commit is contained in:
commit
0d9a6d52d7
46 changed files with 1138 additions and 588 deletions
|
|
@ -1479,7 +1479,7 @@ fil_space_get_size(
|
|||
|
||||
ut_ad(fil_system);
|
||||
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
mutex_enter(&fil_system->mutex);
|
||||
|
||||
space = fil_space_get_by_id(id);
|
||||
|
||||
|
|
@ -1494,6 +1494,23 @@ fil_space_get_size(
|
|||
|
||||
ut_a(1 == UT_LIST_GET_LEN(space->chain));
|
||||
|
||||
mutex_exit(&fil_system->mutex);
|
||||
|
||||
/* It is possible that the space gets evicted at this point
|
||||
before the fil_mutex_enter_and_prepare_for_io() acquires
|
||||
the fil_system->mutex. Check for this after completing the
|
||||
call to fil_mutex_enter_and_prepare_for_io(). */
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
|
||||
/* We are still holding the fil_system->mutex. Check if
|
||||
the space is still in memory cache. */
|
||||
space = fil_space_get_by_id(id);
|
||||
|
||||
if (space == NULL) {
|
||||
mutex_exit(&fil_system->mutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
node = UT_LIST_GET_FIRST(space->chain);
|
||||
|
||||
/* It must be a single-table tablespace and we have not opened
|
||||
|
|
@ -1531,7 +1548,7 @@ fil_space_get_flags(
|
|||
return(0);
|
||||
}
|
||||
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
mutex_enter(&fil_system->mutex);
|
||||
|
||||
space = fil_space_get_by_id(id);
|
||||
|
||||
|
|
@ -1546,6 +1563,23 @@ fil_space_get_flags(
|
|||
|
||||
ut_a(1 == UT_LIST_GET_LEN(space->chain));
|
||||
|
||||
mutex_exit(&fil_system->mutex);
|
||||
|
||||
/* It is possible that the space gets evicted at this point
|
||||
before the fil_mutex_enter_and_prepare_for_io() acquires
|
||||
the fil_system->mutex. Check for this after completing the
|
||||
call to fil_mutex_enter_and_prepare_for_io(). */
|
||||
fil_mutex_enter_and_prepare_for_io(id);
|
||||
|
||||
/* We are still holding the fil_system->mutex. Check if
|
||||
the space is still in memory cache. */
|
||||
space = fil_space_get_by_id(id);
|
||||
|
||||
if (space == NULL) {
|
||||
mutex_exit(&fil_system->mutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
node = UT_LIST_GET_FIRST(space->chain);
|
||||
|
||||
/* It must be a single-table tablespace and we have not opened
|
||||
|
|
@ -2732,7 +2766,7 @@ retry:
|
|||
mutex_exit(&fil_system->mutex);
|
||||
|
||||
#ifndef UNIV_HOTBACKUP
|
||||
if (success) {
|
||||
if (success && !recv_recovery_on) {
|
||||
mtr_t mtr;
|
||||
|
||||
mtr_start(&mtr);
|
||||
|
|
@ -6006,3 +6040,26 @@ fil_space_set_corrupt(
|
|||
mutex_exit(&fil_system->mutex);
|
||||
}
|
||||
|
||||
/****************************************************************//**
|
||||
Generate redo logs for swapping two .ibd files */
|
||||
UNIV_INTERN
|
||||
void
|
||||
fil_mtr_rename_log(
|
||||
/*===============*/
|
||||
ulint old_space_id, /*!< in: tablespace id of the old
|
||||
table. */
|
||||
const char* old_name, /*!< in: old table name */
|
||||
ulint new_space_id, /*!< in: tablespace id of the new
|
||||
table */
|
||||
const char* new_name, /*!< in: new table name */
|
||||
const char* tmp_name) /*!< in: temp table name used while
|
||||
swapping */
|
||||
{
|
||||
mtr_t mtr;
|
||||
mtr_start(&mtr);
|
||||
fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
|
||||
0, 0, old_name, tmp_name, &mtr);
|
||||
fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
|
||||
0, 0, new_name, old_name, &mtr);
|
||||
mtr_commit(&mtr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue