Commit 10d2d900 authored by unknown's avatar unknown

Bug #27205 Occational 899 if delete+insert during LCP

- put page of deleted row last in list

parent 3854e643
No related merge requests found
...@@ -610,7 +610,7 @@ struct Fragrecord { ...@@ -610,7 +610,7 @@ struct Fragrecord {
Uint32 noOfPagesToGrow; Uint32 noOfPagesToGrow;
DLList<Page>::Head emptyPrimPage; // allocated pages (not init) DLList<Page>::Head emptyPrimPage; // allocated pages (not init)
DLList<Page>::Head thFreeFirst; // pages with atleast 1 free record DLFifoList<Page>::Head thFreeFirst; // pages with atleast 1 free record
SLList<Page>::Head m_empty_pages; // Empty pages not in logical/physical map SLList<Page>::Head m_empty_pages; // Empty pages not in logical/physical map
Uint32 m_lcp_scan_op; Uint32 m_lcp_scan_op;
......
...@@ -92,8 +92,8 @@ Dbtup::alloc_fix_rec(Fragrecord* const regFragPtr, ...@@ -92,8 +92,8 @@ Dbtup::alloc_fix_rec(Fragrecord* const regFragPtr,
pagePtr.p->page_state = ZTH_MM_FREE; pagePtr.p->page_state = ZTH_MM_FREE;
LocalDLList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst); LocalDLFifoList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst);
free_pages.add(pagePtr); free_pages.addFirst(pagePtr);
} else { } else {
ljam(); ljam();
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
...@@ -176,7 +176,7 @@ Dbtup::alloc_tuple_from_page(Fragrecord* const regFragPtr, ...@@ -176,7 +176,7 @@ Dbtup::alloc_tuple_from_page(Fragrecord* const regFragPtr,
/* ARE MAINTAINED EVEN AFTER A SYSTEM CRASH. */ /* ARE MAINTAINED EVEN AFTER A SYSTEM CRASH. */
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
ndbrequire(regPagePtr->page_state == ZTH_MM_FREE); ndbrequire(regPagePtr->page_state == ZTH_MM_FREE);
LocalDLList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst); LocalDLFifoList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst);
free_pages.remove((Page*)regPagePtr); free_pages.remove((Page*)regPagePtr);
regPagePtr->page_state = ZTH_MM_FULL; regPagePtr->page_state = ZTH_MM_FULL;
} }
...@@ -196,10 +196,10 @@ void Dbtup::free_fix_rec(Fragrecord* regFragPtr, ...@@ -196,10 +196,10 @@ void Dbtup::free_fix_rec(Fragrecord* regFragPtr,
{ {
ljam(); ljam();
PagePtr pagePtr = { (Page*)regPagePtr, key->m_page_no }; PagePtr pagePtr = { (Page*)regPagePtr, key->m_page_no };
LocalDLList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst); LocalDLFifoList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst);
ndbrequire(regPagePtr->page_state == ZTH_MM_FULL); ndbrequire(regPagePtr->page_state == ZTH_MM_FULL);
regPagePtr->page_state = ZTH_MM_FREE; regPagePtr->page_state = ZTH_MM_FREE;
free_pages.add(pagePtr); free_pages.addLast(pagePtr);
} }
}//Dbtup::freeTh() }//Dbtup::freeTh()
...@@ -227,13 +227,13 @@ Dbtup::alloc_page(Tablerec* tabPtrP, Fragrecord* fragPtrP, ...@@ -227,13 +227,13 @@ Dbtup::alloc_page(Tablerec* tabPtrP, Fragrecord* fragPtrP,
c_page_pool.getPtr(pagePtr, getRealpid(fragPtrP, page_no)); c_page_pool.getPtr(pagePtr, getRealpid(fragPtrP, page_no));
LocalDLList<Page> alloc_pages(c_page_pool, fragPtrP->emptyPrimPage); LocalDLList<Page> alloc_pages(c_page_pool, fragPtrP->emptyPrimPage);
LocalDLList<Page> free_pages(c_page_pool, fragPtrP->thFreeFirst); LocalDLFifoList<Page> free_pages(c_page_pool, fragPtrP->thFreeFirst);
if (pagePtr.p->page_state == ZEMPTY_MM) if (pagePtr.p->page_state == ZEMPTY_MM)
{ {
convertThPage((Fix_page*)pagePtr.p, tabPtrP, MM); convertThPage((Fix_page*)pagePtr.p, tabPtrP, MM);
pagePtr.p->page_state = ZTH_MM_FREE; pagePtr.p->page_state = ZTH_MM_FREE;
alloc_pages.remove(pagePtr); alloc_pages.remove(pagePtr);
free_pages.add(pagePtr); free_pages.addFirst(pagePtr);
} }
*ret = pagePtr; *ret = pagePtr;
...@@ -257,7 +257,7 @@ Dbtup::alloc_fix_rowid(Fragrecord* regFragPtr, ...@@ -257,7 +257,7 @@ Dbtup::alloc_fix_rowid(Fragrecord* regFragPtr,
} }
Uint32 state = pagePtr.p->page_state; Uint32 state = pagePtr.p->page_state;
LocalDLList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst); LocalDLFifoList<Page> free_pages(c_page_pool, regFragPtr->thFreeFirst);
switch(state){ switch(state){
case ZTH_MM_FREE: case ZTH_MM_FREE:
if (((Fix_page*)pagePtr.p)->alloc_record(idx) != idx) if (((Fix_page*)pagePtr.p)->alloc_record(idx) != idx)
......
...@@ -295,7 +295,7 @@ void Dbtup::releaseFragPages(Fragrecord* regFragPtr) ...@@ -295,7 +295,7 @@ void Dbtup::releaseFragPages(Fragrecord* regFragPtr)
} }
{ {
LocalDLList<Page> tmp(c_page_pool, regFragPtr->thFreeFirst); LocalDLFifoList<Page> tmp(c_page_pool, regFragPtr->thFreeFirst);
tmp.remove(); tmp.remove();
} }
......
...@@ -62,8 +62,9 @@ public: ...@@ -62,8 +62,9 @@ public:
*/ */
void insert(Ptr<T> & ptr, Ptr<T>& loc); void insert(Ptr<T> & ptr, Ptr<T>& loc);
void remove();
void remove(Ptr<T> &); void remove(Ptr<T> &);
void remove(T*);
/** /**
* Update i & p value according to <b>i</b> * Update i & p value according to <b>i</b>
*/ */
...@@ -274,12 +275,28 @@ DLFifoListImpl<P,T,U>::insert(Ptr<T> & ptr, Ptr<T> & loc) ...@@ -274,12 +275,28 @@ DLFifoListImpl<P,T,U>::insert(Ptr<T> & ptr, Ptr<T> & loc)
ptr.p->U::nextList = loc.i; ptr.p->U::nextList = loc.i;
} }
template <typename P, typename T, typename U>
inline
void
DLFifoListImpl<P,T,U>::remove()
{
head.firstItem = RNIL;
head.lastItem = RNIL;
}
template <typename P, typename T, typename U> template <typename P, typename T, typename U>
inline inline
void void
DLFifoListImpl<P,T,U>::remove(Ptr<T> & p) DLFifoListImpl<P,T,U>::remove(Ptr<T> & p)
{ {
T * t = p.p; remove(p.p);
}
template <typename P, typename T, typename U>
inline
void
DLFifoListImpl<P,T,U>::remove(T * t)
{
Uint32 ni = t->U::nextList; Uint32 ni = t->U::nextList;
Uint32 pi = t->U::prevList; Uint32 pi = t->U::prevList;
...@@ -328,7 +345,7 @@ inline ...@@ -328,7 +345,7 @@ inline
void void
DLFifoListImpl<P,T,U>::release(Ptr<T> & p) DLFifoListImpl<P,T,U>::release(Ptr<T> & p)
{ {
remove(p); remove(p.p);
thePool.release(p); thePool.release(p);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment