summaryrefslogtreecommitdiff
path: root/storage/innobase/buf
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-03-20 18:08:16 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-03-20 18:12:17 +0200
commit44298e4dea39280187c587c6e776ce8d04e350de (patch)
tree15f8bac3c985c4f07fd6af066439d046dbb13c35 /storage/innobase/buf
parentdd68db0c17d674f1b64e70ff7ea9e3f4abe4ee3e (diff)
parent9f7b8625e698da6b7eba7c26e765c66635571919 (diff)
downloadmariadb-git-44298e4dea39280187c587c6e776ce8d04e350de.tar.gz
Merge 10.2 into 10.3
Also, clean up the test innodb_gis.geometry a little further.
Diffstat (limited to 'storage/innobase/buf')
-rw-r--r--storage/innobase/buf/buf0buf.cc22
-rw-r--r--storage/innobase/buf/buf0rea.cc8
2 files changed, 9 insertions, 21 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index fe2a09f0a21..54b527007c6 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -2,7 +2,7 @@
Copyright (c) 1995, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
-Copyright (c) 2013, 2019, MariaDB Corporation.
+Copyright (c) 2013, 2020, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -2689,23 +2689,6 @@ buf_pool_resize_hash(
buf_pool->zip_hash = new_hash_table;
}
-#ifndef DBUG_OFF
-/** This is a debug routine to inject an memory allocation failure error. */
-static
-void
-buf_pool_resize_chunk_make_null(buf_chunk_t** new_chunks)
-{
- static int count = 0;
-
- if (count == 1) {
- ut_free(*new_chunks);
- *new_chunks = NULL;
- }
-
- count++;
-}
-#endif // DBUG_OFF
-
/** Resize the buffer pool based on srv_buf_pool_size from
srv_buf_pool_old_size. */
static
@@ -2973,7 +2956,8 @@ withdraw_retry:
ut_zalloc_nokey_nofatal(new_chunks_size));
DBUG_EXECUTE_IF("buf_pool_resize_chunk_null",
- buf_pool_resize_chunk_make_null(&new_chunks););
+ ut_free(new_chunks);
+ new_chunks = NULL;);
if (new_chunks == NULL) {
ib::error() << "buffer pool " << i
diff --git a/storage/innobase/buf/buf0rea.cc b/storage/innobase/buf/buf0rea.cc
index 5c8b98746c8..7877087dd4a 100644
--- a/storage/innobase/buf/buf0rea.cc
+++ b/storage/innobase/buf/buf0rea.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1995, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 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
@@ -925,8 +925,12 @@ buf_read_recv_pages(
ulint count = 0;
buf_pool = buf_pool_get(cur_page_id);
- while (buf_pool->n_pend_reads >= recv_n_pool_free_frames / 2) {
+ ulint limit = 0;
+ for (ulint j = 0; j < buf_pool->n_chunks; j++) {
+ limit += buf_pool->chunks[j].size / 2;
+ }
+ while (buf_pool->n_pend_reads >= limit) {
os_aio_simulated_wake_handler_threads();
os_thread_sleep(10000);