summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-10 14:11:32 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-10 14:28:05 +0200
commit78e6fafcaa93bdd2cf793a82a812137eb7a779a7 (patch)
tree37cecc919c26bf3c14ebef617bebaa1b1e39d2ab
parent171e59ed479ee347dae04a34855ea3c29b13349d (diff)
downloadmariadb-git-78e6fafcaa93bdd2cf793a82a812137eb7a779a7.tar.gz
Fix an innodb_plugin leak noted in MDEV-11686
buf_flush_init_flush_rbt() was called too early in MariaDB server 10.0, 10.1, MySQL 5.5 and MySQL 5.6. The memory leak has been fixed in the XtraDB storage engine and in MySQL 5.7. As a result, when the server is started to initialize new data files, the buf_pool->flush_rbt will be created unnecessarily and then leaked. This memory leak was noticed in MariaDB server 10.1 when running the test encryption.innodb_first_page.
-rw-r--r--storage/innobase/log/log0recv.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 85f4f6ea671..aed94d00834 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -2,6 +2,7 @@
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
+Copyright (c) 2017, MariaDB Corporation. All Rights Reserved.
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
@@ -387,12 +388,6 @@ recv_sys_init(
}
#ifndef UNIV_HOTBACKUP
- /* Initialize red-black tree for fast insertions into the
- flush_list during recovery process.
- As this initialization is done while holding the buffer pool
- mutex we perform it before acquiring recv_sys->mutex. */
- buf_flush_init_flush_rbt();
-
mutex_enter(&(recv_sys->mutex));
recv_sys->heap = mem_heap_create_typed(256,
@@ -3030,6 +3025,11 @@ recv_recovery_from_checkpoint_start_func(
byte* buf;
byte log_hdr_buf[LOG_FILE_HDR_SIZE];
dberr_t err;
+
+ /* Initialize red-black tree for fast insertions into the
+ flush_list during recovery process. */
+ buf_flush_init_flush_rbt();
+
ut_when_dtor<recv_dblwr_t> tmp(recv_sys->dblwr);
#ifdef UNIV_LOG_ARCHIVE