Skip to content

Commit

Permalink
MDEV-12121: Clean up WITH_INNODB_AHI=OFF
Browse files Browse the repository at this point in the history
buf_flush_or_remove_pages(): Only define BUF_LRU_DROP_SEARCH_SIZE
and dependent code when the adaptive hash index has been enabled.
  • Loading branch information
dr-m committed Feb 6, 2020
1 parent 236aed3 commit ebbc572
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions storage/innobase/buf/buf0lru.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2019, MariaDB Corporation.
Copyright (c) 2017, 2020, 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
Expand Down Expand Up @@ -62,6 +62,7 @@ static const ulint BUF_LRU_OLD_TOLERANCE = 20;
# error "BUF_LRU_NON_OLD_MIN_LEN >= BUF_LRU_OLD_MIN_LEN"
#endif

#ifdef BTR_CUR_HASH_ADAPT
/** When dropping the search hash index entries before deleting an ibd
file, we build a local array of pages belonging to that tablespace
in the buffer pool. Following is the size of that array.
Expand All @@ -70,6 +71,7 @@ flush_list when dropping a table. This is to ensure that other threads
are not blocked for extended period of time when using very large
buffer pools. */
static const ulint BUF_LRU_DROP_SEARCH_SIZE = 1024;
#endif /* BTR_CUR_HASH_ADAPT */

/** We scan these many blocks when looking for a clean page to evict
during LRU eviction. */
Expand Down Expand Up @@ -379,7 +381,6 @@ bool buf_LRU_drop_page_hash_for_tablespace(dict_table_t* table)

return true;
}
#endif /* BTR_CUR_HASH_ADAPT */

/******************************************************************//**
While flushing (or removing dirty) pages from a tablespace we don't
Expand Down Expand Up @@ -468,6 +469,7 @@ buf_flush_try_yield(

return(false);
}
#endif /* BTR_CUR_HASH_ADAPT */

/******************************************************************//**
Removes a single page from a given tablespace inside a specific
Expand Down Expand Up @@ -643,6 +645,7 @@ buf_flush_or_remove_pages(
goto rescan;
}

#ifdef BTR_CUR_HASH_ADAPT
++processed;

/* Yield if we have hogged the CPU and mutexes for too long. */
Expand All @@ -652,6 +655,7 @@ buf_flush_or_remove_pages(

processed = 0;
}
#endif /* BTR_CUR_HASH_ADAPT */

/* The check for trx is interrupted is expensive, we want
to check every N iterations. */
Expand Down

0 comments on commit ebbc572

Please sign in to comment.