mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into perch.ndb.mysql.com:/home/jonas/src/51-work storage/ndb/include/ndbapi/NdbOperation.hpp: Auto merged storage/ndb/src/kernel/blocks/ERROR_codes.txt: Auto merged storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Auto merged storage/ndb/src/mgmapi/ndb_logevent.cpp: Auto merged storage/ndb/test/ndbapi/testIndex.cpp: Auto merged storage/ndb/test/ndbapi/testSystemRestart.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: merge storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: merge storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: merge storage/ndb/test/run-test/daily-basic-tests.txt: merge
This commit is contained in:
commit
abd3a43b9f
15 changed files with 298 additions and 63 deletions
|
@ -3,7 +3,17 @@
|
|||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$fast_cflags $max_cflags -g"
|
||||
extra_configs="$max_configs --with-ndb-test --with-ndb-ccflags="-DERROR_INSERT""
|
||||
extra_configs="$max_configs --with-ndb-test --with-ndb-ccflags='-DERROR_INSERT'"
|
||||
if [ "$full_debug" ]
|
||||
then
|
||||
extra_flags="$debug_cflags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$debug_configs $extra_configs"
|
||||
else
|
||||
extra_flags="$fast_cflags"
|
||||
fi
|
||||
|
||||
extra_flags="$extra_flags $max_cflags -g"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
|
|
@ -482,7 +482,7 @@ public:
|
|||
|
||||
/**
|
||||
* Interpreted program instruction:
|
||||
* Substract RegSource1 from RegSource2 and put the result in RegDest.
|
||||
* Substract RegSource2 from RegSource1 and put the result in RegDest.
|
||||
*
|
||||
* @param RegSource1 First register.
|
||||
* @param RegSource2 Second register.
|
||||
|
|
|
@ -6,7 +6,7 @@ Next DBTUP 4024
|
|||
Next DBLQH 5045
|
||||
Next DBDICT 6007
|
||||
Next DBDIH 7177
|
||||
Next DBTC 8037
|
||||
Next DBTC 8038
|
||||
Next CMVMI 9000
|
||||
Next BACKUP 10022
|
||||
Next DBUTIL 11002
|
||||
|
@ -283,6 +283,7 @@ ABORT OF TCKEYREQ
|
|||
|
||||
8032: No free TC records any more
|
||||
|
||||
8037 : Invalid schema version in TCINDXREQ
|
||||
|
||||
CMVMI
|
||||
-----
|
||||
|
|
|
@ -8545,8 +8545,8 @@ void Dbdih::openingTableErrorLab(Signal* signal, FileRecordPtr filePtr)
|
|||
else
|
||||
{
|
||||
char buf[256];
|
||||
BaseString::snprintf(buf, sizeof(buf),
|
||||
"Error opening DIH schema files for table: %d",
|
||||
BaseString::snprintf(buf, sizeof(buf),
|
||||
"Error opening DIH schema files for table: %d",
|
||||
tabPtr.i);
|
||||
progError(__LINE__, NDBD_EXIT_AFS_NO_SUCH_FILE, buf);
|
||||
}
|
||||
|
@ -8715,6 +8715,7 @@ Dbdih::resetReplicaSr(TabRecordPtr tabPtr){
|
|||
}
|
||||
replicaPtr.i = nextReplicaPtrI;
|
||||
}//while
|
||||
updateNodeInfo(fragPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7180,6 +7180,7 @@ void Dblqh::execACC_ABORTCONF(Signal* signal)
|
|||
signal->theData[0] = regTcPtr->tupConnectrec;
|
||||
EXECUTE_DIRECT(DBTUP, GSN_TUP_ABORTREQ, signal, 1);
|
||||
|
||||
regTcPtr->totSendlenAi = regTcPtr->totReclenAi;
|
||||
continueAbortLab(signal);
|
||||
return;
|
||||
}//Dblqh::execACC_ABORTCONF()
|
||||
|
|
|
@ -727,7 +727,7 @@ public:
|
|||
|
||||
// Index data
|
||||
|
||||
bool isIndexOp; // Used to mark on-going TcKeyReq as indx table access
|
||||
Uint8 isIndexOp; // Used to mark on-going TcKeyReq as indx table access
|
||||
bool indexOpReturn;
|
||||
UintR noIndexOp; // No outstanding index ops
|
||||
|
||||
|
@ -815,7 +815,7 @@ public:
|
|||
UintR savedState[LqhKeyConf::SignalLength];
|
||||
|
||||
// Index data
|
||||
bool isIndexOp; // Used to mark on-going TcKeyReq as index table access
|
||||
Uint8 isIndexOp; // Used to mark on-going TcKeyReq as index table access
|
||||
UintR indexOp;
|
||||
UintR currentIndexId;
|
||||
UintR attrInfoLen;
|
||||
|
|
|
@ -1776,8 +1776,7 @@ void Dbtc::execKEYINFO(Signal* signal)
|
|||
apiConnectptr.i = signal->theData[0];
|
||||
tmaxData = 20;
|
||||
if (apiConnectptr.i >= capiConnectFilesize) {
|
||||
jam();
|
||||
warningHandlerLab(signal, __LINE__);
|
||||
TCKEY_abort(signal, 18);
|
||||
return;
|
||||
}//if
|
||||
ptrAss(apiConnectptr, apiConnectRecord);
|
||||
|
@ -1786,9 +1785,7 @@ void Dbtc::execKEYINFO(Signal* signal)
|
|||
compare_transid2 = apiConnectptr.p->transid[1] ^ signal->theData[2];
|
||||
compare_transid1 = compare_transid1 | compare_transid2;
|
||||
if (compare_transid1 != 0) {
|
||||
jam();
|
||||
printState(signal, 10);
|
||||
sendSignalErrorRefuseLab(signal);
|
||||
TCKEY_abort(signal, 19);
|
||||
return;
|
||||
}//if
|
||||
switch (apiConnectptr.p->apiConnectstate) {
|
||||
|
@ -2533,7 +2530,7 @@ void Dbtc::execTCKEYREQ(Signal* signal)
|
|||
Uint32 TstartFlag = tcKeyReq->getStartFlag(Treqinfo);
|
||||
Uint32 TexecFlag = TcKeyReq::getExecuteFlag(Treqinfo);
|
||||
|
||||
bool isIndexOp = regApiPtr->isIndexOp;
|
||||
Uint8 isIndexOp = regApiPtr->isIndexOp;
|
||||
bool isIndexOpReturn = regApiPtr->indexOpReturn;
|
||||
regApiPtr->isIndexOp = false; // Reset marker
|
||||
regApiPtr->m_exec_flag |= TexecFlag;
|
||||
|
@ -3267,7 +3264,7 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
|
|||
sig1 = regCachePtr->fragmentid + (regTcPtr->tcNodedata[1] << 16);
|
||||
sig2 = regApiPtr->transid[0];
|
||||
sig3 = regApiPtr->transid[1];
|
||||
sig4 = regApiPtr->ndbapiBlockref;
|
||||
sig4 = (regTcPtr->isIndexOp == 2) ? reference() : regApiPtr->ndbapiBlockref;
|
||||
sig5 = regTcPtr->clientData;
|
||||
sig6 = regCachePtr->scanInfo;
|
||||
|
||||
|
@ -8629,6 +8626,7 @@ void Dbtc::execSCAN_TABREQ(Signal* signal)
|
|||
// left over from simple/dirty read
|
||||
} else {
|
||||
jam();
|
||||
jamLine(transP->apiConnectstate);
|
||||
errCode = ZSTATE_ERROR;
|
||||
goto SCAN_TAB_error_no_state_change;
|
||||
}
|
||||
|
@ -12053,14 +12051,18 @@ void Dbtc::readIndexTable(Signal* signal,
|
|||
opType == ZREAD ? ZREAD : ZREAD_EX);
|
||||
TcKeyReq::setAIInTcKeyReq(tcKeyRequestInfo, 1); // Allways send one AttrInfo
|
||||
TcKeyReq::setExecutingTrigger(tcKeyRequestInfo, 0);
|
||||
BlockReference originalReceiver = regApiPtr->ndbapiBlockref;
|
||||
regApiPtr->ndbapiBlockref = reference(); // Send result to me
|
||||
tcKeyReq->senderData = indexOp->indexOpId;
|
||||
indexOp->indexOpState = IOS_INDEX_ACCESS;
|
||||
regApiPtr->executingIndexOp = regApiPtr->accumulatingIndexOp;
|
||||
regApiPtr->accumulatingIndexOp = RNIL;
|
||||
regApiPtr->isIndexOp = true;
|
||||
regApiPtr->isIndexOp = 2;
|
||||
|
||||
if (ERROR_INSERTED(8037))
|
||||
{
|
||||
ndbout_c("shifting index version");
|
||||
tcKeyReq->tableSchemaVersion = ~(Uint32)indexOp->tcIndxReq.tableSchemaVersion;
|
||||
}
|
||||
|
||||
Uint32 remainingKey = indexOp->keyInfo.getSize();
|
||||
bool moreKeyData = indexOp->keyInfo.first(keyIter);
|
||||
// *********** KEYINFO in TCKEYREQ ***********
|
||||
|
@ -12079,21 +12081,13 @@ void Dbtc::readIndexTable(Signal* signal,
|
|||
ndbassert(TcKeyReq::getDirtyFlag(tcKeyRequestInfo) == 0);
|
||||
ndbassert(TcKeyReq::getSimpleFlag(tcKeyRequestInfo) == 0);
|
||||
EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
|
||||
|
||||
/**
|
||||
* "Fool" TC not to start commiting transaction since it always will
|
||||
* have one outstanding lqhkeyreq
|
||||
* This is later decreased when the index read is complete
|
||||
*/
|
||||
regApiPtr->lqhkeyreqrec++;
|
||||
|
||||
/**
|
||||
* Remember ptr to index read operation
|
||||
* (used to set correct save point id on index operation later)
|
||||
*/
|
||||
indexOp->indexReadTcConnect = regApiPtr->lastTcConnect;
|
||||
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
goto err;
|
||||
}
|
||||
|
||||
// *********** KEYINFO ***********
|
||||
if (moreKeyData) {
|
||||
jam();
|
||||
|
@ -12113,6 +12107,10 @@ void Dbtc::readIndexTable(Signal* signal,
|
|||
EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal,
|
||||
KeyInfo::HeaderLength + KeyInfo::DataLength);
|
||||
jamEntry();
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
goto err;
|
||||
}
|
||||
dataPos = 0;
|
||||
dataPtr = (Uint32 *) &keyInfo->keyData;
|
||||
}
|
||||
|
@ -12123,10 +12121,32 @@ void Dbtc::readIndexTable(Signal* signal,
|
|||
EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal,
|
||||
KeyInfo::HeaderLength + dataPos);
|
||||
jamEntry();
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
regApiPtr->ndbapiBlockref = originalReceiver; // reset original receiver
|
||||
/**
|
||||
* "Fool" TC not to start commiting transaction since it always will
|
||||
* have one outstanding lqhkeyreq
|
||||
* This is later decreased when the index read is complete
|
||||
*/
|
||||
regApiPtr->lqhkeyreqrec++;
|
||||
|
||||
/**
|
||||
* Remember ptr to index read operation
|
||||
* (used to set correct save point id on index operation later)
|
||||
*/
|
||||
indexOp->indexReadTcConnect = regApiPtr->lastTcConnect;
|
||||
|
||||
done:
|
||||
return;
|
||||
|
||||
err:
|
||||
jam();
|
||||
goto done;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12181,7 +12201,7 @@ void Dbtc::executeIndexOperation(Signal* signal,
|
|||
tcKeyReq->transId2 = regApiPtr->transid[1];
|
||||
tcKeyReq->senderData = tcIndxReq->senderData; // Needed for TRANSID_AI to API
|
||||
indexOp->indexOpState = IOS_INDEX_OPERATION;
|
||||
regApiPtr->isIndexOp = true;
|
||||
regApiPtr->isIndexOp = 1;
|
||||
regApiPtr->executingIndexOp = indexOp->indexOpId;;
|
||||
regApiPtr->noIndexOp++; // Increase count
|
||||
|
||||
|
@ -12262,9 +12282,16 @@ void Dbtc::executeIndexOperation(Signal* signal,
|
|||
const Uint32 currSavePointId = regApiPtr->currSavePointId;
|
||||
regApiPtr->currSavePointId = tmp.p->savePointId;
|
||||
EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
regApiPtr->currSavePointId = currSavePointId;
|
||||
|
||||
jamEntry();
|
||||
// *********** KEYINFO ***********
|
||||
if (moreKeyData) {
|
||||
jam();
|
||||
|
@ -12285,6 +12312,13 @@ void Dbtc::executeIndexOperation(Signal* signal,
|
|||
EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal,
|
||||
KeyInfo::HeaderLength + KeyInfo::DataLength);
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPos = 0;
|
||||
dataPtr = (Uint32 *) &keyInfo->keyData;
|
||||
}
|
||||
|
@ -12295,6 +12329,12 @@ void Dbtc::executeIndexOperation(Signal* signal,
|
|||
EXECUTE_DIRECT(DBTC, GSN_KEYINFO, signal,
|
||||
KeyInfo::HeaderLength + dataPos);
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12324,6 +12364,13 @@ void Dbtc::executeIndexOperation(Signal* signal,
|
|||
EXECUTE_DIRECT(DBTC, GSN_ATTRINFO, signal,
|
||||
AttrInfo::HeaderLength + AttrInfo::DataLength);
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
attrInfoPos = 0;
|
||||
dataPtr = (Uint32 *) &attrInfo->attrData;
|
||||
}
|
||||
|
@ -12731,9 +12778,16 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
|
|||
const Uint32 currSavePointId = regApiPtr->currSavePointId;
|
||||
regApiPtr->currSavePointId = opRecord->savePointId;
|
||||
EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
regApiPtr->currSavePointId = currSavePointId;
|
||||
tcConnectptr.p->currentIndexId = indexData->indexId;
|
||||
jamEntry();
|
||||
|
||||
// *********** KEYINFO ***********
|
||||
if (moreKeyData) {
|
||||
|
@ -12763,6 +12817,12 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
|
|||
KeyInfo::HeaderLength + KeyInfo::DataLength);
|
||||
jamEntry();
|
||||
#endif
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPtr = (Uint32 *) &keyInfo->keyData;
|
||||
dataPos = 0;
|
||||
}
|
||||
|
@ -12798,6 +12858,13 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
|
|||
KeyInfo::HeaderLength + KeyInfo::DataLength);
|
||||
jamEntry();
|
||||
#endif
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPtr = (Uint32 *) &keyInfo->keyData;
|
||||
dataPos = 0;
|
||||
}
|
||||
|
@ -12815,6 +12882,11 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
|
|||
KeyInfo::HeaderLength + dataPos);
|
||||
jamEntry();
|
||||
#endif
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12850,6 +12922,12 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
|
|||
AttrInfo::HeaderLength + AttrInfo::DataLength);
|
||||
jamEntry();
|
||||
#endif
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPtr = (Uint32 *) &attrInfo->attrData;
|
||||
attrInfoPos = 0;
|
||||
}
|
||||
|
@ -12909,6 +12987,12 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
|
|||
AttrInfo::HeaderLength + AttrInfo::DataLength);
|
||||
jamEntry();
|
||||
#endif
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPtr = (Uint32 *) &attrInfo->attrData;
|
||||
attrInfoPos = 0;
|
||||
}
|
||||
|
@ -13054,9 +13138,16 @@ void Dbtc::deleteFromIndexTable(Signal* signal,
|
|||
const Uint32 currSavePointId = regApiPtr->currSavePointId;
|
||||
regApiPtr->currSavePointId = opRecord->savePointId;
|
||||
EXECUTE_DIRECT(DBTC, GSN_TCKEYREQ, signal, tcKeyLength);
|
||||
jamEntry();
|
||||
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
regApiPtr->currSavePointId = currSavePointId;
|
||||
tcConnectptr.p->currentIndexId = indexData->indexId;
|
||||
jamEntry();
|
||||
|
||||
// *********** KEYINFO ***********
|
||||
if (moreKeyData) {
|
||||
|
@ -13087,6 +13178,12 @@ void Dbtc::deleteFromIndexTable(Signal* signal,
|
|||
KeyInfo::HeaderLength + KeyInfo::DataLength);
|
||||
jamEntry();
|
||||
#endif
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPtr = (Uint32 *) &keyInfo->keyData;
|
||||
dataPos = 0;
|
||||
}
|
||||
|
@ -13123,6 +13220,12 @@ void Dbtc::deleteFromIndexTable(Signal* signal,
|
|||
KeyInfo::HeaderLength + KeyInfo::DataLength);
|
||||
jamEntry();
|
||||
#endif
|
||||
if (unlikely(regApiPtr->apiConnectstate == CS_ABORTING))
|
||||
{
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
|
||||
dataPtr = (Uint32 *) &keyInfo->keyData;
|
||||
dataPos = 0;
|
||||
}
|
||||
|
|
|
@ -938,7 +938,7 @@ int Dbtup::handleReadReq(Signal* signal,
|
|||
dst,
|
||||
dstLen,
|
||||
false);
|
||||
if (ret != -1) {
|
||||
if (likely(ret != -1)) {
|
||||
/* ------------------------------------------------------------------------- */
|
||||
// We have read all data into coutBuffer. Now send it to the API.
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -948,16 +948,16 @@ int Dbtup::handleReadReq(Signal* signal,
|
|||
sendReadAttrinfo(signal, req_struct, TnoOfDataRead, regOperPtr);
|
||||
return 0;
|
||||
}
|
||||
jam();
|
||||
tupkeyErrorLab(signal);
|
||||
return -1;
|
||||
} else {
|
||||
jam();
|
||||
if (interpreterStartLab(signal, req_struct) != -1) {
|
||||
if (likely(interpreterStartLab(signal, req_struct) != -1) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
jam();
|
||||
tupkeyErrorLab(signal);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
@ -1675,6 +1675,7 @@ int Dbtup::interpreterStartLab(Signal* signal,
|
|||
RlogSize= TnoDataRW;
|
||||
} else {
|
||||
jam();
|
||||
tupkeyErrorLab(signal);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,24 +181,28 @@ void Dbtup::allocConsPages(Uint32 noOfPagesToAllocate,
|
|||
/* PROPER AMOUNT OF PAGES WERE NOT FOUND. FIND AS MUCH AS */
|
||||
/* POSSIBLE. */
|
||||
/* ---------------------------------------------------------------- */
|
||||
for (Uint32 j = firstListToCheck; (Uint32)~j; j--) {
|
||||
if (firstListToCheck)
|
||||
{
|
||||
ljam();
|
||||
if (cfreepageList[j] != RNIL) {
|
||||
for (Uint32 j = firstListToCheck - 1; (Uint32)~j; j--) {
|
||||
ljam();
|
||||
if (cfreepageList[j] != RNIL) {
|
||||
ljam();
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* SOME AREA WAS FOUND, ALLOCATE ALL OF IT. */
|
||||
/* ---------------------------------------------------------------- */
|
||||
allocPageRef = cfreepageList[j];
|
||||
removeCommonArea(allocPageRef, j);
|
||||
noOfPagesAllocated = 1 << j;
|
||||
findFreeLeftNeighbours(allocPageRef, noOfPagesAllocated,
|
||||
noOfPagesToAllocate);
|
||||
findFreeRightNeighbours(allocPageRef, noOfPagesAllocated,
|
||||
noOfPagesToAllocate);
|
||||
|
||||
return;
|
||||
}//if
|
||||
}//for
|
||||
allocPageRef = cfreepageList[j];
|
||||
removeCommonArea(allocPageRef, j);
|
||||
noOfPagesAllocated = 1 << j;
|
||||
findFreeLeftNeighbours(allocPageRef, noOfPagesAllocated,
|
||||
noOfPagesToAllocate);
|
||||
findFreeRightNeighbours(allocPageRef, noOfPagesAllocated,
|
||||
noOfPagesToAllocate);
|
||||
|
||||
return;
|
||||
}//if
|
||||
}//for
|
||||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
/* NO FREE AREA AT ALL EXISTED. RETURN ZERO PAGES */
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
|
|
@ -431,12 +431,12 @@ void Dbtup::allocMoreFragPages(Fragrecord* const regFragPtr)
|
|||
Uint32 noAllocPages = regFragPtr->noOfPagesToGrow >> 3; // 12.5%
|
||||
noAllocPages += regFragPtr->noOfPagesToGrow >> 4; // 6.25%
|
||||
noAllocPages += 2;
|
||||
regFragPtr->noOfPagesToGrow += noAllocPages;
|
||||
/* -----------------------------------------------------------------*/
|
||||
// We will grow by 18.75% plus two more additional pages to grow
|
||||
// a little bit quicker in the beginning.
|
||||
/* -----------------------------------------------------------------*/
|
||||
allocFragPages(regFragPtr, noAllocPages);
|
||||
Uint32 allocated = allocFragPages(regFragPtr, noAllocPages);
|
||||
regFragPtr->noOfPagesToGrow += allocated;
|
||||
}//Dbtup::allocMoreFragPages()
|
||||
|
||||
Uint32 Dbtup::leafPageRangeFull(Fragrecord* const regFragPtr, PageRangePtr currPageRangePtr)
|
||||
|
|
|
@ -199,10 +199,9 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
|
|||
|
||||
case SystemError::CopyFragRefError:
|
||||
BaseString::snprintf(buf, sizeof(buf),
|
||||
"Node %d killed this node because "
|
||||
"it could not copy a fragment during node restart. "
|
||||
"Copy fragment error code: %u.",
|
||||
killingNode, data1);
|
||||
"Killed by node %d as "
|
||||
"copyfrag failed, error: %u",
|
||||
killingNode, data1);
|
||||
break;
|
||||
|
||||
case SystemError::StartFragRefError:
|
||||
|
@ -2086,6 +2085,11 @@ void Ndbcntr::execSET_VAR_REQ(Signal* signal) {
|
|||
void Ndbcntr::updateNodeState(Signal* signal, const NodeState& newState) const{
|
||||
NodeStateRep * const stateRep = (NodeStateRep *)&signal->theData[0];
|
||||
|
||||
if (newState.startLevel == NodeState::SL_STARTED)
|
||||
{
|
||||
CRASH_INSERTION(1000);
|
||||
}
|
||||
|
||||
stateRep->nodeState = newState;
|
||||
stateRep->nodeState.masterNodeId = cmasterNodeId;
|
||||
stateRep->nodeState.setNodeGroup(c_nodeGroup);
|
||||
|
@ -2890,7 +2894,7 @@ void Ndbcntr::Missra::sendNextSTTOR(Signal* signal){
|
|||
cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
signal->theData[0] = NDB_LE_NDBStartCompleted;
|
||||
signal->theData[1] = NDB_VERSION;
|
||||
cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
|
||||
|
|
|
@ -67,6 +67,13 @@ ndb_mgm_create_logevent_handle(NdbMgmHandle mh,
|
|||
return h;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
int
|
||||
ndb_logevent_get_fd(const NdbLogEventHandle h)
|
||||
{
|
||||
return h->socket;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
void ndb_mgm_destroy_logevent_handle(NdbLogEventHandle * h)
|
||||
{
|
||||
|
|
|
@ -1199,6 +1199,48 @@ int runLQHKEYREF(NDBT_Context* ctx, NDBT_Step* step){
|
|||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runBug21384(NDBT_Context* ctx, NDBT_Step* step)
|
||||
{
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
HugoTransactions hugoTrans(*ctx->getTab());
|
||||
NdbRestarter restarter;
|
||||
|
||||
int loops = ctx->getNumLoops();
|
||||
const int rows = ctx->getNumRecords();
|
||||
const int batchsize = ctx->getProperty("BatchSize", 50);
|
||||
|
||||
while (loops--)
|
||||
{
|
||||
if(restarter.insertErrorInAllNodes(8037) != 0)
|
||||
{
|
||||
g_err << "Failed to error insert(8037)" << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
if (hugoTrans.indexReadRecords(pNdb, pkIdxName, rows, batchsize) == 0)
|
||||
{
|
||||
g_err << "Index succeded (it should have failed" << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
if(restarter.insertErrorInAllNodes(0) != 0)
|
||||
{
|
||||
g_err << "Failed to error insert(0)" << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
if (hugoTrans.indexReadRecords(pNdb, pkIdxName, rows, batchsize) != 0){
|
||||
g_err << "Index read failed" << endl;
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
NDBT_TESTSUITE(testIndex);
|
||||
TESTCASE("CreateAll",
|
||||
"Test that we can create all various indexes on each table\n"
|
||||
|
@ -1512,6 +1554,16 @@ TESTCASE("UniqueNull",
|
|||
FINALIZER(createPkIndex_Drop);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("Bug21384",
|
||||
"Test that unique indexes and nulls"){
|
||||
TC_PROPERTY("LoggedIndexes", (unsigned)0);
|
||||
INITIALIZER(runClearTable);
|
||||
INITIALIZER(createPkIndex);
|
||||
INITIALIZER(runLoadTable);
|
||||
STEP(runBug21384);
|
||||
FINALIZER(createPkIndex_Drop);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
NDBT_TESTSUITE_END(testIndex);
|
||||
|
||||
int main(int argc, const char** argv){
|
||||
|
|
|
@ -1121,6 +1121,46 @@ int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
|
|||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runBug21536(NDBT_Context* ctx, NDBT_Step* step)
|
||||
{
|
||||
NdbRestarter restarter;
|
||||
const Uint32 nodeCount = restarter.getNumDbNodes();
|
||||
if(nodeCount != 2){
|
||||
g_info << "Bug21536 - 2 nodes to test" << endl;
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int node1 = restarter.getDbNodeId(rand() % nodeCount);
|
||||
int node2 = restarter.getRandomNodeSameNodeGroup(node1, rand());
|
||||
|
||||
if (node1 == -1 || node2 == -1)
|
||||
return NDBT_OK;
|
||||
|
||||
int result = NDBT_OK;
|
||||
do {
|
||||
CHECK(restarter.restartOneDbNode(node1, false, true, true) == 0);
|
||||
CHECK(restarter.waitNodesNoStart(&node1, 1) == 0);
|
||||
CHECK(restarter.insertErrorInNode(node1, 1000) == 0);
|
||||
int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
|
||||
CHECK(restarter.dumpStateOneNode(node1, val2, 2) == 0);
|
||||
CHECK(restarter.startNodes(&node1, 1) == 0);
|
||||
restarter.waitNodesStartPhase(&node1, 1, 3, 120);
|
||||
CHECK(restarter.waitNodesNoStart(&node1, 1) == 0);
|
||||
|
||||
CHECK(restarter.restartOneDbNode(node2, true, true, true) == 0);
|
||||
CHECK(restarter.waitNodesNoStart(&node2, 1) == 0);
|
||||
CHECK(restarter.startNodes(&node1, 1) == 0);
|
||||
CHECK(restarter.waitNodesStarted(&node1, 1) == 0);
|
||||
CHECK(restarter.startNodes(&node2, 1) == 0);
|
||||
CHECK(restarter.waitClusterStarted() == 0);
|
||||
|
||||
} while(0);
|
||||
|
||||
g_info << "Bug21536 finished" << endl;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
NDBT_TESTSUITE(testSystemRestart);
|
||||
TESTCASE("SR1",
|
||||
|
@ -1287,6 +1327,13 @@ TESTCASE("Bug18385",
|
|||
STEP(runBug18385);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("Bug21536",
|
||||
"Perform partition system restart with other nodes with higher GCI"){
|
||||
INITIALIZER(runWaitStarted);
|
||||
INITIALIZER(runClearTable);
|
||||
STEP(runBug21536);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
NDBT_TESTSUITE_END(testSystemRestart);
|
||||
|
||||
int main(int argc, const char** argv){
|
||||
|
|
|
@ -493,6 +493,10 @@ max-time: 1000
|
|||
cmd: testNodeRestart
|
||||
args: -n Bug21271 T6
|
||||
|
||||
max-time: 1000
|
||||
cmd: testIndex
|
||||
args: -n Bug21384
|
||||
|
||||
#
|
||||
# DICT TESTS
|
||||
max-time: 1500
|
||||
|
|
Loading…
Reference in a new issue