Commit 950c6825 authored by unknown's avatar unknown
Browse files

Test prg update

- make test node restart test harder


ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Removed debug printout
ndb/test/include/HugoOperations.hpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/include/HugoTransactions.hpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/ndbapi/testBasic.cpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/ndbapi/testNdbApi.cpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/ndbapi/testNodeRestart.cpp:
  Use mixed pkread
  Use rand() no of records
  Use rand() batch size
  Restart node abort (instead of graceful)
ndb/test/ndbapi/testOperations.cpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/ndbapi/testTransactions.cpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/run-test/daily-devel-tests.txt:
  Run mixed pkread tests instead of just LM_Read (readTuple())
ndb/test/src/HugoOperations.cpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
ndb/test/src/HugoTransactions.cpp:
  Remove multipl pkRead (simple/dirty)... and replace
    with pkRead(LockMode)
parent b5c406a1
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -3379,8 +3379,6 @@ void Dbtc::releaseSimpleRead(Signal* signal,
      (state == CS_START_COMMITTING ? CS_CONNECTED : state);
    setApiConTimer(regApiPtr.i, 0, __LINE__);

    if(state != regApiPtr.p->apiConnectstate)
      ndbout_c("resettting state from %d to %d", state, regApiPtr.p->apiConnectstate);
    return;
  }
  
+2 −10
Original line number Diff line number Diff line
@@ -38,16 +38,8 @@ public:
  
  int pkReadRecord(Ndb*,
		   int recordNo,
		   bool exclusive = false,
		   int numRecords = 1);
  
  int pkSimpleReadRecord(Ndb*,
			 int recordNo,
			 int numRecords = 1);
  
  int pkDirtyReadRecord(Ndb*,
			int recordNo,
			int numRecords = 1);
		   int numRecords = 1,
		   NdbOperation::LockMode lm = NdbOperation::LM_Read);
  
  int pkUpdateRecord(Ndb*,
		     int recordNo,
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ public:
  int pkReadRecords(Ndb*, 
		    int records,
		    int batchsize = 1,
		    bool dirty = false);
		    NdbOperation::LockMode = NdbOperation::LM_Read);
  
  int scanUpdateRecords(Ndb*, 
			int records,
+15 −15
Original line number Diff line number Diff line
@@ -160,8 +160,8 @@ int runPkDirtyRead(NDBT_Context* ctx, NDBT_Step* step){
  HugoTransactions hugoTrans(*ctx->getTab());
  while (i<loops) {
    g_info << i << ": ";
    if (hugoTrans.pkReadRecords(GETNDB(step), records, 
				batchSize, dirty) != NDBT_OK){
    if (hugoTrans.pkReadRecords(GETNDB(step), records, batchSize, 
				NdbOperation::LM_CommittedRead) != NDBT_OK){
      g_info << endl;
      return NDBT_FAILED;
    }
@@ -736,7 +736,7 @@ int runCheckRollbackUpdate(NDBT_Context* ctx, NDBT_Step* step){
    
    // Read value and save it for later
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 1, false, numRecords) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 1, numRecords) == 0);
    CHECK(hugoOps.execute_Commit(pNdb) == 0);
    CHECK(hugoOps.verifyUpdatesValue(0) == NDBT_OK); // Update value 0
    CHECK(hugoOps.closeTransaction(pNdb) == 0);
@@ -747,7 +747,7 @@ int runCheckRollbackUpdate(NDBT_Context* ctx, NDBT_Step* step){
    CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
  
    // Check record is updated
    CHECK(hugoOps.pkReadRecord(pNdb, 1, true, numRecords) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 1, numRecords, NdbOperation::LM_Exclusive) == 0);
    CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
    CHECK(hugoOps.verifyUpdatesValue(5) == NDBT_OK); // Updates value 5
    CHECK(hugoOps.execute_Rollback(pNdb) == 0);
@@ -756,7 +756,7 @@ int runCheckRollbackUpdate(NDBT_Context* ctx, NDBT_Step* step){

    // Check record is back to original value
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 1, true, numRecords) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 1, numRecords, NdbOperation::LM_Exclusive) == 0);
    CHECK(hugoOps.execute_Commit(pNdb) == 0);
    CHECK(hugoOps.verifyUpdatesValue(0) == NDBT_OK); // Updates value 0

