From: Jonas Oreland Date: November 14 2011 2:48pm Subject: bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4666 to 4667) List-Archive: http://lists.mysql.com/commits/141937 Message-Id: <20111114144830.0B4991391F@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4667 Jonas Oreland 2011-11-14 ndb - fix bug in previous commit. Clearly separate between log-parts which a specific lqh-instance is responisble for. And the node-global log-part-count modified: storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 4666 Ole John Aske 2011-11-14 Fix: SPJ may leak RowMaps There is a minor memory leak of 'struct RowMap' objects. As the RowMap was only ::init()'ed when Dbspj::releaseNodeRows() has released all the mapped rows, its reference was effectively lost at that point and another RowMap will be allocated if needed ... NOTE: 'leak' in this context is not a true memory leak as all memory is managed within the request and released when ::cleanup() removes all objects related to this request. modified: storage/ndb/src/kernel/blocks/dbspj/DbspjMain.cpp === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-11-14 12:02:56 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-11-14 14:38:07 +0000 @@ -1221,29 +1221,35 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* ndbrequire(p != 0); clogPartFileSize = 4; + + Uint32 nodeLogParts = 4; ndb_mgm_get_int_parameter(p, CFG_DB_NO_REDOLOG_PARTS, - &clogPartFileSize); - globalData.ndbLogParts = clogPartFileSize; - ndbrequire(clogPartFileSize <= NDB_MAX_LOG_PARTS); + &nodeLogParts); + globalData.ndbLogParts = nodeLogParts; + ndbrequire(nodeLogParts <= NDB_MAX_LOG_PARTS); + { + NdbLogPartInfo lpinfo(instance()); + clogPartFileSize = lpinfo.partCount; // How many are this instance responsible for... + } - if (globalData.ndbMtLqhWorkers > clogPartFileSize) + if (globalData.ndbMtLqhWorkers > nodeLogParts) { char buf[255]; BaseString::snprintf(buf, sizeof(buf), "Trying to start %d LQH workers with only %d log parts, try initial" " node restart to be able to use more LQH workers.", - globalData.ndbMtLqhWorkers, clogPartFileSize); + globalData.ndbMtLqhWorkers, nodeLogParts); progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf); } - if (clogPartFileSize != 4 && - clogPartFileSize != 8 && - clogPartFileSize != 16) + if (nodeLogParts != 4 && + nodeLogParts != 8 && + nodeLogParts != 16) { char buf[255]; BaseString::snprintf(buf, sizeof(buf), "Trying to start with %d log parts, number of log parts can" " only be set to 4, 8 or 16.", - clogPartFileSize); + nodeLogParts); progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf); } @@ -15728,7 +15734,7 @@ void Dblqh::initWriteEndLab(Signal* sign /* Set number of log parts used to ensure we use correct number of log parts */ /* at system restart. Was previously hardcoded to 4. */ /*---------------------------------------------------------------------------*/ - logPagePtr.p->logPageWord[ZPOS_NO_LOG_PARTS]= clogPartFileSize; + logPagePtr.p->logPageWord[ZPOS_NO_LOG_PARTS]= globalData.ndbLogParts; logPagePtr.p->logPageWord[ZPOS_LOG_LAP] = 1; logPagePtr.p->logPageWord[ZPOS_MAX_GCI_STARTED] = 0; logPagePtr.p->logPageWord[ZPOS_MAX_GCI_COMPLETED] = 0; @@ -16474,13 +16480,13 @@ void Dblqh::readSrFrontpageLab(Signal* s globalData.ndbMtLqhWorkers, num_parts_used); progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf); } - if (num_parts_used != clogPartFileSize) + if (num_parts_used != globalData.ndbLogParts) { char buf[255]; BaseString::snprintf(buf, sizeof(buf), "Can only change NoOfLogParts through initial node restart, old" " value of NoOfLogParts = %d, tried using %d", - num_parts_used, clogPartFileSize); + num_parts_used, globalData.ndbLogParts); progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf); } No bundle (reason: useless for push emails).