@ -2894,6 +2894,17 @@ void Qmgr::failReportLab(Signal* signal, Uint16 aFailedNode,
systemErrorLab ( signal , __LINE__ ) ;
return ;
} //if
if ( getNodeState ( ) . startLevel < NodeState : : SL_STARTED )
{
jam ( ) ;
CRASH_INSERTION ( 932 ) ;
char buf [ 100 ] ;
BaseString : : snprintf ( buf , 100 , " Node failure during restart " ) ;
progError ( __LINE__ , NDBD_EXIT_SR_OTHERNODEFAILED , buf ) ;
ndbrequire ( false ) ;
}
TnoFailedNodes = cnoFailedNodes ;
failReport ( signal , failedNodePtr . i , ( UintR ) ZTRUE , aFailCause ) ;
if ( cpresident = = getOwnNodeId ( ) ) {
@ -2980,6 +2991,16 @@ void Qmgr::execPREP_FAILREQ(Signal* signal)
return ;
} //if
if ( getNodeState ( ) . startLevel < NodeState : : SL_STARTED )
{
jam ( ) ;
CRASH_INSERTION ( 932 ) ;
char buf [ 100 ] ;
BaseString : : snprintf ( buf , 100 , " Node failure during restart " ) ;
progError ( __LINE__ , NDBD_EXIT_SR_OTHERNODEFAILED , buf ) ;
ndbrequire ( false ) ;
}
guard0 = cnoPrepFailedNodes - 1 ;
arrGuard ( guard0 , MAX_NDB_NODES ) ;
for ( Tindex = 0 ; Tindex < = guard0 ; Tindex + + ) {
@ -3157,6 +3178,18 @@ Qmgr::sendCommitFailReq(Signal* signal)
for ( nodePtr . i = 1 ; nodePtr . i < MAX_NDB_NODES ; nodePtr . i + + ) {
jam ( ) ;
ptrAss ( nodePtr , nodeRec ) ;
# ifdef ERROR_INSERT
if ( ERROR_INSERTED ( 935 ) & & nodePtr . i = = c_error_insert_extra )
{
ndbout_c ( " skipping node %d " , c_error_insert_extra ) ;
CLEAR_ERROR_INSERT_VALUE ;
signal - > theData [ 0 ] = 9999 ;
sendSignalWithDelay ( CMVMI_REF , GSN_NDB_TAMPER , signal , 1000 , 1 ) ;
continue ;
}
# endif
if ( nodePtr . p - > phase = = ZRUNNING ) {
jam ( ) ;
nodePtr . p - > sendCommitFailReqStatus = Q_ACTIVE ;
@ -3227,6 +3260,33 @@ void Qmgr::execPREP_FAILREF(Signal* signal)
return ;
} //Qmgr::execPREP_FAILREF()
static
Uint32
clear_nodes ( Uint32 dstcnt , Uint16 dst [ ] , Uint32 srccnt , const Uint16 src [ ] )
{
if ( srccnt = = 0 )
return dstcnt ;
Uint32 pos = 0 ;
for ( Uint32 i = 0 ; i < dstcnt ; i + + )
{
Uint32 node = dst [ i ] ;
for ( Uint32 j = 0 ; j < srccnt ; j + + )
{
if ( node = = dst [ j ] )
{
node = RNIL ;
break ;
}
}
if ( node ! = RNIL )
{
dst [ pos + + ] = node ;
}
}
return pos ;
}
/*---------------------------------------------------------------------------*/
/* THE PRESIDENT IS NOW COMMITTING THE PREVIOUSLY PREPARED NODE FAILURE. */
/*---------------------------------------------------------------------------*/
@ -3314,19 +3374,18 @@ void Qmgr::execCOMMIT_FAILREQ(Signal* signal)
NodeFailRep : : SignalLength , JBB ) ;
} //if
} //for
if ( cpresident ! = getOwnNodeId ( ) ) {
jam ( ) ;
cnoFailedNodes = cnoCommitFailedNodes - cnoFailedNodes ;
if ( cnoFailedNodes > 0 ) {
jam ( ) ;
guard0 = cnoFailedNodes - 1 ;
arrGuard ( guard0 + cnoCommitFailedNodes , MAX_NDB_NODES ) ;
for ( Tj = 0 ; Tj < = guard0 ; Tj + + ) {
jam ( ) ;
cfailedNodes [ Tj ] = cfailedNodes [ Tj + cnoCommitFailedNodes ] ;
} //for
} //if
} //if
/**
* Remove committed nodes from failed / prepared
*/
cnoFailedNodes = clear_nodes ( cnoFailedNodes ,
cfailedNodes ,
cnoCommitFailedNodes ,
ccommitFailedNodes ) ;
cnoPrepFailedNodes = clear_nodes ( cnoPrepFailedNodes ,
cprepFailedNodes ,
cnoCommitFailedNodes ,
ccommitFailedNodes ) ;
cnoCommitFailedNodes = 0 ;
} //if
/**-----------------------------------------------------------------------
@ -4705,6 +4764,14 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
default :
;
} //switch
# ifdef ERROR_INSERT
if ( signal - > theData [ 0 ] = = 935 & & signal - > getLength ( ) = = 2 )
{
SET_ERROR_INSERT_VALUE ( 935 ) ;
c_error_insert_extra = signal - > theData [ 1 ] ;
}
# endif
} //Qmgr::execDUMP_STATE_ORD()
void Qmgr : : execSET_VAR_REQ ( Signal * signal )