From e5a81746de94d77e18d2b70a7410348dd6fc7624 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Apr 2007 14:31:46 +0200 Subject: [PATCH] Bug #21494 Master Cluster MySQLD is point of failure that can lead to mismatch slave data - insert gap event on cluster connect --- sql/ha_ndbcluster_binlog.cc | 8 ++++++++ sql/rpl_injector.cc | 2 +- sql/rpl_injector.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index e5b4cffa7fb..d1c2ad15894 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -3589,6 +3589,14 @@ restart: /* Main NDB Injector loop */ + { + /* + Always insert a GAP event as we cannot know what has happened in the cluster + while not being connected. + */ + LEX_STRING const msg= { C_STRING_WITH_LEN("Cluster connect") }; + inj->record_incident(thd, INCIDENT_LOST_EVENTS, msg); + } { thd->proc_info= "Waiting for ndbcluster to start"; diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index b22b052a105..b66f0b1c7c1 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -198,7 +198,7 @@ int injector::record_incident(THD *thd, Incident incident) return 0; } -int injector::record_incident(THD *thd, Incident incident, LEX_STRING message) +int injector::record_incident(THD *thd, Incident incident, LEX_STRING const message) { Incident_log_event ev(thd, incident, message); if (int error= mysql_bin_log.write(&ev)) diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h index eabf374857a..9c444ee20b3 100644 --- a/sql/rpl_injector.h +++ b/sql/rpl_injector.h @@ -324,7 +324,7 @@ public: void new_trans(THD *, transaction *); int record_incident(THD*, Incident incident); - int record_incident(THD*, Incident incident, LEX_STRING message); + int record_incident(THD*, Incident incident, LEX_STRING const message); private: explicit injector();