11/*
2- Copyright (c) 2003, 2016 , Oracle and/or its affiliates. All rights reserved.
2+ Copyright (c) 2003, 2018 , Oracle and/or its affiliates. All rights reserved.
33
44 This program is free software; you can redistribute it and/or modify
55 it under the terms of the GNU General Public License as published by
@@ -7343,8 +7343,6 @@ runGcpStop(NDBT_Context* ctx, NDBT_Step* step)
73437343}
73447344
73457345
7346- static const Uint32 numTables = 20 ;
7347-
73487346int CMT_createTableHook (Ndb* ndb,
73497347 NdbDictionary::Table& table,
73507348 int when,
@@ -7370,6 +7368,7 @@ int CMT_createTableHook(Ndb* ndb,
73707368int createManyTables (NDBT_Context* ctx, NDBT_Step* step)
73717369{
73727370 Ndb* pNdb = GETNDB (step);
7371+ const Uint32 numTables=ctx->getProperty (" NumTables" , Uint32 (20 ));
73737372
73747373 for (Uint32 tn = 0 ; tn < numTables; tn++)
73757374 {
@@ -7396,6 +7395,8 @@ int dropManyTables(NDBT_Context* ctx, NDBT_Step* step)
73967395
73977396 char buf[100 ];
73987397
7398+ const Uint32 numTables=ctx->getProperty (" NumTables" , Uint32 (20 ));
7399+
73997400 for (Uint32 tn = 0 ; tn < numTables; tn++)
74007401 {
74017402 BaseString::snprintf (buf, sizeof (buf),
@@ -7786,6 +7787,58 @@ int runRestartandCheckLCPRestored(NDBT_Context* ctx, NDBT_Step* step)
77867787 return NDBT_OK;
77877788}
77887789
7790+
7791+ int runNodeFailLcpStall (NDBT_Context* ctx, NDBT_Step* step)
7792+ {
7793+ NdbRestarter restarter;
7794+ int master = restarter.getMasterNodeId ();
7795+ int other = restarter.getRandomNodeSameNodeGroup (master, rand ());
7796+
7797+ ndbout_c (" Master %u Other %u" ,
7798+ master, other);
7799+
7800+ ndbout_c (" Stalling scans in node %u" , other);
7801+ restarter.insertErrorInNode (other, 10039 );
7802+
7803+ int dump[] = { 7099 };
7804+ ndbout_c (" Triggering LCP" );
7805+ restarter.dumpStateOneNode (master, dump, 1 );
7806+
7807+ ndbout_c (" Giving time for things to stall" );
7808+ NdbSleep_MilliSleep (10000 );
7809+
7810+ ndbout_c (" Getting Master to kill other when Master LCP complete %u" , master);
7811+ restarter.insertErrorInNode (master, 7178 );
7812+
7813+ ndbout_c (" Releasing scans in node %u" , other);
7814+ restarter.insertErrorInNode (other, 0 );
7815+
7816+ ndbout_c (" Expect other node failure" );
7817+ Uint32 retries=100 ;
7818+ while (restarter.getNodeStatus (other) == NDB_MGM_NODE_STATUS_STARTED)
7819+ {
7820+ if ((--retries) == 0 )
7821+ {
7822+ ndbout_c (" Timeout waiting for other node to restart" );
7823+ return NDBT_FAILED;
7824+ }
7825+ NdbSleep_MilliSleep (500 );
7826+ }
7827+
7828+ ndbout_c (" Other node failed, now wait for it to restart" );
7829+ restarter.insertErrorInNode (master, 0 );
7830+
7831+ if (restarter.waitNodesStarted (&other, 1 ) != 0 )
7832+ {
7833+ ndbout_c (" Timed out waiting for restart" );
7834+ return NDBT_FAILED;
7835+ }
7836+
7837+ ndbout_c (" Restart succeeded" );
7838+
7839+ return NDBT_OK;
7840+ }
7841+
77897842NDBT_TESTSUITE (testNodeRestart);
77907843TESTCASE (" NoLoad" ,
77917844 " Test that one node at a time can be stopped and then restarted " \
@@ -7951,8 +8004,9 @@ TESTCASE("RestartMasterNodeError",
79518004TESTCASE (" GetTabInfoOverload" ,
79528005 " Test behaviour of GET_TABINFOREQ overload + LCP + restart" )
79538006{
8007+ TC_PROPERTY (" NumTables" , 20 );
79548008 INITIALIZER (createManyTables);
7955- STEPS (runGetTabInfo, ( int ) numTables );
8009+ STEPS (runGetTabInfo, 20 );
79568010 STEP (runLCPandRestart);
79578011 FINALIZER (dropManyTables);
79588012};
@@ -8478,6 +8532,14 @@ TESTCASE("RestoreOlderLCP",
84788532 FINALIZER (runScanReadVerify);
84798533 FINALIZER (runClearTable);
84808534}
8535+ TESTCASE (" NodeFailLcpStall" ,
8536+ " Check that node failure does not result in LCP stall" )
8537+ {
8538+ TC_PROPERTY (" NumTables" , Uint32 (100 ));
8539+ INITIALIZER (createManyTables);
8540+ STEP (runNodeFailLcpStall);
8541+ FINALIZER (dropManyTables);
8542+ }
84818543
84828544NDBT_TESTSUITE_END (testNodeRestart);
84838545
0 commit comments