Loading storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -1381,6 +1381,7 @@ private: Uint32 csystemnodes; Uint32 currentgcp; Uint32 c_newest_restorable_gci; Uint32 c_set_initial_start_flag; enum GcpMasterTakeOverState { GMTOS_IDLE = 0, Loading storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ void Dbdih::initData() c_blockCommit = false; c_blockCommitNo = 1; cntrlblockref = RNIL; c_set_initial_start_flag = FALSE; }//Dbdih::initData() void Dbdih::initRecords() Loading storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -677,6 +677,12 @@ void Dbdih::execCOPY_GCIREQ(Signal* signal) Uint32 tmp= SYSFILE->m_restart_seq; memcpy(sysfileData, cdata, sizeof(sysfileData)); SYSFILE->m_restart_seq = tmp; if (c_set_initial_start_flag) { jam(); Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits); } } c_copyGCISlave.m_copyReason = reason; Loading Loading @@ -1337,6 +1343,11 @@ void Dbdih::execNDB_STTOR(Signal* signal) // The permission is given by the master node in the alive set. /*-----------------------------------------------------------------------*/ createMutexes(signal, 0); if (cstarttype == NodeState::ST_INITIAL_NODE_RESTART) { jam(); c_set_initial_start_flag = TRUE; // In sysfile... } break; case ZNDB_SPH3: Loading Loading @@ -10806,6 +10817,17 @@ Dbdih::sendLCP_COMPLETE_REP(Signal* signal){ sendSignal(c_lcpState.m_masterLcpDihRef, GSN_LCP_COMPLETE_REP, signal, LcpCompleteRep::SignalLength, JBB); /** * Say that an initial node restart does not need to be redone * once node has been part of first LCP */ if (c_set_initial_start_flag && c_lcpState.m_participatingLQH.get(getOwnNodeId())) { jam(); c_set_initial_start_flag = FALSE; } } /*-------------------------------------------------------------------------- */ Loading storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -11939,7 +11939,7 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) return; } if (getNodeState().getNodeRestartInProgress()) if (getNodeState().getNodeRestartInProgress() && cstartRecReq == ZFALSE) { GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0]; saveRef->dihPtr = dihPtr; Loading Loading @@ -11986,7 +11986,6 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) }//if ndbrequire(ccurrentGcprec == RNIL); ccurrentGcprec = 0; gcpPtr.i = ccurrentGcprec; ptrCheckGuard(gcpPtr, cgcprecFileSize, gcpRecord); Loading storage/ndb/test/ndbapi/testNodeRestart.cpp +43 −0 Original line number Diff line number Diff line Loading @@ -1313,6 +1313,46 @@ runBug26457(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } int runBug26481(NDBT_Context* ctx, NDBT_Step* step) { int result = NDBT_OK; int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); NdbRestarter res; int node = res.getRandomNotMasterNodeId(rand()); ndbout_c("node: %d", node); if (res.restartOneDbNode(node, true, true, true)) return NDBT_FAILED; if (res.waitNodesNoStart(&node, 1)) return NDBT_FAILED; int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; if (res.dumpStateOneNode(node, val2, 2)) return NDBT_FAILED; if (res.insertErrorInNode(node, 7018)) return NDBT_FAILED; if (res.startNodes(&node, 1)) return NDBT_FAILED; res.waitNodesStartPhase(&node, 1, 3); if (res.waitNodesNoStart(&node, 1)) return NDBT_FAILED; res.startNodes(&node, 1); if (res.waitClusterStarted()) return NDBT_FAILED; return NDBT_OK; } NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ Loading Loading @@ -1654,6 +1694,9 @@ TESTCASE("Bug25984", ""){ TESTCASE("Bug26457", ""){ INITIALIZER(runBug26457); } TESTCASE("Bug26481", ""){ INITIALIZER(runBug26481); } NDBT_TESTSUITE_END(testNodeRestart); int main(int argc, const char** argv){ Loading Loading
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -1381,6 +1381,7 @@ private: Uint32 csystemnodes; Uint32 currentgcp; Uint32 c_newest_restorable_gci; Uint32 c_set_initial_start_flag; enum GcpMasterTakeOverState { GMTOS_IDLE = 0, Loading
storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ void Dbdih::initData() c_blockCommit = false; c_blockCommitNo = 1; cntrlblockref = RNIL; c_set_initial_start_flag = FALSE; }//Dbdih::initData() void Dbdih::initRecords() Loading
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -677,6 +677,12 @@ void Dbdih::execCOPY_GCIREQ(Signal* signal) Uint32 tmp= SYSFILE->m_restart_seq; memcpy(sysfileData, cdata, sizeof(sysfileData)); SYSFILE->m_restart_seq = tmp; if (c_set_initial_start_flag) { jam(); Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits); } } c_copyGCISlave.m_copyReason = reason; Loading Loading @@ -1337,6 +1343,11 @@ void Dbdih::execNDB_STTOR(Signal* signal) // The permission is given by the master node in the alive set. /*-----------------------------------------------------------------------*/ createMutexes(signal, 0); if (cstarttype == NodeState::ST_INITIAL_NODE_RESTART) { jam(); c_set_initial_start_flag = TRUE; // In sysfile... } break; case ZNDB_SPH3: Loading Loading @@ -10806,6 +10817,17 @@ Dbdih::sendLCP_COMPLETE_REP(Signal* signal){ sendSignal(c_lcpState.m_masterLcpDihRef, GSN_LCP_COMPLETE_REP, signal, LcpCompleteRep::SignalLength, JBB); /** * Say that an initial node restart does not need to be redone * once node has been part of first LCP */ if (c_set_initial_start_flag && c_lcpState.m_participatingLQH.get(getOwnNodeId())) { jam(); c_set_initial_start_flag = FALSE; } } /*-------------------------------------------------------------------------- */ Loading
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -11939,7 +11939,7 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) return; } if (getNodeState().getNodeRestartInProgress()) if (getNodeState().getNodeRestartInProgress() && cstartRecReq == ZFALSE) { GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0]; saveRef->dihPtr = dihPtr; Loading Loading @@ -11986,7 +11986,6 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) }//if ndbrequire(ccurrentGcprec == RNIL); ccurrentGcprec = 0; gcpPtr.i = ccurrentGcprec; ptrCheckGuard(gcpPtr, cgcprecFileSize, gcpRecord); Loading
storage/ndb/test/ndbapi/testNodeRestart.cpp +43 −0 Original line number Diff line number Diff line Loading @@ -1313,6 +1313,46 @@ runBug26457(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } int runBug26481(NDBT_Context* ctx, NDBT_Step* step) { int result = NDBT_OK; int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); NdbRestarter res; int node = res.getRandomNotMasterNodeId(rand()); ndbout_c("node: %d", node); if (res.restartOneDbNode(node, true, true, true)) return NDBT_FAILED; if (res.waitNodesNoStart(&node, 1)) return NDBT_FAILED; int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; if (res.dumpStateOneNode(node, val2, 2)) return NDBT_FAILED; if (res.insertErrorInNode(node, 7018)) return NDBT_FAILED; if (res.startNodes(&node, 1)) return NDBT_FAILED; res.waitNodesStartPhase(&node, 1, 3); if (res.waitNodesNoStart(&node, 1)) return NDBT_FAILED; res.startNodes(&node, 1); if (res.waitClusterStarted()) return NDBT_FAILED; return NDBT_OK; } NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ Loading Loading @@ -1654,6 +1694,9 @@ TESTCASE("Bug25984", ""){ TESTCASE("Bug26457", ""){ INITIALIZER(runBug26457); } TESTCASE("Bug26481", ""){ INITIALIZER(runBug26481); } NDBT_TESTSUITE_END(testNodeRestart); int main(int argc, const char** argv){ Loading