Commit ca2ea4ff authored by Monty's avatar Monty Committed by Jan Lindström

Only apply wsrep_trx_fragment_size to InnoDB tables

MDEV-22617 Galera node crashes when trying to log to slow_log table in
streaming replication mode

Other things:
- Changed name of wsrep_after_row(two arguments) to
  wsrep_after_row_internal(one argument) to not depended on the
  function signature with unused arguments.
Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
	     Added test case
parent 4eec6b99
connection node_2;
connection node_1;
connection node_1;
SET GLOBAL wsrep_trx_fragment_unit='bytes';
SET GLOBAL wsrep_trx_fragment_size=10240000;
SET GLOBAL slow_query_log=ON;
SET GLOBAL log_output='TABLE';
SELECT SLEEP(10);
SLEEP(10)
0
SET GLOBAL wsrep_trx_fragment_unit=DEFAULT;
SET GLOBAL wsrep_trx_fragment_size=DEFAULT;
SET GLOBAL log_output=DEFAULT;
--source include/galera_cluster.inc
--connection node_1
SET GLOBAL wsrep_trx_fragment_unit='bytes';
SET GLOBAL wsrep_trx_fragment_size=10240000;
SET GLOBAL slow_query_log=ON;
SET GLOBAL log_output='TABLE';
SELECT SLEEP(10);
SET GLOBAL wsrep_trx_fragment_unit=DEFAULT;
SET GLOBAL wsrep_trx_fragment_size=DEFAULT;
SET GLOBAL log_output=DEFAULT;
...@@ -6579,7 +6579,7 @@ static int wsrep_after_row(THD *thd) ...@@ -6579,7 +6579,7 @@ static int wsrep_after_row(THD *thd)
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0)); my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
DBUG_RETURN(ER_ERROR_DURING_COMMIT); DBUG_RETURN(ER_ERROR_DURING_COMMIT);
} }
else if (wsrep_after_row(thd, false)) else if (wsrep_after_row_internal(thd))
{ {
DBUG_RETURN(ER_LOCK_DEADLOCK); DBUG_RETURN(ER_LOCK_DEADLOCK);
} }
...@@ -6778,7 +6778,8 @@ int handler::ha_write_row(const uchar *buf) ...@@ -6778,7 +6778,8 @@ int handler::ha_write_row(const uchar *buf)
error= binlog_log_row(table, 0, buf, log_func); error= binlog_log_row(table, 0, buf, log_func);
#ifdef WITH_WSREP #ifdef WITH_WSREP
if (table_share->tmp_table == NO_TMP_TABLE && if (table_share->tmp_table == NO_TMP_TABLE &&
WSREP(ha_thd()) && (error= wsrep_after_row(ha_thd()))) WSREP(ha_thd()) && ht->flags & HTON_WSREP_REPLICATION &&
!error && (error= wsrep_after_row(ha_thd())))
{ {
DBUG_RETURN(error); DBUG_RETURN(error);
} }
...@@ -6836,7 +6837,8 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data) ...@@ -6836,7 +6837,8 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data)
} }
} }
if (table_share->tmp_table == NO_TMP_TABLE && if (table_share->tmp_table == NO_TMP_TABLE &&
is_wsrep && (error= wsrep_after_row(thd))) is_wsrep && ht->flags & HTON_WSREP_REPLICATION &&
!error && (error= wsrep_after_row(thd)))
{ {
return error; return error;
} }
...@@ -6911,7 +6913,8 @@ int handler::ha_delete_row(const uchar *buf) ...@@ -6911,7 +6913,8 @@ int handler::ha_delete_row(const uchar *buf)
} }
} }
if (table_share->tmp_table == NO_TMP_TABLE && if (table_share->tmp_table == NO_TMP_TABLE &&
is_wsrep && (error= wsrep_after_row(thd))) is_wsrep && ht->flags & HTON_WSREP_REPLICATION &&
!error && (error= wsrep_after_row(thd)))
{ {
return error; return error;
} }
......
...@@ -158,7 +158,7 @@ static inline int wsrep_start_trx_if_not_started(THD* thd) ...@@ -158,7 +158,7 @@ static inline int wsrep_start_trx_if_not_started(THD* thd)
Return zero on succes, non-zero on failure. Return zero on succes, non-zero on failure.
*/ */
static inline int wsrep_after_row(THD* thd, bool) static inline int wsrep_after_row_internal(THD* thd)
{ {
if (thd->wsrep_cs().state() != wsrep::client_state::s_none && if (thd->wsrep_cs().state() != wsrep::client_state::s_none &&
wsrep_thd_is_local(thd)) wsrep_thd_is_local(thd))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment