[MDEV-4066] semisync_master + temporary tables causes memory leaks Created: 2013-01-17 Updated: 2013-03-07 Resolved: 2013-03-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.0, 10.0.1, 5.5.29 |
| Fix Version/s: | 10.0.2, 5.5.30 |
| Type: | Bug | Priority: | Major |
| Reporter: | Pavel Ivanov | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
When connection closes THD::cleanup() is called, it calls close_temporary_tables(), which in turn calls MYSQL_BIN_LOG::write() to write DROP TABLE record into binlog. After record is written MYSQL_BIN_LOG::write() calls Binlog_storage_delegate::after_flush() if any observers are registered (I believe only semisync_master implements this observer currently). And here Trans_binlog_info is allocated which is supposed to be released in Trans_delegate::after_commit() or Trans_delegate::after_rollback(). But neither THD::cleanup() nor its callers commit/rollback the transaction and thus Trans_binlog_info is leaking. |
| Comments |
| Comment by Elena Stepanova [ 2013-01-18 ] |
|
With the test case below, I'm getting a valgrind error. Reproducible on MySQL 5.5 and MariaDB 5.5, 10.0. Not reproducible on MySQL 5.6, so apparently it's fixed there; but it's worth checking whether the fix will apply to MariaDB, and decide if it needs to be fixed in 5.5 as well (I've added 5.5 to the fix versions for now).
source include/have_semisync_plugin.inc; connection master; eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_SO'; --connect (con1,localhost,root,,)
Warning: 520 bytes lost, allocated at sql/rpl_handler.cc:300, sql/log.cc:5469, sql/sql_base.cc:1807, sql/sql_class.cc:1417, sql/mysqld.cc:2439, sql/mysqld.cc:2473, sql/mysqld.cc:2597, sql/sql_connect.cc:1264 |
| Comment by Sergei Golubchik [ 2013-03-07 ] |
|
pushed in 5.5 |