Skip to content

Commit f0c0859

Browse files
author
Maitrayi Sabaratnam
committed
Bug 19895502 - BINARY LOG GROUP COMMIT CAUSES REGRESSION FOR NDB REPLICATION.
A call to ha_flush_logs - introdueced by WL5223 in MYSQL_BIN_LOG::new_file_impl- causes a deadlock in the Ndb handler implementation of ha_flush_logs(), because it is now called after Binlog is locked (Lock_log). This lock prevents ha_flush_logs() from writing to Binlog causing deadlock. ha_flush_logs is now used as storage engine checkpointing and thus not relevant for Ndb. Removing it.
1 parent 1e8fbb5 commit f0c0859

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

mysql-test/suite/ndb_binlog/t/disabled.def

-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
# Do not use any TAB characters for whitespace.
1010
#
1111
##############################################################################
12-
ndb_binlog_purge : Bug#16884594 30/5/13 FC Timeouts due to ha_flush_logs deadlocks
1312

sql/ha_ndbcluster_binlog.cc

+6-15
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,9 @@ static void ndbcluster_binlog_wait(THD *thd)
497497
{
498498
DBUG_ENTER("ndbcluster_binlog_wait");
499499
DBUG_ASSERT(thd);
500-
500+
DBUG_ASSERT(thd_sql_command(thd) == SQLCOM_SHOW_BINLOG_EVENTS ||
501+
thd_sql_command(thd) == SQLCOM_FLUSH ||
502+
thd_sql_command(thd) == SQLCOM_RESET);
501503
/*
502504
Binlog Injector should not wait for itself
503505
*/
@@ -556,6 +558,9 @@ static void ndbcluster_binlog_wait(THD *thd)
556558
Uint32(start_handled_epoch & 0xffffffff),
557559
Uint32((ndb_latest_handled_binlog_epoch >> 32) & 0xffffffff),
558560
Uint32(ndb_latest_handled_binlog_epoch & 0xffffffff));
561+
562+
// Fail on wait/deadlock timeout in debug compile
563+
DBUG_ASSERT(false);
559564
}
560565

561566
thd->proc_info= save_info;
@@ -928,19 +933,6 @@ static void ndbcluster_reset_slave(THD *thd)
928933
Initialize the binlog part of the ndb handlerton
929934
*/
930935

931-
/**
932-
Upon the sql command flush logs, we need to ensure that all outstanding
933-
changes made to ndb by the current thread have entered the binary log
934-
in order to get a deterministic behavior on the rotation of the log.
935-
'current_thd' should not be NULL.
936-
*/
937-
static bool ndbcluster_flush_logs(handlerton *hton)
938-
{
939-
ndbcluster_binlog_wait(current_thd);
940-
return FALSE;
941-
}
942-
943-
944936
static int ndbcluster_binlog_func(handlerton *hton, THD *thd,
945937
enum_binlog_func fn,
946938
void *arg)
@@ -971,7 +963,6 @@ static int ndbcluster_binlog_func(handlerton *hton, THD *thd,
971963
void ndbcluster_binlog_init_handlerton()
972964
{
973965
handlerton *h= ndbcluster_hton;
974-
h->flush_logs= ndbcluster_flush_logs;
975966
h->binlog_func= ndbcluster_binlog_func;
976967
h->binlog_log_query= ndbcluster_binlog_log_query;
977968
}

0 commit comments

Comments
 (0)