#At file:///home/jonas/src/telco-6.3/
2633 jonas@stripped 2008-06-11 [merge]
merge
modified:
storage/ndb/src/common/transporter/TransporterRegistry.cpp
storage/ndb/src/kernel/blocks/suma/Suma.cpp
storage/ndb/test/ndbapi/test_event.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp 2008-05-08 10:07:00 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp 2008-06-11 20:28:21 +0000
@@ -1313,6 +1313,17 @@ TransporterRegistry::start_clients_threa
if(t->isConnected())
t->doDisconnect();
break;
+ case DISCONNECTED:
+ {
+ if (t->isConnected())
+ {
+ g_eventLogger->warning("Found connection to %u in state DISCONNECTED "
+ " while being connected, disconnecting!",
+ t->getRemoteNodeId());
+ t->doDisconnect();
+ }
+ break;
+ }
default:
break;
}
=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2008-05-21 08:45:04 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2008-06-11 20:28:21 +0000
@@ -2630,8 +2630,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();
@@ -3784,12 +3782,13 @@ Suma::execSUB_GCP_COMPLETE_REP(Signal* s
/**
* Add GCP COMPLETE REP to buffer
*/
+ bool subscribers = !c_subscriber_nodes.isclear();
for(Uint32 i = 0; i<c_no_of_buckets; i++)
{
if(m_active_buckets.get(i))
continue;
- if (!c_subscriber_nodes.isclear())
+ if (subscribers || (c_buckets[i].m_state & Bucket::BUCKET_RESEND))
{
//Uint32* dst;
get_buffer_ptr(signal, i, gci, 0);
@@ -4383,9 +4382,11 @@ Suma::sendSubCreateReq(Signal* signal, P
Ptr<Table> 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;
@@ -4483,7 +4484,14 @@ Suma::execSUB_CREATE_CONF(Signal* signal
}
Ptr<Subscriber> ptr;
- if (subPtr.p->m_state != Subscription::DROPPED)
+
+ Ptr<Table> 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<Subscriber> list(c_subscriberPool, subPtr.p->m_subscribers);
list.first(ptr);
@@ -4492,7 +4500,7 @@ Suma::execSUB_CREATE_CONF(Signal* signal
{
ptr.setNull();
}
-
+
copySubscriber(signal, subPtr, ptr);
}
@@ -4912,7 +4920,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;
}
@@ -5019,7 +5028,7 @@ Suma::start_resend(Signal* signal, Uint3
}
Uint64 min= bucket->m_max_acked_gci + 1;
- Uint64 max = pos.m_max_gci;
+ Uint64 max = m_max_seen_gci;
ndbrequire(max <= m_max_seen_gci);
@@ -5028,7 +5037,9 @@ Suma::start_resend(Signal* signal, Uint3
ndbrequire(pos.m_page_id == bucket->m_buffer_tail);
m_active_buckets.set(buck);
m_gcp_complete_rep_count ++;
- ndbout_c("empty bucket -> active");
+ ndbout_c("empty bucket (%u/%u %u/%u) -> active",
+ Uint32(min >> 32), Uint32(min),
+ Uint32(max >> 32), Uint32(max));
return;
}
=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp 2008-04-25 09:18:49 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp 2008-06-11 20:28:21 +0000
@@ -2515,6 +2515,136 @@ 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;
+}
+
+int
+runBug37338(NDBT_Context* ctx, NDBT_Step* step)
+{
+ NdbRestarter res;
+ if (res.getNumDbNodes() < 2)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+
+ int nodeId = res.getDbNodeId(rand() % res.getNumDbNodes());
+
+ Ndb* pNdb = GETNDB(step);
+ NdbDictionary::Dictionary* dict = pNdb->getDictionary();
+ const NdbDictionary::Table* tab = dict->getTable(ctx->getTab()->getName());
+
+ const char * name = "BugXXX";
+ NdbDictionary::Table copy = * tab;
+ copy.setName(name);
+ dict->dropTable(name);
+
+ for (int i = 0; i<ctx->getNumLoops(); i++)
+ {
+ Ndb* ndb0;
+ Ndb_cluster_connection *con0;
+ NdbEventOperation* pOp0;
+ NdbDictionary::Dictionary * dict0;
+
+ cc(&con0, &ndb0);
+ dict0 = ndb0->getDictionary();
+ if (dict0->createTable(copy) != 0)
+ {
+ ndbout << dict0->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ const NdbDictionary::Table * copyptr = dict0->getTable(name);
+ if (copyptr == 0)
+ {
+ return NDBT_FAILED;
+ }
+ createEvent(ndb0, *copyptr, ctx);
+ pOp0 = createEventOperation(ndb0, *copyptr);
+ dict0 = ndb0->getDictionary();dict->dropTable(name);
+
+ res.restartOneDbNode(nodeId,
+ /** initial */ false,
+ /** nostart */ true,
+ /** abort */ true);
+
+ res.waitNodesNoStart(&nodeId, 1);
+ res.startNodes(&nodeId, 1);
+ if (res.waitClusterStarted())
+ {
+ return NDBT_FAILED;
+ }
+
+ ndb0->dropEventOperation(pOp0);
+
+ delete ndb0;
+ delete con0;
+ }
+
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(test_event);
TESTCASE("BasicEventOperation",
"Verify that we can listen to Events"
@@ -2694,6 +2824,14 @@ TESTCASE("Bug35208", ""){
FINALIZER(runVerify);
FINALIZER(runDropShadowTable);
}
+TESTCASE("Bug37279", "")
+{
+ INITIALIZER(runBug37279);
+}
+TESTCASE("Bug37338", "")
+{
+ INITIALIZER(runBug37338);
+}
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 16:18:01 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2008-06-11 20:28:21 +0000
@@ -1114,6 +1114,14 @@ max-time: 600
cmd: test_event
args: -n Bug35208 T1
+max-time: 300
+cmd: test_event
+args: -n Bug37279 T1
+
+max-time: 300
+cmd: test_event
+args: -n Bug37338 T1
+
# 2008-04-22
max-time: 1500
cmd: testNodeRestart
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (jonas:2633) | jonas | 11 Jun |