ndb - bug#21710

  fix bug in drop_file during pageout (LCP)
parent 7e9b2ef9
...@@ -442,13 +442,15 @@ Pgman::release_page_entry(Ptr<Page_entry>& ptr) ...@@ -442,13 +442,15 @@ Pgman::release_page_entry(Ptr<Page_entry>& ptr)
#endif #endif
Page_state state = ptr.p->m_state; Page_state state = ptr.p->m_state;
ndbrequire(! (state & Page_entry::REQUEST));
ndbrequire(ptr.p->m_requests.isEmpty()); ndbrequire(ptr.p->m_requests.isEmpty());
ndbrequire(! (state & Page_entry::ONSTACK)); ndbrequire(! (state & Page_entry::ONSTACK));
ndbrequire(! (state & Page_entry::ONQUEUE)); ndbrequire(! (state & Page_entry::ONQUEUE));
ndbrequire(ptr.p->m_real_page_i == RNIL); ndbrequire(ptr.p->m_real_page_i == RNIL);
if (! (state & Page_entry::LOCKED))
ndbrequire(! (state & Page_entry::REQUEST));
set_page_state(ptr, 0); set_page_state(ptr, 0);
m_page_hashlist.remove(ptr); m_page_hashlist.remove(ptr);
m_page_entry_pool.release(ptr); m_page_entry_pool.release(ptr);
...@@ -1476,7 +1478,7 @@ Pgman::fsreadreq(Signal* signal, Ptr<Page_entry> ptr) ...@@ -1476,7 +1478,7 @@ Pgman::fsreadreq(Signal* signal, Ptr<Page_entry> ptr)
FsReadWriteReq::fsFormatGlobalPage); FsReadWriteReq::fsFormatGlobalPage);
req->data.pageData[0] = ptr.p->m_real_page_i; req->data.pageData[0] = ptr.p->m_real_page_i;
sendSignal(NDBFS_REF, GSN_FSREADREQ, signal, sendSignal(NDBFS_REF, GSN_FSREADREQ, signal,
FsReadWriteReq::FixedLength + 1, JBB); FsReadWriteReq::FixedLength + 1, JBA);
} }
void void
...@@ -1518,8 +1520,19 @@ Pgman::fswritereq(Signal* signal, Ptr<Page_entry> ptr) ...@@ -1518,8 +1520,19 @@ Pgman::fswritereq(Signal* signal, Ptr<Page_entry> ptr)
FsReadWriteReq::setFormatFlag(req->operationFlag, FsReadWriteReq::setFormatFlag(req->operationFlag,
FsReadWriteReq::fsFormatGlobalPage); FsReadWriteReq::fsFormatGlobalPage);
req->data.pageData[0] = ptr.p->m_real_page_i; req->data.pageData[0] = ptr.p->m_real_page_i;
#if ERROR_INSERT_CODE
if (ptr.p->m_state & Page_entry::LOCKED)
{
sendSignalWithDelay(NDBFS_REF, GSN_FSWRITEREQ, signal,
3000, FsReadWriteReq::FixedLength + 1);
ndbout_c("pageout locked (3s)");
return;
}
#endif
sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal,
FsReadWriteReq::FixedLength + 1, JBB); FsReadWriteReq::FixedLength + 1, JBA);
} }
void void
...@@ -1635,8 +1648,8 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req) ...@@ -1635,8 +1648,8 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req)
return ptr.p->m_real_page_i; return ptr.p->m_real_page_i;
} }
} }
if (! (req_flags & Page_request::LOCK_PAGE)) if (! (req_flags & (Page_request::LOCK_PAGE | Page_request::UNLOCK_PAGE)))
{ {
ndbrequire(! (state & Page_entry::LOCKED)); ndbrequire(! (state & Page_entry::LOCKED));
} }
...@@ -1675,7 +1688,7 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req) ...@@ -1675,7 +1688,7 @@ Pgman::get_page(Signal* signal, Ptr<Page_entry> ptr, Page_request page_req)
if (req_flags & Page_request::UNLOCK_PAGE) if (req_flags & Page_request::UNLOCK_PAGE)
{ {
state &= ~ Page_entry::LOCKED; // keep it locked
} }
ptr.p->m_busy_count += busy_count; ptr.p->m_busy_count += busy_count;
......
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