Commit e1ed3dce authored by Nirbhay Choubey's avatar Nirbhay Choubey

MDEV#5407, MDEV#5386, MVED#4222

Problem: As, wsrep_provider is dynamic and can accept
a valid provider while server is running. Patch for
#4222 wrongly skips the initialization of binlog plugin
during server start, when wsrep provider is not specified.

In wsrep build, if opt_log_bin is not provided, we still
init binlog with wsrep_emulate_bin_log ON.

Fix: This patch fixes #4222 by adding a check to return
from binlog_savepoint_set without proceeding further if
wsrep_on is OFF/false.

This patch also fixes MDEV#5407 and reverts changes pushed
for MDEV#5386 (no longer valid).
parent 3ad45220
......@@ -1708,7 +1708,7 @@ int binlog_init(void *p)
{
binlog_hton= (handlerton *)p;
#ifdef WITH_WSREP
if (WSREP_ON && WSREP_PROVIDER_EXISTS)
if (WSREP_ON)
binlog_hton->state= SHOW_OPTION_YES;
else
{
......@@ -2217,6 +2217,14 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
{
DBUG_ENTER("binlog_savepoint_set");
#ifdef WITH_WSREP
/*
If wsrep_emulate_bin_log is true, (i.e opt_bin_log == false),
we should return from here if wsrep_on is off.
*/
if (wsrep_emulate_bin_log && !WSREP(thd)) DBUG_RETURN(0);
#endif /* WITH_WSREP */
binlog_trans_log_savepos(thd, (my_off_t*) sv);
/* Write it to the binary log */
#ifdef WITH_WSREP
......
......@@ -62,7 +62,6 @@
#ifdef WITH_WSREP
#include "wsrep_mysqld.h"
extern handlerton *binlog_hton;
#endif // WITH_WSREP
bool
......@@ -1575,11 +1574,6 @@ void close_thread_tables(THD *thd)
handled either before writing a query log event (inside
binlog_query()) or when preparing a pending event.
*/
#ifdef WITH_WSREP
/* In Galera binlog is not enabled by default in case when
wsrep provider is not specified. */
if ((WSREP_ON && WSREP_PROVIDER_EXISTS) || binlog_hton->state == SHOW_OPTION_YES)
#endif
(void)thd->binlog_flush_pending_rows_event(TRUE);
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
......
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