From: Venkatesh Duggirala Date: January 26 2013 9:54am Subject: bzr push into mysql-trunk branch (venkatesh.duggirala:5446 to 5447) Bug#16056813 List-Archive: http://lists.mysql.com/commits/145637 X-Bug: 16056813 Message-Id: <20130126095403.29901.37071.5447@venkatesh-ThinkPad-T420> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 5447 Venkatesh Duggirala 2013-01-26 [merge] BUG#16056813-MEMORY LEAK ON FILTERED SLAVE Merging fix from mysql-5.6 modified: sql/log_event.h sql/rpl_rli.h sql/rpl_slave.cc sql/rpl_utility.cc sql/rpl_utility.h 5446 Sunny Bains 2013-01-26 Undo a change that was mistakenly committed in sunny.bains@stripped. modified: storage/innobase/srv/srv0start.cc === modified file 'sql/log_event.h' --- a/sql/log_event.h revid:sunny.bains@stripped +++ b/sql/log_event.h revid:venkatesh.duggirala@stripped @@ -1148,6 +1148,8 @@ public: /** MTS: associating the event with either an assigned Worker or Coordinator. + Additionally the member serves to tag deferred (IRU) events to avoid + the event regular time destruction. */ Relay_log_info *worker; === modified file 'sql/rpl_rli.h' --- a/sql/rpl_rli.h revid:sunny.bains@stripped +++ b/sql/rpl_rli.h revid:venkatesh.duggirala@stripped @@ -668,14 +668,6 @@ public: /* * End of MTS section ******************************************************/ - /* - Returns true if the argument event resides in the containter; - more specifically, the checking is done against the last added event. - */ - bool is_deferred_event(Log_event * ev) - { - return deferred_events_collecting ? deferred_events->is_last(ev) : false; - }; /* The general cleanup that slave applier may need at the end of query. */ inline void cleanup_after_query() { === modified file 'sql/rpl_slave.cc' --- a/sql/rpl_slave.cc revid:sunny.bains@stripped +++ b/sql/rpl_slave.cc revid:venkatesh.duggirala@stripped @@ -3720,6 +3720,11 @@ static int exec_relay_log_event(THD* thd mysql_mutex_unlock(&rli->data_lock); */ + /* For deferred events, the ptr_ev is set to NULL + in Deferred_log_events::add() function. + Hence deferred events wont be deleted here. + They will be deleted in Deferred_log_events::rewind() funciton. + */ if (*ptr_ev) { DBUG_ASSERT(*ptr_ev == ev); // event remains to belong to Coordinator === modified file 'sql/rpl_utility.cc' --- a/sql/rpl_utility.cc revid:sunny.bains@stripped +++ b/sql/rpl_utility.cc revid:venkatesh.duggirala@stripped @@ -1481,19 +1481,18 @@ Hash_slave_rows::make_hash_key(TABLE *ta #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) -Deferred_log_events::Deferred_log_events(Relay_log_info *rli) : last_added(NULL) +Deferred_log_events::Deferred_log_events(Relay_log_info *rli) { my_init_dynamic_array(&array, sizeof(Log_event *), 32, 16); } -Deferred_log_events::~Deferred_log_events() +Deferred_log_events::~Deferred_log_events() { delete_dynamic(&array); } int Deferred_log_events::add(Log_event *ev) { - last_added= ev; insert_dynamic(&array, (uchar*) &ev); ev->worker= NULL; // to mark event busy avoiding deletion return 0; === modified file 'sql/rpl_utility.h' --- a/sql/rpl_utility.h revid:sunny.bains@stripped +++ b/sql/rpl_utility.h revid:venkatesh.duggirala@stripped @@ -462,7 +462,6 @@ class Deferred_log_events { private: DYNAMIC_ARRAY array; - Log_event *last_added; public: Deferred_log_events(Relay_log_info *rli); @@ -472,7 +471,6 @@ public: bool is_empty(); bool execute(Relay_log_info *rli); void rewind(); - bool is_last(Log_event *ev) { return ev == last_added; }; }; #endif No bundle (reason: useless for push emails).