@@ -8738,18 +8738,34 @@ int runTestStartNode(NDBT_Context* ctx, NDBT_Step* step){
8738
8738
int run_PLCP_many_parts (NDBT_Context *ctx, NDBT_Step *step)
8739
8739
{
8740
8740
Ndb *pNdb = GETNDB (step);
8741
- int loops = 2108 ;
8742
- int result = NDBT_OK;
8741
+ int loops = 2800 ;
8743
8742
int records = ctx->getNumRecords ();
8744
8743
HugoTransactions hugoTrans (*ctx->getTab ());
8745
8744
NdbRestarter restarter;
8746
- int i = 0 ;
8747
8745
const Uint32 nodeCount = restarter.getNumDbNodes ();
8748
8746
int nodeId = 2 ;
8749
8747
HugoOperations hugoOps (*ctx->getTab ());
8750
- if (nodeCount < 2 )
8748
+ NdbMgmd mgmd;
8749
+ if (nodeCount != 2 )
8751
8750
{
8752
- return NDBT_OK; /* Requires at least 2 nodes to run */
8751
+ return NDBT_OK; /* Requires exact 2 nodes to run */
8752
+ }
8753
+ if (!mgmd.connect ())
8754
+ {
8755
+ g_err << " Failed to connect to ndb_mgmd." << endl;
8756
+ return NDBT_FAILED;
8757
+ }
8758
+ if (setConfigValueAndRestartNode (&mgmd, CFG_DB_GCP_INTERVAL,
8759
+ 200 , 1 , &restarter) == NDBT_FAILED)
8760
+ {
8761
+ g_err << " Failed to set TimeBetweenGlobalCheckpoints to 200" << endl;
8762
+ return NDBT_FAILED;
8763
+ }
8764
+ if (setConfigValueAndRestartNode (&mgmd, CFG_DB_GCP_INTERVAL,
8765
+ 200 , 2 , &restarter) == NDBT_FAILED)
8766
+ {
8767
+ g_err << " Failed to set TimeBetweenGlobalCheckpoints to 200" << endl;
8768
+ return NDBT_FAILED;
8753
8769
}
8754
8770
if (hugoTrans.loadTable (pNdb, records) != NDBT_OK)
8755
8771
{
@@ -8758,16 +8774,18 @@ int run_PLCP_many_parts(NDBT_Context *ctx, NDBT_Step *step)
8758
8774
}
8759
8775
8760
8776
g_err << " Executing " << loops << " loops" << endl;
8761
- while (++i <= loops && result != NDBT_FAILED)
8777
+ if (restarter.insertErrorInNode (nodeId, 10048 ) != 0 )
8778
+ {
8779
+ g_err << " ERROR: Error insert 10048 failed" << endl;
8780
+ return NDBT_FAILED;
8781
+ }
8782
+ int i = 0 ;
8783
+ int result = NDBT_OK;
8784
+ while (++i <= loops && result != NDBT_FAILED)
8762
8785
{
8763
8786
g_err << " Start loop " << i << endl;
8764
8787
ndbout << " Start an LCP" << endl;
8765
8788
{
8766
- if (restarter.insertErrorInNode (nodeId, 10048 ) != 0 )
8767
- {
8768
- g_err << " ERROR: Error insert 10048 failed" << endl;
8769
- return NDBT_FAILED;
8770
- }
8771
8789
int val = DumpStateOrd::DihStartLcpImmediately;
8772
8790
if (restarter.dumpStateAllNodes (&val, 1 ) != 0 )
8773
8791
{
@@ -8776,42 +8794,31 @@ int run_PLCP_many_parts(NDBT_Context *ctx, NDBT_Step *step)
8776
8794
return NDBT_FAILED;
8777
8795
}
8778
8796
}
8779
- bool skip = false ;
8780
- if ((i % 50 ) == 0 )
8781
- {
8782
- skip = true ;
8783
- }
8784
- Uint32 batch = 4 ;
8797
+ Uint32 batch = 8 ;
8785
8798
Uint32 row;
8786
- if (!skip)
8787
- {
8788
- row = rand () % records;
8789
- if (row + batch > (Uint32)records)
8790
- batch = records - row;
8799
+ row = rand () % records;
8800
+ if (row + batch > (Uint32)records)
8801
+ row = records - batch;
8791
8802
8792
- if ((hugoOps.startTransaction (pNdb) != 0 ) ||
8793
- (hugoOps.pkUpdateRecord (pNdb, row, batch, rand ()) != 0 ) ||
8794
- (hugoOps.execute_Commit (pNdb)) ||
8795
- (hugoOps.closeTransaction (pNdb)))
8796
- {
8797
- g_err << " Update failed" << endl;
8798
- // return NDBT_FAILED;
8799
- }
8803
+ if ((hugoOps.startTransaction (pNdb) != 0 ) ||
8804
+ (hugoOps.pkUpdateRecord (pNdb, row, batch, rand ()) != 0 ) ||
8805
+ (hugoOps.execute_Commit (pNdb)) ||
8806
+ (hugoOps.closeTransaction (pNdb)))
8807
+ {
8808
+ g_err << " Update failed" << endl;
8809
+ // return NDBT_FAILED;
8800
8810
}
8801
8811
NdbSleep_SecSleep (1 );
8802
- if (!skip)
8803
- {
8804
- row = rand () % records;
8805
- if (row + batch > (Uint32)records)
8806
- batch = records - row;
8807
- if ((hugoOps.startTransaction (pNdb) != 0 ) ||
8808
- (hugoOps.pkUpdateRecord (pNdb, row, batch, rand ()) != 0 ) ||
8809
- (hugoOps.execute_Commit (pNdb)) ||
8810
- (hugoOps.closeTransaction (pNdb)))
8811
- {
8812
- g_err << " Update failed" << endl;
8813
- // return NDBT_FAILED;
8814
- }
8812
+ row = rand () % records;
8813
+ if (row + batch > (Uint32)records)
8814
+ row = records - batch;
8815
+ if ((hugoOps.startTransaction (pNdb) != 0 ) ||
8816
+ (hugoOps.pkUpdateRecord (pNdb, row, batch, rand ()) != 0 ) ||
8817
+ (hugoOps.execute_Commit (pNdb)) ||
8818
+ (hugoOps.closeTransaction (pNdb)))
8819
+ {
8820
+ g_err << " Update failed" << endl;
8821
+ // return NDBT_FAILED;
8815
8822
}
8816
8823
}
8817
8824
/* *
@@ -8843,6 +8850,19 @@ int run_PLCP_many_parts(NDBT_Context *ctx, NDBT_Step *step)
8843
8850
g_err << " Wait node start failed" << endl;
8844
8851
return NDBT_FAILED;
8845
8852
}
8853
+ ndbout << " Reset TimeBetweenGlobalCheckpoints to 2000" << endl;
8854
+ if (setConfigValueAndRestartNode (&mgmd, CFG_DB_GCP_INTERVAL,
8855
+ 2000 , 1 , &restarter) == NDBT_FAILED)
8856
+ {
8857
+ g_err << " Failed to set TimeBetweenGlobalCheckpoints to 2000" << endl;
8858
+ return NDBT_FAILED;
8859
+ }
8860
+ if (setConfigValueAndRestartNode (&mgmd, CFG_DB_GCP_INTERVAL,
8861
+ 2000 , 2 , &restarter) == NDBT_FAILED)
8862
+ {
8863
+ g_err << " Failed to set TimeBetweenGlobalCheckpoints to 2000" << endl;
8864
+ return NDBT_FAILED;
8865
+ }
8846
8866
ndbout << " Test complete" << endl;
8847
8867
return NDBT_OK;
8848
8868
}
0 commit comments