From: Date: May 21 2008 9:02am Subject: bk commit into 5.1 tree (jonas:1.2207) BUG#36843 List-Archive: http://lists.mysql.com/commits/46906 X-Bug: 36843 Message-Id: <20080521070215.5C1064E27B@perch.localdomain> Below is the list of changes that have just been committed into a local 5.1 repository of jonas. When jonas 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, 2008-05-21 09:02:12+02:00, jonas@stripped +2 -0 ndb - bug#36843 Check connectivity also in beginning of SUB_START_REQ to avoid wasting resources with setup/teardown of subscription storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2008-05-21 09:02:11+02:00, jonas@stripped +27 -11 check for connectivity also in beginning of SUB_START_REQ storage/ndb/src/kernel/blocks/suma/Suma.hpp@stripped, 2008-05-21 09:02:11+02:00, jonas@stripped +1 -0 check for connectivity also in beginning of SUB_START_REQ # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jonas # Host: perch.ndb.mysql.com # Root: /home/jonas/src/drop6 --- 1.48/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2008-05-21 09:02:15 +02:00 +++ 1.49/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2008-05-21 09:02:15 +02:00 @@ -2325,6 +2325,16 @@ senderRef, senderData, SubStartRef::OutOfSubOpRecords); return; } + + if (! check_sub_start(subscriberRef)) + { + jam(); + c_subscriberPool.release(subbPtr); + c_subOpPool.release(subOpPtr); + sendSubStartRef(signal, + senderRef, senderData, SubStartRef::NodeDied); + return; + } // setup subscriber record subbPtr.p->m_senderRef = subscriberRef; @@ -2528,6 +2538,19 @@ drop_triggers(signal, subPtr); } +bool +Suma::check_sub_start(Uint32 subscriberRef) +{ + Uint32 nodeId = refToNode(subscriberRef); + bool startme = c_startup.m_restart_server_node_id; + bool handover = c_startup.m_wait_handover; + bool connected = + c_failedApiNodes.get(nodeId) == false && + c_connected_nodes.get(nodeId); + + return (startme || handover || connected); +} + void Suma::report_sub_start_conf(Signal* signal, Ptr subPtr) { @@ -2547,13 +2570,8 @@ c_subscriberPool.getPtr(ptr, subOpPtr.p->m_subscriberRef); Uint32 nodeId = refToNode(ptr.p->m_senderRef); - bool startme = c_startup.m_restart_server_node_id; - bool handover = c_startup.m_wait_handover; - bool connected = - c_failedApiNodes.get(nodeId) == false && - c_connected_nodes.get(nodeId); - - if (startme || handover || connected) + + if (check_sub_start(ptr.p->m_senderRef)) { SubStartConf* conf = (SubStartConf*)signal->getDataPtrSend(); conf->senderRef = reference(); @@ -2572,12 +2590,10 @@ else { jam(); - - g_eventLogger.warning("Node %u failed in report_sub_start_conf (%u,%u,%u)", - nodeId, startme,handover,connected); + sendSubStartRef(signal, senderRef, senderData, SubStartRef::NodeDied); - + c_subscriberPool.release(ptr); } --- 1.12/storage/ndb/src/kernel/blocks/suma/Suma.hpp 2008-05-21 09:02:15 +02:00 +++ 1.13/storage/ndb/src/kernel/blocks/suma/Suma.hpp 2008-05-21 09:02:15 +02:00 @@ -361,6 +361,7 @@ void sendSubStartRef(Signal* signal, Uint32 ref, Uint32 data, Uint32 error); void sendSubStopRef(Signal* signal, Uint32 ref, Uint32 data, Uint32 error); void sendSubStopConf(Signal*, Uint32 ref, Uint32 data, Ptr); + bool check_sub_start(Uint32 subscriberRef); void sendSubSyncRef(Signal* signal, Uint32 errorCode); void sendSubRemoveRef(Signal* signal, const SubRemoveReq& ref,