summaryrefslogtreecommitdiff
path: root/btr/btr0sea.c
diff options
context:
space:
mode:
Diffstat (limited to 'btr/btr0sea.c')
-rw-r--r--btr/btr0sea.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/btr/btr0sea.c b/btr/btr0sea.c
index 36dadd47e69..6628333d32a 100644
--- a/btr/btr0sea.c
+++ b/btr/btr0sea.c
@@ -46,6 +46,7 @@ Created 2/17/1996 Heikki Tuuri
/** Flag: has the search system been enabled?
Protected by btr_search_latch and btr_search_enabled_mutex. */
UNIV_INTERN char btr_search_enabled = TRUE;
+UNIV_INTERN ibool btr_search_fully_disabled = FALSE;
/** Mutex protecting btr_search_enabled */
static mutex_t btr_search_enabled_mutex;
@@ -201,12 +202,19 @@ btr_search_disable(void)
mutex_enter(&btr_search_enabled_mutex);
rw_lock_x_lock(&btr_search_latch);
+ /* Disable access to hash index, also tell ha_insert_for_fold()
+ stop adding new nodes to hash index, but still allow updating
+ existing nodes */
btr_search_enabled = FALSE;
/* Clear all block->is_hashed flags and remove all entries
from btr_search_sys->hash_index. */
buf_pool_drop_hash_index();
+ /* hash index has been cleaned up, disallow any operation to
+ the hash index */
+ btr_search_fully_disabled = TRUE;
+
/* btr_search_enabled_mutex should guarantee this. */
ut_ad(!btr_search_enabled);
@@ -225,6 +233,7 @@ btr_search_enable(void)
rw_lock_x_lock(&btr_search_latch);
btr_search_enabled = TRUE;
+ btr_search_fully_disabled = FALSE;
rw_lock_x_unlock(&btr_search_latch);
mutex_exit(&btr_search_enabled_mutex);
@@ -1488,7 +1497,7 @@ btr_search_build_page_hash_index(
rw_lock_x_lock(&btr_search_latch);
- if (UNIV_UNLIKELY(!btr_search_enabled)) {
+ if (UNIV_UNLIKELY(btr_search_fully_disabled)) {
goto exit_func;
}
@@ -1850,6 +1859,7 @@ function_exit:
}
}
+#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/********************************************************************//**
Validates the search system.
@return TRUE if ok */
@@ -2019,3 +2029,4 @@ btr_search_validate(void)
return(ok);
}
+#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */