From: Date: June 11 2008 10:23am
Subject: bzr commit into mysql-5.1-telco-6.2 branch (jonas:2620) Bug#37279
List-Archive: http://lists.mysql.com/commits/47741
X-Bug: 37279
Message-Id: <20080611082341.0153291966E@perch.localdomain>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
#At file:///home/jonas/src/telco-6.2/
2620 jonas@stripped 2008-06-11
ndb - bug#37279
Dont copy dropped subscriptions during node restart
cause it will cause starting node to crash
modified:
storage/ndb/src/kernel/blocks/suma/Suma.cpp
storage/ndb/test/ndbapi/test_event.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
per-file comments:
storage/ndb/src/kernel/blocks/suma/Suma.cpp
dont copy dropped subscriptions
storage/ndb/test/ndbapi/test_event.cpp
testcase
storage/ndb/test/run-test/daily-basic-tests.txt
testcase
=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2008-05-21 07:18:45 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2008-06-11 08:23:36 +0000
@@ -2629,8 +2629,6 @@ Suma::report_sub_start_conf(Signal* sign
Uint32 senderData = subOpPtr.p->m_senderData;
c_subscriberPool.getPtr(ptr, subOpPtr.p->m_subscriberRef);
- Uint32 nodeId = refToNode(ptr.p->m_senderRef);
-
if (check_sub_start(ptr.p->m_senderRef))
{
SubStartConf* conf = (SubStartConf*)signal->getDataPtrSend();
@@ -4378,9 +4376,11 @@ Suma::sendSubCreateReq(Signal* signal, P
Ptr
tabPtr;
c_tablePool.getPtr(tabPtr, subPtr.p->m_table_ptrI);
+ bool dropped =
+ subPtr.p->m_state == Subscription::DROPPED ||
+ tabPtr.p->m_state == Table::DROPPED;
- if (subPtr.p->m_state != Subscription::DROPPED &&
- tabPtr.p->m_state != Table::DROPPED)
+ if (! dropped)
{
jam();
c_restart.m_waiting_on_self = 0;
@@ -4478,7 +4478,14 @@ Suma::execSUB_CREATE_CONF(Signal* signal
}
Ptr ptr;
- if (subPtr.p->m_state != Subscription::DROPPED)
+
+ Ptr tabPtr;
+ c_tablePool.getPtr(tabPtr, subPtr.p->m_table_ptrI);
+ bool dropped =
+ subPtr.p->m_state == Subscription::DROPPED ||
+ tabPtr.p->m_state == Table::DROPPED;
+
+ if (! dropped)
{
LocalDLList list(c_subscriberPool, subPtr.p->m_subscribers);
list.first(ptr);
@@ -4487,7 +4494,7 @@ Suma::execSUB_CREATE_CONF(Signal* signal
{
ptr.setNull();
}
-
+
copySubscriber(signal, subPtr, ptr);
}
@@ -4905,7 +4912,8 @@ Suma::release_gci(Signal* signal, Uint32
if(unlikely(bucket->m_state & mask))
{
jam();
- ndbout_c("release_gci(%d, %llu) -> node failure -> abort", buck, gci);
+ ndbout_c("release_gci(%d, %llu) 0x%x-> node failure -> abort",
+ buck, gci, bucket->m_state);
return;
}
=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp 2008-04-25 09:17:15 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp 2008-06-11 08:23:36 +0000
@@ -2515,6 +2515,70 @@ err:
/** Telco 6.3 **/
+int
+runBug37279(NDBT_Context* ctx, NDBT_Step* step)
+{
+ NdbRestarter res;
+ if (res.getNumDbNodes() < 2)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+
+ if (runCreateEvent(ctx, step))
+ {
+ return NDBT_FAILED;
+ }
+
+ Ndb* pNdb = GETNDB(step);
+ NdbDictionary::Dictionary* dict = pNdb->getDictionary();
+
+ const NdbDictionary::Table* tab = dict->getTable(ctx->getTab()->getName());
+ const NdbDictionary::Table* org = tab;
+ NdbEventOperation* pOp0 = createEventOperation(pNdb, *tab);
+
+ if (pOp0 == 0)
+ {
+ return NDBT_FAILED;
+ }
+
+ {
+ Ndb* ndb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
+ if (ndb->init() != 0)
+ {
+ delete ndb;
+ ndbout_c("here: %u", __LINE__);
+ return NDBT_FAILED;
+ }
+
+ if (ndb->waitUntilReady(30) != 0)
+ {
+ delete ndb;
+ ndbout_c("here: %u", __LINE__);
+ return NDBT_FAILED;
+ }
+
+ ndb->getDictionary()->dropTable(tab->getName());
+ delete ndb;
+ }
+
+ int nodeId = res.getDbNodeId(rand() % res.getNumDbNodes());
+ ndbout_c("stopping %u", nodeId);
+ res.restartOneDbNode(nodeId,
+ /** initial */ false,
+ /** nostart */ false,
+ /** abort */ true);
+ if (res.waitClusterStarted())
+ {
+ return NDBT_FAILED;
+ }
+
+ pNdb->dropEventOperation(pOp0);
+ runDropEvent(ctx, step);
+
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(test_event);
TESTCASE("BasicEventOperation",
"Verify that we can listen to Events"
@@ -2694,6 +2758,10 @@ TESTCASE("Bug35208", ""){
FINALIZER(runVerify);
FINALIZER(runDropShadowTable);
}
+TESTCASE("Bug37279", "")
+{
+ INITIALIZER(runBug37279);
+}
NDBT_TESTSUITE_END(test_event);
int main(int argc, const char** argv){
=== modified file 'storage/ndb/test/run-test/daily-basic-tests.txt'
--- a/storage/ndb/test/run-test/daily-basic-tests.txt 2008-06-03 12:37:17 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2008-06-11 08:23:36 +0000
@@ -1098,6 +1098,10 @@ max-time: 600
cmd: test_event
args: -n Bug35208 T1
+max-time: 300
+cmd: test_event
+args: -n Bug37279 T1
+
# 2008-04-22
max-time: 1500
cmd: testNodeRestart