diff options
-rw-r--r-- | storage/innobase/buf/buf0lru.cc | 12 | ||||
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 8 | ||||
-rw-r--r-- | storage/innobase/fil/fil0fil.cc | 20 | ||||
-rw-r--r-- | storage/innobase/handler/ha_xtradb.h | 4 | ||||
-rw-r--r-- | storage/innobase/include/buf0lru.h | 12 | ||||
-rw-r--r-- | storage/innobase/include/fil0fil.h | 10 | ||||
-rw-r--r-- | storage/innobase/include/ha0ha.h | 3 |
7 files changed, 49 insertions, 20 deletions
diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 10ee106137d..2d68b8e9ccd 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -696,22 +696,26 @@ buf_flush_dirty_pages( /** Empty the flush list for all pages belonging to a tablespace. @param[in] id tablespace identifier @param[in] observer flush observer, - or NULL if nothing is to be written -@param[in] drop_ahi whether to drop the adaptive hash index */ + or NULL if nothing is to be written */ void buf_LRU_flush_or_remove_pages( ulint id, - FlushObserver* observer, - bool drop_ahi) + FlushObserver* observer +#ifdef BTR_CUR_HASH_ADAPT + , bool drop_ahi /*!< whether to drop the adaptive hash index */ +#endif /* BTR_CUR_HASH_ADAPT */ + ) { /* Pages in the system tablespace must never be discarded. */ ut_ad(id || observer); for (ulint i = 0; i < srv_buf_pool_instances; i++) { buf_pool_t* buf_pool = buf_pool_from_array(i); +#ifdef BTR_CUR_HASH_ADAPT if (drop_ahi) { buf_LRU_drop_page_hash_for_tablespace(buf_pool, id); } +#endif /* BTR_CUR_HASH_ADAPT */ buf_flush_dirty_pages(buf_pool, id, observer); } diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 49c60e5df56..b93eb4d6b17 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -2,7 +2,7 @@ Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2017, MariaDB Corporation. +Copyright (c) 2013, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1641,7 +1641,11 @@ dict_table_rename_in_cache( return(DB_OUT_OF_MEMORY); } - fil_delete_tablespace(table->space, true); + fil_delete_tablespace(table->space +#ifdef BTR_CUR_HASH_ADAPT + , true +#endif /* BTR_CUR_HASH_ADAPT */ + ); /* Delete any temp file hanging around. */ if (os_file_status(filepath, &exists, &ftype) diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 86c0499eca4..9e31cb8bd81 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -2960,10 +2960,14 @@ fil_table_accessible(const dict_table_t* table) /** Delete a tablespace and associated .ibd file. @param[in] id tablespace identifier -@param[in] drop_ahi whether to drop the adaptive hash index @return DB_SUCCESS or error */ dberr_t -fil_delete_tablespace(ulint id, bool drop_ahi) +fil_delete_tablespace( + ulint id +#ifdef BTR_CUR_HASH_ADAPT + , bool drop_ahi /*!< whether to drop the adaptive hash index */ +#endif /* BTR_CUR_HASH_ADAPT */ + ) { char* path = 0; fil_space_t* space = 0; @@ -3006,7 +3010,11 @@ fil_delete_tablespace(ulint id, bool drop_ahi) To deal with potential read requests, we will check the ::stop_new_ops flag in fil_io(). */ - buf_LRU_flush_or_remove_pages(id, NULL, drop_ahi); + buf_LRU_flush_or_remove_pages(id, NULL +#ifdef BTR_CUR_HASH_ADAPT + , drop_ahi +#endif /* BTR_CUR_HASH_ADAPT */ + ); /* If it is a delete then also delete any generated files, otherwise when we drop the database the remove directory will fail. */ @@ -3286,7 +3294,11 @@ fil_discard_tablespace( { dberr_t err; - switch (err = fil_delete_tablespace(id, true)) { + switch (err = fil_delete_tablespace(id +#ifdef BTR_CUR_HASH_ADAPT + , true +#endif /* BTR_CUR_HASH_ADAPT */ + )) { case DB_SUCCESS: break; diff --git a/storage/innobase/handler/ha_xtradb.h b/storage/innobase/handler/ha_xtradb.h index 09628b7ec48..d2d1f361382 100644 --- a/storage/innobase/handler/ha_xtradb.h +++ b/storage/innobase/handler/ha_xtradb.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2000, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2009, Percona Inc. Portions of this file contain modifications contributed and copyrighted @@ -957,7 +957,9 @@ innodb_check_deprecated(void) #ifdef HA_XTRADB_SYSVARS /* XtraDB compatibility system variables */ +#ifdef BTR_CUR_HASH_ADAPT MYSQL_SYSVAR(adaptive_hash_index_partitions), +#endif /* BTR_CUR_HASH_ADAPT */ MYSQL_SYSVAR(buffer_pool_populate), #if defined UNIV_DEBUG || defined UNIV_PERF_DEBUG MYSQL_SYSVAR(cleaner_eviction_factor), diff --git a/storage/innobase/include/buf0lru.h b/storage/innobase/include/buf0lru.h index 7b739fc0332..f6a7695a2b5 100644 --- a/storage/innobase/include/buf0lru.h +++ b/storage/innobase/include/buf0lru.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -53,13 +53,15 @@ These are low-level functions /** Empty the flush list for all pages belonging to a tablespace. @param[in] id tablespace identifier @param[in,out] observer flush observer, - or NULL if nothing is to be written -@param[in] drop_ahi whether to drop the adaptive hash index */ + or NULL if nothing is to be written */ void buf_LRU_flush_or_remove_pages( ulint id, - FlushObserver* observer, - bool drop_ahi = false); + FlushObserver* observer +#ifdef BTR_CUR_HASH_ADAPT + , bool drop_ahi = false /*!< whether to drop the adaptive hash index */ +#endif /* BTR_CUR_HASH_ADAPT */ + ); #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG /********************************************************************//** diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 9fa507c2114..c2152ce11d0 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2017, MariaDB Corporation. +Copyright (c) 2013, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -931,10 +931,14 @@ fil_table_accessible(const dict_table_t* table) /** Delete a tablespace and associated .ibd file. @param[in] id tablespace identifier -@param[in] drop_ahi whether to drop the adaptive hash index @return DB_SUCCESS or error */ dberr_t -fil_delete_tablespace(ulint id, bool drop_ahi = false); +fil_delete_tablespace( + ulint id +#ifdef BTR_CUR_HASH_ADAPT + , bool drop_ahi = false /*!< whether to drop the adaptive hash index */ +#endif /* BTR_CUR_HASH_ADAPT */ + ); /** Truncate the tablespace to needed size. @param[in] space_id id of tablespace to truncate diff --git a/storage/innobase/include/ha0ha.h b/storage/innobase/include/ha0ha.h index ca4cb0a5f8f..f5be654f490 100644 --- a/storage/innobase/include/ha0ha.h +++ b/storage/innobase/include/ha0ha.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -210,7 +211,7 @@ struct ha_node_t { }; #endif /* BTR_CUR_HASH_ADAPT */ -#ifdef UNIV_DEBUG +#if defined UNIV_DEBUG && defined BTR_CUR_HASH_ADAPT /********************************************************************//** Assert that the synchronization object in a hash operation involving possible change in the hash table is held. |