mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-7205 : Galera cluster & sql_log_bin = off don't work
While sql_bin_log=1(0) is meant to control binary logging for the current session so that the updates to do(not) get logged into the binary log to be replicated to the async MariaDB slave. The same should not affect galera replication. That is, the updates should always get replicated to other galera nodes regardless of sql_bin_log's value. Fixed by making sure that the updates are written to binlog cache irrespective of sql_bin_log. Added test cases.
This commit is contained in:
@ -5588,13 +5588,26 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
|
||||
DBUG_ASSERT(table->s->cached_row_logging_check == 0 ||
|
||||
table->s->cached_row_logging_check == 1);
|
||||
|
||||
return thd->is_current_stmt_binlog_format_row() &&
|
||||
return (thd->is_current_stmt_binlog_format_row() &&
|
||||
table->s->cached_row_logging_check &&
|
||||
(thd->variables.option_bits & OPTION_BIN_LOG) &&
|
||||
/* applier and replayer should not binlog */
|
||||
((IF_WSREP(WSREP_EMULATE_BINLOG(thd) &&
|
||||
thd->wsrep_exec_mode != REPL_RECV, 0)) ||
|
||||
mysql_bin_log.is_open());
|
||||
/*
|
||||
Wsrep partially enables binary logging if it have not been
|
||||
explicitly turned on. As a result we return 'true' if we are in
|
||||
wsrep binlog emulation mode and the current thread is not a wsrep
|
||||
applier or replayer thread. This decision is not affected by
|
||||
@@sql_log_bin as we want the events to make into the binlog
|
||||
cache only to filter them later before they make into binary log
|
||||
file.
|
||||
|
||||
However, we do return 'false' if binary logging was temporarily
|
||||
turned off (see tmp_disable_binlog(A)).
|
||||
|
||||
Otherwise, return 'true' if binary logging is on.
|
||||
*/
|
||||
(thd->variables.sql_log_bin_off != 1) &&
|
||||
((WSREP_EMULATE_BINLOG(thd) && (thd->wsrep_exec_mode != REPL_RECV)) ||
|
||||
((WSREP(thd) || (thd->variables.option_bits & OPTION_BIN_LOG)) &&
|
||||
mysql_bin_log.is_open())));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user