mirror of
https://github.com/MariaDB/server.git
synced 2025-12-28 08:10:14 +00:00
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: Jan Lindström <jan.lindstrom@mariadb.com> Added test case
This commit is contained in:
parent
4eec6b99e1
commit
ca2ea4ff41
13
mysql-test/suite/galera_sr/r/galera_sr_slow.result
Normal file
13
mysql-test/suite/galera_sr/r/galera_sr_slow.result
Normal file
@ -0,0 +1,13 @@
|
||||
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;
|
||||
11
mysql-test/suite/galera_sr/t/galera_sr_slow.test
Normal file
11
mysql-test/suite/galera_sr/t/galera_sr_slow.test
Normal file
@ -0,0 +1,11 @@
|
||||
--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)
|
||||
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
|
||||
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);
|
||||
}
|
||||
@ -6778,7 +6778,8 @@ int handler::ha_write_row(const uchar *buf)
|
||||
error= binlog_log_row(table, 0, buf, log_func);
|
||||
#ifdef WITH_WSREP
|
||||
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);
|
||||
}
|
||||
@ -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 &&
|
||||
is_wsrep && (error= wsrep_after_row(thd)))
|
||||
is_wsrep && ht->flags & HTON_WSREP_REPLICATION &&
|
||||
!error && (error= wsrep_after_row(thd)))
|
||||
{
|
||||
return error;
|
||||
}
|
||||
@ -6911,7 +6913,8 @@ int handler::ha_delete_row(const uchar *buf)
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ static inline int wsrep_start_trx_if_not_started(THD* thd)
|
||||
|
||||
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 &&
|
||||
wsrep_thd_is_local(thd))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user