Browse Source

ndb - testNodeRestart -n Bug27466 T1

make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race, error insert causes 5s delay)


storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race)
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race)
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race)
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race)
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race)
storage/ndb/src/kernel/blocks/suma/Suma.cpp:
  make local INCL_NODEREQ/CONF more robust (to remove testprg introduced race)
storage/ndb/test/ndbapi/testNodeRestart.cpp:
  soem more printout
pull/374/head
unknown 18 years ago
parent
commit
c124985e6d
  1. 5
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
  2. 5
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
  3. 37
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
  4. 5
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
  5. 8
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
  6. 5
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
  7. 2
      storage/ndb/test/ndbapi/testNodeRestart.cpp

5
storage/ndb/src/kernel/blocks/backup/Backup.cpp

@ -1026,8 +1026,9 @@ Backup::execINCL_NODEREQ(Signal* signal)
break;
}//if
}//for
signal->theData[0] = reference();
sendSignal(senderRef, GSN_INCL_NODECONF, signal, 1, JBB);
signal->theData[0] = inclNode;
signal->theData[1] = reference();
sendSignal(senderRef, GSN_INCL_NODECONF, signal, 2, JBB);
}
/*****************************************************************************

5
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp

@ -3825,8 +3825,9 @@ void Dbdict::execINCL_NODEREQ(Signal* signal)
c_nodes.getPtr(nodePtr);
ndbrequire(nodePtr.p->nodeState == NodeRecord::NDB_NODE_DEAD);
nodePtr.p->nodeState = NodeRecord::NDB_NODE_ALIVE;
signal->theData[0] = reference();
sendSignal(retRef, GSN_INCL_NODECONF, signal, 1, JBB);
signal->theData[0] = nodePtr.i;
signal->theData[1] = reference();
sendSignal(retRef, GSN_INCL_NODECONF, signal, 2, JBB);
c_aliveNodes.set(nodePtr.i);
}//execINCL_NODEREQ()

37
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp

@ -2135,12 +2135,9 @@ void Dbdih::gcpBlockedLab(Signal* signal)
/*---------------------------------------------------------------------------*/
void Dbdih::execINCL_NODECONF(Signal* signal)
{
Uint32 TsendNodeId;
Uint32 TstartNode_or_blockref;
jamEntry();
TstartNode_or_blockref = signal->theData[0];
TsendNodeId = signal->theData[1];
Uint32 TstartNode = signal->theData[0];
Uint32 TsendNodeId_or_blockref = signal->theData[1];
Uint32 blocklist[6];
blocklist[0] = clocallqhblockref;
@ -2152,9 +2149,21 @@ void Dbdih::execINCL_NODECONF(Signal* signal)
for (Uint32 i = 0; blocklist[i] != 0; i++)
{
if (TstartNode_or_blockref == blocklist[i])
if (TsendNodeId_or_blockref == blocklist[i])
{
jam();
if (TstartNode != c_nodeStartSlave.nodeId)
{
jam();
warningEvent("Recevied INCL_NODECONF for %u from %s"
" while %u is starting",
TstartNode,
getBlockName(refToBlock(TsendNodeId_or_blockref)),
c_nodeStartSlave.nodeId);
return;
}
if (getNodeStatus(c_nodeStartSlave.nodeId) == NodeRecord::ALIVE &&
blocklist[i+1] != 0)
{
@ -2182,10 +2191,21 @@ void Dbdih::execINCL_NODECONF(Signal* signal)
}
}
}
if (c_nodeStartMaster.startNode != TstartNode)
{
jam();
warningEvent("Recevied INCL_NODECONF for %u from %u"
" while %u is starting",
TstartNode,
TsendNodeId_or_blockref,
c_nodeStartMaster.startNode);
return;
}
ndbrequire(cmasterdihref = reference());
receiveLoopMacro(INCL_NODEREQ, TsendNodeId);
receiveLoopMacro(INCL_NODEREQ, TsendNodeId_or_blockref);
CRASH_INSERTION(7128);
/*-------------------------------------------------------------------------*/
// Now that we have included the starting node in the node lists in the
@ -13006,6 +13026,7 @@ void Dbdih::newCrashedReplica(Uint32 nodeId, ReplicaRecordPtr ncrReplicaPtr)
void Dbdih::nodeResetStart()
{
jam();
c_nodeStartSlave.nodeId = 0;
c_nodeStartMaster.startNode = RNIL;
c_nodeStartMaster.failNr = cfailurenr;
c_nodeStartMaster.activeState = false;

5
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp

@ -494,8 +494,9 @@ void Dblqh::execINCL_NODEREQ(Signal* signal)
cnodeStatus[i] = ZNODE_UP;
}//if
}//for
signal->theData[0] = cownref;
sendSignal(retRef, GSN_INCL_NODECONF, signal, 1, JBB);
signal->theData[0] = nodeId;
signal->theData[1] = cownref;
sendSignal(retRef, GSN_INCL_NODECONF, signal, 2, JBB);
return;
}//Dblqh::execINCL_NODEREQ()

8
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp

@ -310,9 +310,11 @@ void Dbtc::execINCL_NODEREQ(Signal* signal)
hostptr.i = signal->theData[1];
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
hostptr.p->hostStatus = HS_ALIVE;
signal->theData[0] = cownref;
c_alive_nodes.set(hostptr.i);
signal->theData[0] = hostptr.i;
signal->theData[1] = cownref;
if (ERROR_INSERTED(8039))
{
CLEAR_ERROR_INSERT_VALUE;
@ -321,11 +323,11 @@ void Dbtc::execINCL_NODEREQ(Signal* signal)
sendSignal(numberToRef(CMVMI, hostptr.i),
GSN_NDB_TAMPER, signal, 1, JBB);
signal->theData[0] = save;
sendSignalWithDelay(tblockref, GSN_INCL_NODECONF, signal, 5000, 1);
sendSignalWithDelay(tblockref, GSN_INCL_NODECONF, signal, 5000, 2);
return;
}
sendSignal(tblockref, GSN_INCL_NODECONF, signal, 1, JBB);
sendSignal(tblockref, GSN_INCL_NODECONF, signal, 2, JBB);
}
void Dbtc::execREAD_NODESREF(Signal* signal)

5
storage/ndb/src/kernel/blocks/suma/Suma.cpp

@ -821,8 +821,9 @@ Suma::execINCL_NODEREQ(Signal* signal){
ndbrequire(!c_alive_nodes.get(nodeId));
c_alive_nodes.set(nodeId);
signal->theData[0] = reference();
sendSignal(senderRef, GSN_INCL_NODECONF, signal, 1, JBB);
signal->theData[0] = nodeId;
signal->theData[1] = reference();
sendSignal(senderRef, GSN_INCL_NODECONF, signal, 2, JBB);
}
void

2
storage/ndb/test/ndbapi/testNodeRestart.cpp

@ -1590,6 +1590,8 @@ runBug27466(NDBT_Context* ctx, NDBT_Step* step)
node2 = res.getDbNodeId(rand() % res.getNumDbNodes());
}
ndbout_c("nodes %u %u", node1, node2);
if (res.restartOneDbNode(node1, false, true, true))
return NDBT_FAILED;

Loading…
Cancel
Save