From 63f922dae192dd4579c39dbf097c6dadcb275273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 31 Mar 2020 14:42:07 +0300 Subject: MDEV-22090 Change buffer is not freed after dropping or rebuilding table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When MDEV-19514 removed the change buffer merges in the background, it introduced a minor regression: After a DDL operation that drops or rebuilds a table or partition, any entries in the change buffer could survive until a slow shutdown (innodb_fast_shutdown=0) is executed. fil_delete_tablespace(). Before returning, invoke ibuf_delete_for_discarded_space(). With this, the only way to have change buffer ‘leaks’ is to kill and restart the server at an appropriate moment and never initiate a slow shutdown. --- storage/innobase/fil/fil0fil.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'storage') diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index fd0a94b4c64..78805b0547b 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -2272,7 +2272,7 @@ dberr_t fil_delete_tablespace(ulint id, bool if_exists) " in the tablespace memory cache."; } - return(err); + goto func_exit; } ut_a(space); @@ -2367,8 +2367,9 @@ dberr_t fil_delete_tablespace(ulint id, bool if_exists) err = DB_TABLESPACE_NOT_FOUND; } +func_exit: ut_free(path); - + ibuf_delete_for_discarded_space(id); return(err); } -- cgit v1.2.1