Commit 3cd048fc authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca

into  perch.ndb.mysql.com:/home/jonas/src/51-ndb
parents 1b4b2347 2583dae0
...@@ -145,7 +145,7 @@ CPCDAPISession::CPCDAPISession(NDB_SOCKET_TYPE sock, ...@@ -145,7 +145,7 @@ CPCDAPISession::CPCDAPISession(NDB_SOCKET_TYPE sock,
: SocketServer::Session(sock) : SocketServer::Session(sock)
, m_cpcd(cpcd) , m_cpcd(cpcd)
{ {
m_input = new SocketInputStream(sock); m_input = new SocketInputStream(sock, 7*24*60*60000);
m_output = new SocketOutputStream(sock); m_output = new SocketOutputStream(sock);
m_parser = new Parser<CPCDAPISession>(commands, *m_input, true, true, true); m_parser = new Parser<CPCDAPISession>(commands, *m_input, true, true, true);
} }
......
...@@ -122,7 +122,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -122,7 +122,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){
CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0);
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0);
CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0);
CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0);
...@@ -143,7 +143,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -143,7 +143,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){
CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0);
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0);
CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0);
CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0);
...@@ -266,7 +266,7 @@ int runSystemRestart2(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -266,7 +266,7 @@ int runSystemRestart2(NDBT_Context* ctx, NDBT_Step* step){
CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0);
CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0);
CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0);
CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0);
CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0);
CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0);
CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0);
...@@ -1294,6 +1294,30 @@ runBug28770(NDBT_Context* ctx, NDBT_Step* step) { ...@@ -1294,6 +1294,30 @@ runBug28770(NDBT_Context* ctx, NDBT_Step* step) {
return result; return result;
} }
int
runStopper(NDBT_Context* ctx, NDBT_Step* step)
{
NdbRestarter restarter;
Uint32 stop = 0;
loop:
while (!ctx->isTestStopped() &&
((stop = ctx->getProperty("StopAbort", Uint32(0))) == 0))
{
NdbSleep_MilliSleep(30);
}
if (ctx->isTestStopped())
{
return NDBT_OK;
}
ndbout << "Killing in " << stop << "ms..." << flush;
NdbSleep_MilliSleep(stop);
restarter.restartAll(false, true, true);
ctx->setProperty("StopAbort", Uint32(0));
goto loop;
}
int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
{ {
Ndb* pNdb = GETNDB(step); Ndb* pNdb = GETNDB(step);
...@@ -1303,6 +1327,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1303,6 +1327,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
NdbRestarter restarter; NdbRestarter restarter;
NdbBackup backup(GETNDB(step)->getNodeId()+1); NdbBackup backup(GETNDB(step)->getNodeId()+1);
bool lcploop = ctx->getProperty("LCP", (unsigned)0); bool lcploop = ctx->getProperty("LCP", (unsigned)0);
bool all = ctx->getProperty("ALL", (unsigned)0);
Uint32 i = 1; Uint32 i = 1;
Uint32 backupId; Uint32 backupId;
...@@ -1328,11 +1353,18 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1328,11 +1353,18 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
ndbout << "Loading records..." << startFrom << endl; ndbout << "Loading records..." << startFrom << endl;
CHECK(hugoTrans.loadTable(pNdb, startFrom) == 0); CHECK(hugoTrans.loadTable(pNdb, startFrom) == 0);
if (!all)
{
ndbout << "Making " << nodeId << " crash" << endl; ndbout << "Making " << nodeId << " crash" << endl;
int kill[] = { 9999, 1000, 3000 }; int kill[] = { 9999, 1000, 3000 };
CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0);
CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0);
}
else
{
ndbout << "Crashing cluster" << endl;
ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000));
}
Uint64 end = NdbTick_CurrentMillisecond() + 4000; Uint64 end = NdbTick_CurrentMillisecond() + 4000;
Uint32 row = startFrom; Uint32 row = startFrom;
do { do {
...@@ -1342,11 +1374,17 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1342,11 +1374,17 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
row += 1000; row += 1000;
} while (NdbTick_CurrentMillisecond() < end); } while (NdbTick_CurrentMillisecond() < end);
if (!all)
{
ndbout << "Waiting for " << nodeId << " to restart" << endl; ndbout << "Waiting for " << nodeId << " to restart" << endl;
CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0);
ndbout << "Restarting cluster" << endl; ndbout << "Restarting cluster" << endl;
CHECK(restarter.restartAll(false, true, true) == 0); CHECK(restarter.restartAll(false, true, true) == 0);
}
else
{
ndbout << "Waiting for cluster to restart" << endl;
}
CHECK(restarter.waitClusterNoStart() == 0); CHECK(restarter.waitClusterNoStart() == 0);
CHECK(restarter.startAll() == 0); CHECK(restarter.startAll() == 0);
CHECK(restarter.waitClusterStarted() == 0); CHECK(restarter.waitClusterStarted() == 0);
...@@ -1371,7 +1409,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1371,7 +1409,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step)
} }
ndbout << "runSR_DD_1 finished" << endl; ndbout << "runSR_DD_1 finished" << endl;
ctx->stopTest();
return result; return result;
} }
...@@ -1385,6 +1423,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1385,6 +1423,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
NdbRestarter restarter; NdbRestarter restarter;
NdbBackup backup(GETNDB(step)->getNodeId()+1); NdbBackup backup(GETNDB(step)->getNodeId()+1);
bool lcploop = ctx->getProperty("LCP", (unsigned)0); bool lcploop = ctx->getProperty("LCP", (unsigned)0);
bool all = ctx->getProperty("ALL", (unsigned)0);
Uint32 i = 1; Uint32 i = 1;
Uint32 backupId; Uint32 backupId;
...@@ -1405,10 +1444,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1405,10 +1444,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes());
if (!all)
{
ndbout << "Making " << nodeId << " crash" << endl; ndbout << "Making " << nodeId << " crash" << endl;
int kill[] = { 9999, 3000, 10000 }; int kill[] = { 9999, 3000, 10000 };
CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0);
CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0);
}
else
{
ndbout << "Crashing cluster" << endl;
ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000));
}
Uint64 end = NdbTick_CurrentMillisecond() + 11000; Uint64 end = NdbTick_CurrentMillisecond() + 11000;
Uint32 row = startFrom; Uint32 row = startFrom;
...@@ -1420,11 +1467,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1420,11 +1467,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
break; break;
} while (NdbTick_CurrentMillisecond() < end); } while (NdbTick_CurrentMillisecond() < end);
if (!all)
{
ndbout << "Waiting for " << nodeId << " to restart" << endl; ndbout << "Waiting for " << nodeId << " to restart" << endl;
CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0);
ndbout << "Restarting cluster" << endl; ndbout << "Restarting cluster" << endl;
CHECK(restarter.restartAll(false, true, true) == 0); CHECK(restarter.restartAll(false, true, true) == 0);
}
else
{
ndbout << "Waiting for cluster to restart" << endl;
}
CHECK(restarter.waitClusterNoStart() == 0); CHECK(restarter.waitClusterNoStart() == 0);
CHECK(restarter.startAll() == 0); CHECK(restarter.startAll() == 0);
CHECK(restarter.waitClusterStarted() == 0); CHECK(restarter.waitClusterStarted() == 0);
...@@ -1443,7 +1497,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1443,7 +1497,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step)
} }
ndbout << "runSR_DD_2 finished" << endl; ndbout << "runSR_DD_2 finished" << endl;
ctx->stopTest();
return result; return result;
} }
...@@ -1628,12 +1682,29 @@ TESTCASE("Bug24664", ...@@ -1628,12 +1682,29 @@ TESTCASE("Bug24664",
FINALIZER(runClearTable); FINALIZER(runClearTable);
} }
TESTCASE("SR_DD_1", "") TESTCASE("SR_DD_1", "")
{
TC_PROPERTY("ALL", 1);
INITIALIZER(runWaitStarted);
STEP(runStopper);
STEP(runSR_DD_1);
FINALIZER(runClearTable);
}
TESTCASE("SR_DD_1b", "")
{ {
INITIALIZER(runWaitStarted); INITIALIZER(runWaitStarted);
STEP(runSR_DD_1); STEP(runSR_DD_1);
FINALIZER(runClearTable); FINALIZER(runClearTable);
} }
TESTCASE("SR_DD_1_LCP", "") TESTCASE("SR_DD_1_LCP", "")
{
TC_PROPERTY("ALL", 1);
TC_PROPERTY("LCP", 1);
INITIALIZER(runWaitStarted);
STEP(runStopper);
STEP(runSR_DD_1);
FINALIZER(runClearTable);
}
TESTCASE("SR_DD_1b_LCP", "")
{ {
TC_PROPERTY("LCP", 1); TC_PROPERTY("LCP", 1);
INITIALIZER(runWaitStarted); INITIALIZER(runWaitStarted);
...@@ -1641,12 +1712,29 @@ TESTCASE("SR_DD_1_LCP", "") ...@@ -1641,12 +1712,29 @@ TESTCASE("SR_DD_1_LCP", "")
FINALIZER(runClearTable); FINALIZER(runClearTable);
} }
TESTCASE("SR_DD_2", "") TESTCASE("SR_DD_2", "")
{
TC_PROPERTY("ALL", 1);
INITIALIZER(runWaitStarted);
STEP(runStopper);
STEP(runSR_DD_2);
FINALIZER(runClearTable);
}
TESTCASE("SR_DD_2b", "")
{ {
INITIALIZER(runWaitStarted); INITIALIZER(runWaitStarted);
STEP(runSR_DD_2); STEP(runSR_DD_2);
FINALIZER(runClearTable); FINALIZER(runClearTable);
} }
TESTCASE("SR_DD_2_LCP", "") TESTCASE("SR_DD_2_LCP", "")
{
TC_PROPERTY("ALL", 1);
TC_PROPERTY("LCP", 1);
INITIALIZER(runWaitStarted);
STEP(runStopper);
STEP(runSR_DD_2);
FINALIZER(runClearTable);
}
TESTCASE("SR_DD_2b_LCP", "")
{ {
TC_PROPERTY("LCP", 1); TC_PROPERTY("LCP", 1);
INITIALIZER(runWaitStarted); INITIALIZER(runWaitStarted);
......
...@@ -958,31 +958,63 @@ max-time: 1500 ...@@ -958,31 +958,63 @@ max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_1 D1 args: -n SR_DD_1 D1
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_1b D1
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_1 D2 args: -n SR_DD_1 D2
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_1b D2
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_1_LCP D1 args: -n SR_DD_1_LCP D1
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_1b_LCP D1
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_1_LCP D2 args: -n SR_DD_1_LCP D2
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_1b_LCP D2
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_2 D1 args: -n SR_DD_2 D1
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_2b D1
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_2 D2 args: -n SR_DD_2 D2
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_2b D2
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_2_LCP D1 args: -n SR_DD_2_LCP D1
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_2b_LCP D1
max-time: 1500 max-time: 1500
cmd: testSystemRestart cmd: testSystemRestart
args: -n SR_DD_2_LCP D2 args: -n SR_DD_2_LCP D2
max-time: 1500
cmd: testSystemRestart
args: -n SR_DD_2b_LCP D2
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment