Commit ec062c61 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12121 follow-up: Unbreak the WITH_INNODB_AHI=OFF build

parent 72136ae7
......@@ -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);
}
......
......@@ -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)
......
......@@ -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;
......
/*****************************************************************************
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),
......
/*****************************************************************************
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
/********************************************************************//**
......
/*****************************************************************************
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
......
/*****************************************************************************
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.
......
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