@@ -775,7 +775,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
  do{
    // Read value and save it for later
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 5, false, 10) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 5, 10) == 0);
    CHECK(hugoOps.execute_Commit(pNdb) == 0);
    CHECK(hugoOps.verifyUpdatesValue(0) == NDBT_OK);
    CHECK(hugoOps.closeTransaction(pNdb) == 0);
@@ -785,7 +785,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
    for(Uint32 i = 0; i<1; i++){
      // Read  record 5 - 10
      CHECK(hugoOps.startTransaction(pNdb) == 0);  
      CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
      CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
      CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
      
      for(j = 0; j<10; j++){
@@ -794,7 +794,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
	CHECK(hugoOps.pkUpdateRecord(pNdb, 5, 10, updatesValue) == 0);
	CHECK(hugoOps.execute_NoCommit(pNdb) == 0);

	CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
	CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
	CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
	CHECK(hugoOps.verifyUpdatesValue(updatesValue) == 0);
      }      
@@ -806,7 +806,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){

#if 0
	// Check records are deleted
	CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
	CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
	CHECK(hugoOps.execute_NoCommit(pNdb) == 626);
#endif

@@ -814,7 +814,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
	CHECK(hugoOps.pkInsertRecord(pNdb, 5, 10, updatesValue) == 0);
	CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
	
	CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
	CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
	CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
	CHECK(hugoOps.verifyUpdatesValue(updatesValue) == 0);
      }
@@ -823,7 +823,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
      CHECK(hugoOps.execute_NoCommit(pNdb) == 0);

      // Check records are deleted
      CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
      CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
      CHECK(hugoOps.execute_NoCommit(pNdb) == 626);
      CHECK(hugoOps.execute_Rollback(pNdb) == 0);
      
@@ -833,7 +833,7 @@ int runCheckRollbackDeleteMultiple(NDBT_Context* ctx, NDBT_Step* step){
    // Check records are not deleted
    // after rollback
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
    CHECK(hugoOps.execute_Commit(pNdb) == 0);
    CHECK(hugoOps.verifyUpdatesValue(0) == NDBT_OK);
    
@@ -889,7 +889,7 @@ int runCheckCommitDelete(NDBT_Context* ctx, NDBT_Step* step){
  do{
    // Read  10 records
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
    CHECK(hugoOps.execute_NoCommit(pNdb) == 0);
  
    // Update 10 records
@@ -905,7 +905,7 @@ int runCheckCommitDelete(NDBT_Context* ctx, NDBT_Step* step){

    // Check record's are deleted
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
    CHECK(hugoOps.execute_Commit(pNdb) == 626);

  }while(false);
@@ -930,7 +930,7 @@ int runRollbackNothing(NDBT_Context* ctx, NDBT_Step* step){

    // Check records are not deleted
    CHECK(hugoOps.startTransaction(pNdb) == 0);  
    CHECK(hugoOps.pkReadRecord(pNdb, 5, true, 10) == 0);
    CHECK(hugoOps.pkReadRecord(pNdb, 5, 10, NdbOperation::LM_Exclusive) == 0);
    CHECK(hugoOps.execute_Commit(pNdb) == 0);
    CHECK(hugoOps.closeTransaction(pNdb) == 0);  

+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ int runTestMaxOperations(NDBT_Context* ctx, NDBT_Step* step){
    int i = 0;
    while (errors < maxErrors){
      
      if(hugoOps.pkReadRecord(pNdb,1, false, 1) != NDBT_OK){
      if(hugoOps.pkReadRecord(pNdb,1, 1) != NDBT_OK){
	errors++;
	continue;
      }
Loading