Skip to content

Commit

Permalink
Fix an innodb_plugin leak noted in MDEV-11686
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Jan 10, 2017
1 parent 171e59e commit 78e6faf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions storage/innobase/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 78e6faf

Please sign in to comment.