From: Date: November 1 2007 3:08pm Subject: bk commit into 5.1 tree (tomas:1.2572) BUG#31484 List-Archive: http://lists.mysql.com/commits/36874 X-Bug: 31484 Message-Id: <20071101140806.16BDC1811D63D@linux.local> Below is the list of changes that have just been committed into a local 5.1 repository of tomas. When tomas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-11-01 15:08:00+01:00, tomas@stripped +5 -0 Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. mysql-test/include/have_multi_ndb.inc@stripped, 2007-11-01 15:07:57+01:00, tomas@stripped +2 -10 Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. mysql-test/suite/ndb/r/ndb_multi_row.result@stripped, 2007-11-01 15:07:57+01:00, tomas@stripped +1 -0 Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. mysql-test/suite/ndb/t/ndb_multi_row.test@stripped, 2007-11-01 15:07:57+01:00, tomas@stripped +2 -1 Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. sql/ha_ndbcluster.cc@stripped, 2007-11-01 15:07:57+01:00, tomas@stripped +1 -1 Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. sql/ha_ndbcluster_binlog.cc@stripped, 2007-11-01 15:07:57+01:00, tomas@stripped +31 -4 Bug #31484 Cluster LOST_EVENTS entry not added to binlog on mysqld restart. diff -Nrup a/mysql-test/include/have_multi_ndb.inc b/mysql-test/include/have_multi_ndb.inc --- a/mysql-test/include/have_multi_ndb.inc 2007-06-18 23:55:45 +02:00 +++ b/mysql-test/include/have_multi_ndb.inc 2007-11-01 15:07:57 +01:00 @@ -5,10 +5,6 @@ connect (server2,127.0.0.1,root,,test,$M # Check that server1 has NDB support connection server1; disable_query_log; ---disable_warnings -drop table if exists t1, t2; ---enable_warnings -flush tables; --require r/true.require select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster'; --source include/ndb_not_readonly.inc @@ -17,14 +13,10 @@ enable_query_log; # Check that server2 has NDB support connection server2; disable_query_log; ---disable_warnings -drop table if exists t1, t2; ---enable_warnings -flush tables; --require r/true.require select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster'; --source include/ndb_not_readonly.inc enable_query_log; -# Set the default connection to 'server1' -connection server1; +# Set the default connection +connection default; diff -Nrup a/mysql-test/suite/ndb/r/ndb_multi_row.result b/mysql-test/suite/ndb/r/ndb_multi_row.result --- a/mysql-test/suite/ndb/r/ndb_multi_row.result 2007-06-27 14:27:25 +02:00 +++ b/mysql-test/suite/ndb/r/ndb_multi_row.result 2007-11-01 15:07:57 +01:00 @@ -1,4 +1,5 @@ drop table if exists t1, t2, t3, t4; +flush status; drop table if exists t1, t2, t3, t4; flush status; create table t1 (a int) engine=ndbcluster; diff -Nrup a/mysql-test/suite/ndb/t/ndb_multi_row.test b/mysql-test/suite/ndb/t/ndb_multi_row.test --- a/mysql-test/suite/ndb/t/ndb_multi_row.test 2007-07-25 15:29:29 +02:00 +++ b/mysql-test/suite/ndb/t/ndb_multi_row.test 2007-11-01 15:07:57 +01:00 @@ -6,11 +6,12 @@ --disable_warnings connection server2; drop table if exists t1, t2, t3, t4; +flush status; connection server1; drop table if exists t1, t2, t3, t4; +flush status; --enable_warnings -flush status; # Create test tables on server1 create table t1 (a int) engine=ndbcluster; diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc --- a/sql/ha_ndbcluster.cc 2007-10-25 11:00:35 +02:00 +++ b/sql/ha_ndbcluster.cc 2007-11-01 15:07:57 +01:00 @@ -618,7 +618,7 @@ bool ha_ndbcluster::get_error_message(in DBUG_ENTER("ha_ndbcluster::get_error_message"); DBUG_PRINT("enter", ("error: %d", error)); - Ndb *ndb= get_ndb(); + Ndb *ndb= check_ndb_in_thd(current_thd); if (!ndb) DBUG_RETURN(FALSE); diff -Nrup a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc --- a/sql/ha_ndbcluster_binlog.cc 2007-09-07 11:15:04 +02:00 +++ b/sql/ha_ndbcluster_binlog.cc 2007-11-01 15:07:57 +01:00 @@ -3587,6 +3587,7 @@ pthread_handler_t ndb_binlog_thread_func 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 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";