mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
bug#4586 testSystemRestart -n SR_FULLDB
keep acc from shrinking/expanding when less than one page per fragment is left. This makes ACC not shrink so that one get out of pages during log execution in SR (which crashes badly)
This commit is contained in:
parent
f851b03af5
commit
52f9ee10c5
2 changed files with 27 additions and 20 deletions
|
@ -1564,6 +1564,8 @@ private:
|
|||
|
||||
Uint32 c_errorInsert3000_TableId;
|
||||
Uint32 cSrUndoRecords[5];
|
||||
|
||||
Uint32 c_no_fragment_allocated;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -599,6 +599,7 @@ void Dbacc::ndbrestart1Lab(Signal* signal)
|
|||
for (Uint32 tmp = 0; tmp < ZMAX_UNDO_VERSION; tmp++) {
|
||||
csrVersList[tmp] = RNIL;
|
||||
}//for
|
||||
c_no_fragment_allocated = 0;
|
||||
return;
|
||||
}//Dbacc::ndbrestart1Lab()
|
||||
|
||||
|
@ -1360,6 +1361,8 @@ void Dbacc::releaseDirIndexResources(Signal* signal, FragmentrecPtr regFragPtr)
|
|||
|
||||
void Dbacc::releaseFragRecord(Signal* signal, FragmentrecPtr regFragPtr)
|
||||
{
|
||||
ndbrequire(c_no_fragment_allocated > 0);
|
||||
c_no_fragment_allocated--;
|
||||
regFragPtr.p->nextfreefrag = cfirstfreefrag;
|
||||
cfirstfreefrag = regFragPtr.i;
|
||||
initFragGeneral(regFragPtr);
|
||||
|
@ -6349,6 +6352,18 @@ void Dbacc::execEXPANDCHECK2(Signal* signal)
|
|||
/*--------------------------------------------------------------*/
|
||||
return;
|
||||
}//if
|
||||
if (cfirstfreepage == RNIL) {
|
||||
if ((cfreepage + c_no_fragment_allocated) >= cpagesize) {
|
||||
jam();
|
||||
/*--------------------------------------------------------------*/
|
||||
/* WE HAVE TO STOP THE EXPAND PROCESS SINCE THERE ARE NO FREE */
|
||||
/* PAGES. THIS MEANS THAT WE COULD BE FORCED TO CRASH SINCE WE */
|
||||
/* CANNOT COMPLETE THE EXPAND. TO AVOID THE CRASH WE EXIT HERE. */
|
||||
/*--------------------------------------------------------------*/
|
||||
return;
|
||||
}//if
|
||||
}//if
|
||||
|
||||
if (fragrecptr.p->firstOverflowRec == RNIL) {
|
||||
jam();
|
||||
allocOverflowPage(signal);
|
||||
|
@ -6361,17 +6376,6 @@ void Dbacc::execEXPANDCHECK2(Signal* signal)
|
|||
return;
|
||||
}//if
|
||||
}//if
|
||||
if (cfirstfreepage == RNIL) {
|
||||
if (cfreepage >= cpagesize) {
|
||||
jam();
|
||||
/*--------------------------------------------------------------*/
|
||||
/* WE HAVE TO STOP THE EXPAND PROCESS SINCE THERE ARE NO FREE */
|
||||
/* PAGES. THIS MEANS THAT WE COULD BE FORCED TO CRASH SINCE WE */
|
||||
/* CANNOT COMPLETE THE EXPAND. TO AVOID THE CRASH WE EXIT HERE. */
|
||||
/*--------------------------------------------------------------*/
|
||||
return;
|
||||
}//if
|
||||
}//if
|
||||
if (checkScanExpand(signal) == 1) {
|
||||
jam();
|
||||
/*--------------------------------------------------------------*/
|
||||
|
@ -6933,16 +6937,8 @@ void Dbacc::execSHRINKCHECK2(Signal* signal)
|
|||
}//if
|
||||
}//if
|
||||
}//if
|
||||
if (fragrecptr.p->firstOverflowRec == RNIL) {
|
||||
jam();
|
||||
allocOverflowPage(signal);
|
||||
if (tresult > ZLIMIT_OF_ERROR) {
|
||||
jam();
|
||||
return;
|
||||
}//if
|
||||
}//if
|
||||
if (cfirstfreepage == RNIL) {
|
||||
if (cfreepage >= cpagesize) {
|
||||
if (cfreepage + c_no_fragment_allocated >= cpagesize) {
|
||||
jam();
|
||||
/*--------------------------------------------------------------*/
|
||||
/* WE HAVE TO STOP THE SHRINK PROCESS SINCE THERE ARE NO FREE */
|
||||
|
@ -6952,6 +6948,14 @@ void Dbacc::execSHRINKCHECK2(Signal* signal)
|
|||
return;
|
||||
}//if
|
||||
}//if
|
||||
if (fragrecptr.p->firstOverflowRec == RNIL) {
|
||||
jam();
|
||||
allocOverflowPage(signal);
|
||||
if (tresult > ZLIMIT_OF_ERROR) {
|
||||
jam();
|
||||
return;
|
||||
}//if
|
||||
}//if
|
||||
if (checkScanShrink(signal) == 1) {
|
||||
jam();
|
||||
/*--------------------------------------------------------------*/
|
||||
|
@ -12771,6 +12775,7 @@ void Dbacc::seizeDirrange(Signal* signal)
|
|||
/* --------------------------------------------------------------------------------- */
|
||||
void Dbacc::seizeFragrec(Signal* signal)
|
||||
{
|
||||
c_no_fragment_allocated++;
|
||||
fragrecptr.i = cfirstfreefrag;
|
||||
ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec);
|
||||
cfirstfreefrag = fragrecptr.p->nextfreefrag;
|
||||
|
|
Loading…
Reference in a new issue