3473 Frazer Clement 2012-04-24
Bug #13986128 DUMP LCP RESERVED FRAGMENT SCAN RECORD AS PART OF LCP STATUS DUMP
modified:
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/vm/ArrayPool.hpp
3472 Frazer Clement 2012-04-24
Bug#13966723 MYSQL CLUSTER - CONCURRENT OPERATIONS 'LEAK' RESULTS IN "TOO MANY ACTIVE SCANS"
TC had a bug where a shortage of TC scan fragment records resulted in
a leak of scan table records and key operations.
This is fixed, and a testcase added.
modified:
storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/test/ndbapi/testScan.cpp
storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-10-28 13:49:12 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2012-04-24 15:07:32 +0000
@@ -20843,7 +20843,7 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
ScanRecordPtr sp;
sp.i = recordNo;
- c_scanRecordPool.getPtr(sp);
+ c_scanRecordPool.getPtrIgnoreAlloc(sp);
infoEvent("Dblqh::ScanRecord[%d]: state=%d, type=%d, "
"complStatus=%d, scanNodeId=%d",
sp.i,
@@ -20873,6 +20873,10 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
sp.p->scanTcWaiting,
sp.p->scanTcrec,
sp.p->scanKeyinfoFlag);
+ infoEvent(" LcpScan=%d RowId(%u:%u)",
+ sp.p->lcpScan,
+ sp.p->m_row_id.m_page_no,
+ sp.p->m_row_id.m_page_idx);
return;
}
if(dumpState->args[0] == DumpStateOrd::LqhDumpLcpState){
@@ -20900,6 +20904,28 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
infoEvent(" m_EMPTY_LCP_REQ=%s",
TlcpPtr.p->m_EMPTY_LCP_REQ.getText(buf));
+ if ((signal->length() == 2) &&
+ (dumpState->args[1] == 0))
+ {
+ /* Dump reserved LCP scan rec */
+ /* As there's only one, we'll do a tight loop here */
+ infoEvent(" dumping reserved scan records");
+ for (Uint32 rec=0; rec < cscanrecFileSize; rec++)
+ {
+ ScanRecordPtr sp;
+ sp.i = rec;
+ c_scanRecordPool.getPtrIgnoreAlloc(sp);
+
+ if (sp.p->m_reserved &&
+ sp.p->lcpScan)
+ {
+ dumpState->args[0] = DumpStateOrd::LqhDumpOneScanRec;
+ dumpState->args[1] = rec;
+ execDUMP_STATE_ORD(signal);
+ }
+ }
+ }
+
return;
}
=== modified file 'storage/ndb/src/kernel/vm/ArrayPool.hpp'
--- a/storage/ndb/src/kernel/vm/ArrayPool.hpp 2011-06-30 15:55:35 +0000
+++ b/storage/ndb/src/kernel/vm/ArrayPool.hpp 2012-04-24 15:07:32 +0000
@@ -66,6 +66,7 @@ public:
void getPtr(ConstPtr<T> &) const;
void getPtr(Ptr<T> &, bool CrashOnBoundaryError);
void getPtr(ConstPtr<T> &, bool CrashOnBoundaryError) const;
+ void getPtrIgnoreAlloc(Ptr<T> &);
/**
* Get pointer for i value
@@ -608,6 +609,26 @@ ArrayPool<T>::getConstPtr(Uint32 i, bool
return 0;
}
}
+
+/**
+ getPtrIgnoreAlloc
+
+ getPtr, without array_guard /theAllocatedBitmask checks
+ Useful when looking at elements in the pool which may or may not
+ be allocated.
+ Retains the range check.
+*/
+template <class T>
+inline
+void
+ArrayPool<T>::getPtrIgnoreAlloc(Ptr<T> & ptr){
+ Uint32 i = ptr.i;
+ if(likely (i < size)){
+ ptr.p = &theArray[i];
+ } else {
+ ErrorReporter::handleAssert("ArrayPool<T>::getPtr", __FILE__, __LINE__);
+ }
+}
/**
* Allocate an object from pool - update Ptr
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-6.3 branch (frazer.clement:3472 to 3473)Bug#13986128 | Frazer Clement | 25 Apr |