#At file:///home/jonas/src/telco-6.2/ based on revid:jonas@stripped
2926 Jonas Oreland 2009-05-17
ndb - bug#44915
keep hashtable consistent even in unusual error situations
M storage/ndb/src/kernel/blocks/suma/Suma.cpp
M storage/ndb/test/ndbapi/test_event.cpp
M storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2009-04-06 09:42:07 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp 2009-05-17 07:03:37 +0000
@@ -1545,13 +1545,18 @@ Suma::execSUB_CREATE_REQ(Signal* signal)
Ptr<SubOpRecord> subOpPtr;
LocalDLFifoList<SubOpRecord> subOpList(c_subOpPool, subPtr.p->m_create_req);
- if (subOpList.seize(subOpPtr) == false)
+ if ((ERROR_INSERTED(13044) && found == false) ||
+ subOpList.seize(subOpPtr) == false)
{
jam();
if (found == false)
{
jam();
- c_subscriptions.release(subPtr);
+ if (ERROR_INSERTED(13044))
+ {
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+ c_subscriptionPool.release(subPtr); // not yet in hash
}
sendSubCreateRef(signal, senderRef, senderData,
SubCreateRef::OutOfTableRecords);
@@ -1580,11 +1585,16 @@ Suma::execSUB_CREATE_REQ(Signal* signal)
else
{
jam();
- if (c_tablePool.seize(tabPtr) == false)
+ if (ERROR_INSERTED(13045) || c_tablePool.seize(tabPtr) == false)
{
jam();
+ if (ERROR_INSERTED(13045))
+ {
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+
subOpList.release(subOpPtr);
- c_subscriptions.release(subPtr);
+ c_subscriptionPool.release(subPtr); // not yet in hash
sendSubCreateRef(signal, senderRef, senderData,
SubCreateRef::OutOfTableRecords);
return;
@@ -1840,6 +1850,7 @@ Suma::execGET_TABINFOREF(Signal* signal)
}
Ptr<Subscription> tmp1 = subPtr;
subList.next(subPtr);
+ c_subscriptions.remove(tmp1);
subList.release(tmp1);
}
=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp 2009-03-13 12:44:27 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp 2009-05-17 07:03:37 +0000
@@ -3253,6 +3253,26 @@ runBug30780(NDBT_Context* ctx, NDBT_Step
return NDBT_OK;
}
+int
+runBug44915(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+
+ NdbRestarter res;
+ int error[] = { 13031, 13044, 13045, 0 };
+ for (int i = 0; error[i]; i++)
+ {
+ ndbout_c("error: %d", error[i]);
+ res.insertErrorInNode(res.getDbNodeId(rand() % res.getNumDbNodes()),
+ error[i]);
+
+ result = runCreateEvent(ctx, step); // should fail due to error insert
+ result = runCreateEvent(ctx, step); // should pass
+ }
+
+ return result;
+}
+
NDBT_TESTSUITE(test_event);
TESTCASE("BasicEventOperation",
"Verify that we can listen to Events"
@@ -3457,6 +3477,10 @@ TESTCASE("Bug30780", "")
STEP(runBug30780);
FINALIZER(runDropEvent);
}
+TESTCASE("Bug44915", "")
+{
+ INITIALIZER(runBug44915);
+}
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 2009-04-03 08:24:38 +0000
+++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2009-05-17 07:03:37 +0000
@@ -1280,3 +1280,7 @@ max-time: 1200
cmd: testNdbApi
args: -n Bug44015 T1
+max-time: 1200
+cmd: test_event
+args: -n Bug44915 T1
+
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20090517070337-fkgvm7vy33s33w1m.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.2 branch (jonas:2926) Bug#44915 | Jonas Oreland | 17 May |