=== modified file 'storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp' --- storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2010-08-11 09:59:39 +0000 +++ storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2010-12-13 10:01:18 +0000 @@ -3738,6 +3738,7 @@ void Qmgr::execCLOSE_COMCONF(Signal* sig arrayIndex++; } } + ndbassert(arrayIndex == cnoPrepFailedNodes); UintR tprepFailConf; UintR Tindex2; UintR guard0; @@ -3748,6 +3749,14 @@ void Qmgr::execCLOSE_COMCONF(Signal* sig tprepFailConf = ZTRUE; if (cnoFailedNodes > 0) { jam(); + /* Check whether the set of nodes which have had communications + * closed is the same as the set of failed nodes. + * If it is, we can confirm the PREP_FAIL phase for this set + * of nodes to the President. + * If it is not, we Refuse the PREP_FAIL phase for this set + * of nodes, the President will start a new PREP_FAIL phase + * for the new set. + */ guard0 = cnoFailedNodes - 1; arrGuard(guard0, MAX_NDB_NODES); for (Tindex = 0; Tindex <= guard0; Tindex++) { @@ -3765,6 +3774,10 @@ void Qmgr::execCLOSE_COMCONF(Signal* sig }//for if (Tfound == ZFALSE) { jam(); + /* A failed node is missing from the set, we will not + * confirm this Prepare_Fail phase. + * Store the node id in the array for later. + */ tprepFailConf = ZFALSE; arrGuard(cnoPrepFailedNodes, MAX_NDB_NODES); cprepFailedNodes[cnoPrepFailedNodes] = TfailedNodeNo; @@ -3774,7 +3787,11 @@ void Qmgr::execCLOSE_COMCONF(Signal* sig }//if if (tprepFailConf == ZFALSE) { jam(); - for (Tindex = 1; Tindex < MAX_NDB_NODES; Tindex++) { + /* Inform President that we cannot confirm the PREP_FAIL + * phase as we are aware of at least one other node + * failure + */ + for (Tindex = 0; Tindex < MAX_NDB_NODES; Tindex++) { cfailedNodes[Tindex] = cprepFailedNodes[Tindex]; }//for cnoFailedNodes = cnoPrepFailedNodes; @@ -3786,6 +3803,9 @@ void Qmgr::execCLOSE_COMCONF(Signal* sig cnoPrepFailedNodes, cprepFailedNodes); } else { + /* We have prepared the failure of the requested nodes + * send confirmation to the president + */ jam(); cnoCommitFailedNodes = cnoPrepFailedNodes; guard0 = cnoPrepFailedNodes - 1;