summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster_binlog.cc
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-11-01 15:08:00 +0100
committerunknown <tomas@whalegate.ndb.mysql.com>2007-11-01 15:08:00 +0100
commitde0780e00a184620f1831a5035fded5f314312d4 (patch)
tree05333557b7b6c5398ed08a6d7364424e181386b1 /sql/ha_ndbcluster_binlog.cc
parentc67d7e67d283e4e3c0153e8e4c5c345bbb5cafd3 (diff)
downloadmariadb-git-de0780e00a184620f1831a5035fded5f314312d4.tar.gz
Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart.
Diffstat (limited to 'sql/ha_ndbcluster_binlog.cc')
-rw-r--r--sql/ha_ndbcluster_binlog.cc35
1 files changed, 31 insertions, 4 deletions
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 5d5c8a26447..75e9937ecd6 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -3587,6 +3587,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
Thd_ndb *thd_ndb=0;
int ndb_update_ndb_binlog_index= 1;
injector *inj= injector::instance();
+ uint incident_id= 0;
#ifdef RUN_NDB_BINLOG_TIMER
Timer main_timer;
@@ -3692,17 +3693,43 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
pthread_mutex_unlock(&injector_mutex);
pthread_cond_signal(&injector_cond);
+ /*
+ wait for mysql server to start (so that the binlog is started
+ and thus can receive the first GAP event)
+ */
+ pthread_mutex_lock(&LOCK_server_started);
+ while (!mysqld_server_started)
+ {
+ struct timespec abstime;
+ set_timespec(abstime, 1);
+ pthread_cond_timedwait(&COND_server_started, &LOCK_server_started,
+ &abstime);
+ if (ndbcluster_terminating)
+ {
+ pthread_mutex_unlock(&LOCK_server_started);
+ pthread_mutex_lock(&LOCK_ndb_util_thread);
+ goto err;
+ }
+ }
+ pthread_mutex_unlock(&LOCK_server_started);
restart:
/*
Main NDB Injector loop
*/
{
/*
- Always insert a GAP event as we cannot know what has happened in the cluster
- while not being connected.
+ 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);
+ LEX_STRING const msg[2]=
+ {
+ { C_STRING_WITH_LEN("mysqld startup") },
+ { C_STRING_WITH_LEN("cluster disconnect")}
+ };
+ IF_DBUG(int error=)
+ inj->record_incident(thd, INCIDENT_LOST_EVENTS, msg[incident_id]);
+ DBUG_ASSERT(!error);
+ incident_id= 1;
}
{
thd->proc_info= "Waiting for ndbcluster to start";