diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-12-14 11:33:52 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2015-12-14 11:33:52 -0500 |
commit | 18173ddfc4081407832d9a6703d1b8356b7defe9 (patch) | |
tree | 256d4a448cdadc5adfa5f75445d1906d3b7aef2c /sql/rpl_gtid.cc | |
parent | 4437f51682b22caaf2cf0b00de1bf6fa3edf6557 (diff) | |
download | mariadb-git-18173ddfc4081407832d9a6703d1b8356b7defe9.tar.gz |
MDEV-9162 : MariaDB Galera Cluster memory leak on async slave node
As galera node (slave) received query log events from an async
replication master, it partially wrote the updates made to replication
state table (mysql.gtid_slave_pos) to galera transaction writeset post
TOI. As a result, the transaction handle, thus created within galera,
was never freed/purged as the corresponding trx did not commit.
Thus, it kept piling up for every query log event and was only reclaimed
upon server shutdown when the transaction map object got destructed.
Fixed by making sure that updates in replication slave state table
are not written to galera transaction writeset and thus, not replicated
to other nodes.
Diffstat (limited to 'sql/rpl_gtid.cc')
-rw-r--r-- | sql/rpl_gtid.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 709cb284df5..81f2dd5812a 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -574,6 +574,14 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, if ((err= gtid_check_rpl_slave_state_table(table))) goto end; +#ifdef WITH_WSREP + /* + Updates in slave state table should not be appended to galera transaction + writeset. + */ + thd->wsrep_skip_append_keys= true; +#endif + if (!in_transaction) { DBUG_PRINT("info", ("resetting OPTION_BEGIN")); @@ -687,6 +695,10 @@ IF_DBUG(dbug_break:, ) end: +#ifdef WITH_WSREP + thd->wsrep_skip_append_keys= false; +#endif + if (table_opened) { if (err || (err= ha_commit_trans(thd, FALSE))) |