Commit 78e6fafc authored by Marko Mäkelä's avatar Marko Mäkelä

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.
parent 171e59ed
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. 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 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 the terms of the GNU General Public License as published by the Free Software
...@@ -387,12 +388,6 @@ recv_sys_init( ...@@ -387,12 +388,6 @@ recv_sys_init(
} }
#ifndef UNIV_HOTBACKUP #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)); mutex_enter(&(recv_sys->mutex));
recv_sys->heap = mem_heap_create_typed(256, recv_sys->heap = mem_heap_create_typed(256,
...@@ -3030,6 +3025,11 @@ recv_recovery_from_checkpoint_start_func( ...@@ -3030,6 +3025,11 @@ recv_recovery_from_checkpoint_start_func(
byte* buf; byte* buf;
byte log_hdr_buf[LOG_FILE_HDR_SIZE]; byte log_hdr_buf[LOG_FILE_HDR_SIZE];
dberr_t err; 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); ut_when_dtor<recv_dblwr_t> tmp(recv_sys->dblwr);
#ifdef UNIV_LOG_ARCHIVE #ifdef UNIV_LOG_ARCHIVE
......
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