From: Maitrayi Sabaratnam Date: October 31 2012 2:45pm Subject: bzr push into mysql-5.1-telco-6.3 branch (maitrayi.sabaratnam:3492 to 3493) Bug#14798432 List-Archive: http://lists.mysql.com/commits/145130 X-Bug: 14798432 Message-Id: <20121031144512.5830.19438.3493@asator03-z7.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3493 Maitrayi Sabaratnam 2012-10-31 Bug#14798432 - TIMESLICE DUMPING FRAGMENTION INFO WHEN THERE ARE MANY TABLES. modified: storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 3492 Frazer Clement 2012-10-29 Bug #14828998 NDB : SLOW FILESYSTEM CAN CAUSE DIH FILE PAGE EXHAUSTION Limit number of concurrent table definition updates that DIH can issue. This avoids a slow filesystem exerting pressure on DIH File page buffers which can lead to a crash if they're exhausted. Add a testcase showing the crash behaviour using error insert and showing that it fixes the problem. @ storage/ndb/test/ndbapi/testLimits.cpp 'Backport' of testLimits from 7.0. added: storage/ndb/src/kernel/vm/CountingSemaphore.hpp storage/ndb/test/ndbapi/testLimits.cpp modified: storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp storage/ndb/src/kernel/blocks/ERROR_codes.txt storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp storage/ndb/test/ndbapi/Makefile.am storage/ndb/test/run-test/daily-basic-tests.txt === modified file 'storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp' --- a/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2012-10-29 18:34:05 +0000 +++ b/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2012-10-31 09:17:12 +0000 @@ -73,6 +73,7 @@ public: DihDumpNodeRestartInfo = 16, // 16 DIH Dump node restart info DihDumpNodeStatusInfo = 17,// 17 DIH Dump node status info DihPrintFragmentation = 18,// 18 DIH Print fragmentation + DihPrintOneFragmentation = 19,// 18 DIH Print info about one fragmentation // 19 NDBFS Fipple with O_SYNC, O_CREATE etc. // 20-24 BACKUP NdbcntrTestStopOnError = 25, === modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2012-10-29 18:34:05 +0000 +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2012-10-31 09:17:12 +0000 @@ -15851,32 +15851,108 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal }//for }//if - if (arg == DumpStateOrd::DihPrintFragmentation){ - infoEvent("Printing fragmentation of all tables --"); - for(Uint32 i = 0; itabStatus != TabRecord::TS_ACTIVE) - continue; - - for(Uint32 j = 0; j < tabPtr.p->totalfragments; j++){ - FragmentstorePtr fragPtr; - getFragstore(tabPtr.p, j, fragPtr); - - Uint32 nodeOrder[MAX_REPLICAS]; - const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, nodeOrder); - char buf[100]; - BaseString::snprintf(buf, sizeof(buf), " Table %d Fragment %d LP: %u - ", tabPtr.i, j, fragPtr.p->m_log_part_id); - for(Uint32 k = 0; k < noOfReplicas; k++){ - char tmp[100]; - BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); - strcat(buf, tmp); - } - infoEvent(buf); - } + if (arg == DumpStateOrd::DihPrintFragmentation) + { + Uint32 tableid = 0; + Uint32 fragid = 0; + if (signal->getLength() == 1) + { + infoEvent("Printing fragmentation of all tables --"); } + else if (signal->getLength() == 3) + { + jam(); + tableid = dumpState->args[1]; + fragid = dumpState->args[2]; + } + else + { + return; + } + + if (tableid >= ctabFileSize) + { + return; + } + + TabRecordPtr tabPtr; + tabPtr.i = tableid; + ptrCheckGuard(tabPtr, ctabFileSize, tabRecord); + + if (tabPtr.p->tabStatus == TabRecord::TS_ACTIVE && + fragid < tabPtr.p->totalfragments) + { + dumpState->args[0] = DumpStateOrd::DihPrintOneFragmentation; + dumpState->args[1] = tableid; + dumpState->args[2] = fragid; + execDUMP_STATE_ORD(signal); + } + + if (tabPtr.p->tabStatus != TabRecord::TS_ACTIVE || + ++fragid >= tabPtr.p->totalfragments) + { + tableid++; + fragid = 0; + } + + if (tableid < ctabFileSize) + { + dumpState->args[0] = DumpStateOrd::DihPrintFragmentation; + dumpState->args[1] = tableid; + dumpState->args[2] = fragid; + sendSignal(reference(), GSN_DUMP_STATE_ORD, signal, 3, JBB); + } + } + + if (arg == DumpStateOrd::DihPrintOneFragmentation) + { + Uint32 tableid = RNIL; + Uint32 fragid = RNIL; + + if (signal->getLength() == 3) + { + jam(); + tableid = dumpState->args[1]; + fragid = dumpState->args[2]; + } + else + { + return; + } + + if (tableid >= ctabFileSize) + { + return; + } + + TabRecordPtr tabPtr; + tabPtr.i = tableid; + ptrCheckGuard(tabPtr, ctabFileSize, tabRecord); + + if (fragid >= tabPtr.p->totalfragments) + { + return; + } + + FragmentstorePtr fragPtr; + getFragstore(tabPtr.p, fragid, fragPtr); + + Uint32 nodeOrder[MAX_REPLICAS]; + const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, + nodeOrder); + char buf[100]; + BaseString::snprintf(buf, sizeof(buf), + " Table %d Fragment %d LP: %u - ", + tabPtr.i, fragid, + fragPtr.p->m_log_part_id); + + for(Uint32 k = 0; k < noOfReplicas; k++) + { + char tmp[100]; + BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); + strcat(buf, tmp); + } + infoEvent(buf); } if (signal->theData[0] == 7000) { No bundle (reason: useless for push emails).