Loading mysql-test/r/ndb_basic.result +24 −0 Original line number Diff line number Diff line Loading @@ -841,4 +841,28 @@ a b 3 30 4 1 drop table t1,t2; create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB; insert into t1 values ('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc'); replace into t1 values ('a', '-a'); replace into t1 values ('b', '-b'); replace into t1 values ('c', '-c'); replace into t1 values ('aa', '-aa'); replace into t1 values ('bb', '-bb'); replace into t1 values ('cc', '-cc'); replace into t1 values ('aaa', '-aaa'); replace into t1 values ('bbb', '-bbb'); replace into t1 values ('ccc', '-ccc'); select * from t1 order by 1,2; a b a -a aa -aa aaa -aaa b -b bb -bb bbb -bbb c -c cc -cc ccc -ccc drop table t1; End of 5.0 tests mysql-test/t/ndb_basic.test +20 −2 Original line number Diff line number Diff line Loading @@ -780,7 +780,25 @@ update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3; select * from t1 order by a; drop table t1,t2; # # Bug#31635 # create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB; insert into t1 values ('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc'); replace into t1 values ('a', '-a'); replace into t1 values ('b', '-b'); replace into t1 values ('c', '-c'); replace into t1 values ('aa', '-aa'); replace into t1 values ('bb', '-bb'); replace into t1 values ('cc', '-cc'); replace into t1 values ('aaa', '-aaa'); replace into t1 values ('bbb', '-bbb'); replace into t1 values ('ccc', '-ccc'); select * from t1 order by 1,2; drop table t1; # End of 5.0 tests --echo End of 5.0 tests ndb/src/kernel/blocks/ERROR_codes.txt +6 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4014 Next DBLQH 5043 Next DBDICT 6007 Next DBDIH 7183 Next DBDIH 7195 Next DBTC 8052 Next CMVMI 9000 Next BACKUP 10022 Loading Loading @@ -73,6 +73,11 @@ Delay GCP_SAVEREQ by 10 secs 7180: Crash master during master-take-over in execMASTER_LCPCONF 7193: Dont send LCP_FRAG_ORD to self, and crash when sending first LCP_FRAG_ORD(last) 7194: Force removeNodeFromStored to complete in the middle of MASTER_LCPCONF ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING: ----------------------------------------------------------------- Loading ndb/src/kernel/blocks/dbdih/Dbdih.hpp +10 −0 Original line number Diff line number Diff line Loading @@ -1291,7 +1291,17 @@ private: LcpStatus lcpStatus; Uint32 lcpStatusUpdatedPlace; struct Save { LcpStatus m_status; Uint32 m_place; } m_saveState[10]; void setLcpStatus(LcpStatus status, Uint32 line){ for (Uint32 i = 9; i > 0; i--) m_saveState[i] = m_saveState[i-1]; m_saveState[0].m_status = lcpStatus; m_saveState[0].m_place = lcpStatusUpdatedPlace; lcpStatus = status; lcpStatusUpdatedPlace = line; } Loading ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +54 −6 Original line number Diff line number Diff line Loading @@ -4764,10 +4764,18 @@ void Dbdih::startRemoveFailedNode(Signal* signal, NodeRecordPtr failedNodePtr) } jam(); if (!ERROR_INSERTED(7194)) { signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE; signal->theData[1] = failedNodePtr.i; signal->theData[2] = 0; // Tab id sendSignal(reference(), GSN_CONTINUEB, signal, 3, JBB); } else { ndbout_c("7194 Not starting ZREMOVE_NODE_FROM_TABLE"); } setLocalNodefailHandling(signal, failedNodePtr.i, NF_REMOVE_NODE_FROM_TABLE); }//Dbdih::startRemoveFailedNode() Loading Loading @@ -5677,11 +5685,21 @@ Dbdih::checkEmptyLcpComplete(Signal *signal){ signal->theData[0] = 7012; execDUMP_STATE_ORD(signal); if (ERROR_INSERTED(7194)) { ndbout_c("7194 starting ZREMOVE_NODE_FROM_TABLE"); signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE; signal->theData[1] = c_lcpMasterTakeOverState.failedNodeId; signal->theData[2] = 0; // Tab id sendSignal(reference(), GSN_CONTINUEB, signal, 3, JBB); } c_lcpMasterTakeOverState.set(LMTOS_INITIAL, __LINE__); MasterLCPReq * const req = (MasterLCPReq *)&signal->theData[0]; req->masterRef = reference(); req->failedNodeId = c_lcpMasterTakeOverState.failedNodeId; sendLoopMacro(MASTER_LCPREQ, sendMASTER_LCPREQ); } else { sendMASTER_LCPCONF(signal); } Loading Loading @@ -5998,6 +6016,15 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal) { const MasterLCPConf * const conf = (MasterLCPConf *)&signal->theData[0]; jamEntry(); if (ERROR_INSERTED(7194)) { ndbout_c("delaying MASTER_LCPCONF due to error 7194"); sendSignalWithDelay(reference(), GSN_MASTER_LCPCONF, signal, 300, signal->getLength()); return; } Uint32 senderNodeId = conf->senderNodeId; MasterLCPConf::State lcpState = (MasterLCPConf::State)conf->lcpState; const Uint32 failedNodeId = conf->failedNodeId; Loading Loading @@ -6132,7 +6159,6 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) #endif c_lcpState.keepGci = SYSFILE->keepGCI; c_lcpState.setLcpStatus(LCP_START_LCP_ROUND, __LINE__); startLcpRoundLoopLab(signal, 0, 0); break; } Loading Loading @@ -9924,6 +9950,8 @@ void Dbdih::sendLastLCP_FRAG_ORD(Signal* signal) if(ERROR_INSERTED(7075)){ continue; } CRASH_INSERTION(7193); BlockReference ref = calcLqhBlockRef(nodePtr.i); sendSignal(ref, GSN_LCP_FRAG_ORD, signal,LcpFragOrd::SignalLength, JBB); } Loading Loading @@ -10121,6 +10149,13 @@ Dbdih::checkLcpAllTablesDoneInLqh(){ CRASH_INSERTION2(7017, !isMaster()); c_lcpState.setLcpStatus(LCP_TAB_COMPLETED, __LINE__); if (ERROR_INSERTED(7194)) { ndbout_c("CLEARING 7194"); CLEAR_ERROR_INSERT_VALUE; } return true; } Loading Loading @@ -10276,6 +10311,11 @@ Dbdih::sendLCP_FRAG_ORD(Signal* signal, BlockReference ref = calcLqhBlockRef(replicaPtr.p->procNode); if (ERROR_INSERTED(7193) && replicaPtr.p->procNode == getOwnNodeId()) { return; } LcpFragOrd * const lcpFragOrd = (LcpFragOrd *)&signal->theData[0]; lcpFragOrd->tableId = info.tableId; lcpFragOrd->fragmentId = info.fragId; Loading Loading @@ -13686,6 +13726,14 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ("immediateLcpStart = %d masterLcpNodeId = %d", c_lcpState.immediateLcpStart, refToNode(c_lcpState.m_masterLcpDihRef)); for (Uint32 i = 0; i<10; i++) { infoEvent("%u : status: %u place: %u", i, c_lcpState.m_saveState[i].m_status, c_lcpState.m_saveState[i].m_place); } infoEvent("-- Node %d LCP STATE --", getOwnNodeId()); } Loading Loading
mysql-test/r/ndb_basic.result +24 −0 Original line number Diff line number Diff line Loading @@ -841,4 +841,28 @@ a b 3 30 4 1 drop table t1,t2; create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB; insert into t1 values ('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc'); replace into t1 values ('a', '-a'); replace into t1 values ('b', '-b'); replace into t1 values ('c', '-c'); replace into t1 values ('aa', '-aa'); replace into t1 values ('bb', '-bb'); replace into t1 values ('cc', '-cc'); replace into t1 values ('aaa', '-aaa'); replace into t1 values ('bbb', '-bbb'); replace into t1 values ('ccc', '-ccc'); select * from t1 order by 1,2; a b a -a aa -aa aaa -aaa b -b bb -bb bbb -bbb c -c cc -cc ccc -ccc drop table t1; End of 5.0 tests
mysql-test/t/ndb_basic.test +20 −2 Original line number Diff line number Diff line Loading @@ -780,7 +780,25 @@ update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3; select * from t1 order by a; drop table t1,t2; # # Bug#31635 # create table t1 (a varchar(100) primary key, b varchar(100)) engine = NDB; insert into t1 values ('a', 'a'),('b','b'),('c', 'c'),('aa', 'aa'),('bb', 'bb'),('cc', 'cc'); replace into t1 values ('a', '-a'); replace into t1 values ('b', '-b'); replace into t1 values ('c', '-c'); replace into t1 values ('aa', '-aa'); replace into t1 values ('bb', '-bb'); replace into t1 values ('cc', '-cc'); replace into t1 values ('aaa', '-aaa'); replace into t1 values ('bbb', '-bbb'); replace into t1 values ('ccc', '-ccc'); select * from t1 order by 1,2; drop table t1; # End of 5.0 tests --echo End of 5.0 tests
ndb/src/kernel/blocks/ERROR_codes.txt +6 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4014 Next DBLQH 5043 Next DBDICT 6007 Next DBDIH 7183 Next DBDIH 7195 Next DBTC 8052 Next CMVMI 9000 Next BACKUP 10022 Loading Loading @@ -73,6 +73,11 @@ Delay GCP_SAVEREQ by 10 secs 7180: Crash master during master-take-over in execMASTER_LCPCONF 7193: Dont send LCP_FRAG_ORD to self, and crash when sending first LCP_FRAG_ORD(last) 7194: Force removeNodeFromStored to complete in the middle of MASTER_LCPCONF ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING: ----------------------------------------------------------------- Loading
ndb/src/kernel/blocks/dbdih/Dbdih.hpp +10 −0 Original line number Diff line number Diff line Loading @@ -1291,7 +1291,17 @@ private: LcpStatus lcpStatus; Uint32 lcpStatusUpdatedPlace; struct Save { LcpStatus m_status; Uint32 m_place; } m_saveState[10]; void setLcpStatus(LcpStatus status, Uint32 line){ for (Uint32 i = 9; i > 0; i--) m_saveState[i] = m_saveState[i-1]; m_saveState[0].m_status = lcpStatus; m_saveState[0].m_place = lcpStatusUpdatedPlace; lcpStatus = status; lcpStatusUpdatedPlace = line; } Loading
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +54 −6 Original line number Diff line number Diff line Loading @@ -4764,10 +4764,18 @@ void Dbdih::startRemoveFailedNode(Signal* signal, NodeRecordPtr failedNodePtr) } jam(); if (!ERROR_INSERTED(7194)) { signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE; signal->theData[1] = failedNodePtr.i; signal->theData[2] = 0; // Tab id sendSignal(reference(), GSN_CONTINUEB, signal, 3, JBB); } else { ndbout_c("7194 Not starting ZREMOVE_NODE_FROM_TABLE"); } setLocalNodefailHandling(signal, failedNodePtr.i, NF_REMOVE_NODE_FROM_TABLE); }//Dbdih::startRemoveFailedNode() Loading Loading @@ -5677,11 +5685,21 @@ Dbdih::checkEmptyLcpComplete(Signal *signal){ signal->theData[0] = 7012; execDUMP_STATE_ORD(signal); if (ERROR_INSERTED(7194)) { ndbout_c("7194 starting ZREMOVE_NODE_FROM_TABLE"); signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE; signal->theData[1] = c_lcpMasterTakeOverState.failedNodeId; signal->theData[2] = 0; // Tab id sendSignal(reference(), GSN_CONTINUEB, signal, 3, JBB); } c_lcpMasterTakeOverState.set(LMTOS_INITIAL, __LINE__); MasterLCPReq * const req = (MasterLCPReq *)&signal->theData[0]; req->masterRef = reference(); req->failedNodeId = c_lcpMasterTakeOverState.failedNodeId; sendLoopMacro(MASTER_LCPREQ, sendMASTER_LCPREQ); } else { sendMASTER_LCPCONF(signal); } Loading Loading @@ -5998,6 +6016,15 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal) { const MasterLCPConf * const conf = (MasterLCPConf *)&signal->theData[0]; jamEntry(); if (ERROR_INSERTED(7194)) { ndbout_c("delaying MASTER_LCPCONF due to error 7194"); sendSignalWithDelay(reference(), GSN_MASTER_LCPCONF, signal, 300, signal->getLength()); return; } Uint32 senderNodeId = conf->senderNodeId; MasterLCPConf::State lcpState = (MasterLCPConf::State)conf->lcpState; const Uint32 failedNodeId = conf->failedNodeId; Loading Loading @@ -6132,7 +6159,6 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) #endif c_lcpState.keepGci = SYSFILE->keepGCI; c_lcpState.setLcpStatus(LCP_START_LCP_ROUND, __LINE__); startLcpRoundLoopLab(signal, 0, 0); break; } Loading Loading @@ -9924,6 +9950,8 @@ void Dbdih::sendLastLCP_FRAG_ORD(Signal* signal) if(ERROR_INSERTED(7075)){ continue; } CRASH_INSERTION(7193); BlockReference ref = calcLqhBlockRef(nodePtr.i); sendSignal(ref, GSN_LCP_FRAG_ORD, signal,LcpFragOrd::SignalLength, JBB); } Loading Loading @@ -10121,6 +10149,13 @@ Dbdih::checkLcpAllTablesDoneInLqh(){ CRASH_INSERTION2(7017, !isMaster()); c_lcpState.setLcpStatus(LCP_TAB_COMPLETED, __LINE__); if (ERROR_INSERTED(7194)) { ndbout_c("CLEARING 7194"); CLEAR_ERROR_INSERT_VALUE; } return true; } Loading Loading @@ -10276,6 +10311,11 @@ Dbdih::sendLCP_FRAG_ORD(Signal* signal, BlockReference ref = calcLqhBlockRef(replicaPtr.p->procNode); if (ERROR_INSERTED(7193) && replicaPtr.p->procNode == getOwnNodeId()) { return; } LcpFragOrd * const lcpFragOrd = (LcpFragOrd *)&signal->theData[0]; lcpFragOrd->tableId = info.tableId; lcpFragOrd->fragmentId = info.fragId; Loading Loading @@ -13686,6 +13726,14 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) ("immediateLcpStart = %d masterLcpNodeId = %d", c_lcpState.immediateLcpStart, refToNode(c_lcpState.m_masterLcpDihRef)); for (Uint32 i = 0; i<10; i++) { infoEvent("%u : status: %u place: %u", i, c_lcpState.m_saveState[i].m_status, c_lcpState.m_saveState[i].m_place); } infoEvent("-- Node %d LCP STATE --", getOwnNodeId()); } Loading