summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-12-14 11:33:52 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2015-12-14 11:33:52 -0500
commit18173ddfc4081407832d9a6703d1b8356b7defe9 (patch)
tree256d4a448cdadc5adfa5f75445d1906d3b7aef2c /storage/innobase
parent4437f51682b22caaf2cf0b00de1bf6fa3edf6557 (diff)
downloadmariadb-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 'storage/innobase')
-rw-r--r--storage/innobase/handler/ha_innodb.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 8bc00e40051..51f37aa4f06 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -7760,7 +7760,8 @@ report_error:
if (!error_result &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
wsrep_on(user_thd) &&
- !wsrep_consistency_check(user_thd))
+ !wsrep_consistency_check(user_thd) &&
+ !wsrep_thd_skip_append_keys(user_thd))
{
if (wsrep_append_keys(user_thd, false, record, NULL))
{
@@ -8278,10 +8279,11 @@ func_exit:
innobase_active_small();
#ifdef WITH_WSREP
- if (error == DB_SUCCESS &&
+ if (error == DB_SUCCESS &&
wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
- wsrep_on(user_thd)) {
-
+ wsrep_on(user_thd) &&
+ !wsrep_thd_skip_append_keys(user_thd))
+ {
DBUG_PRINT("wsrep", ("update row key"));
if (wsrep_append_keys(user_thd, false, old_row, new_row)) {
@@ -8343,10 +8345,11 @@ ha_innobase::delete_row(
innobase_active_small();
#ifdef WITH_WSREP
- if (error == DB_SUCCESS &&
- wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
- wsrep_on(user_thd)) {
-
+ if (error == DB_SUCCESS &&
+ wsrep_thd_exec_mode(user_thd) == LOCAL_STATE &&
+ wsrep_on(user_thd) &&
+ !wsrep_thd_skip_append_keys(user_thd))
+ {
if (wsrep_append_keys(user_thd, false, record, NULL)) {
DBUG_PRINT("wsrep", ("delete fail"));
error = (dberr_t)HA_ERR_INTERNAL_ERROR;