From: Date: May 14 2007 10:34am Subject: bk commit into 5.1 tree (jonas:1.2477) BUG#28348 List-Archive: http://lists.mysql.com/commits/26570 X-Bug: 28348 Message-Id: <20070514083427.021114DA74@perch.ndb.mysql.com> Below is the list of changes that have just been committed into a local 5.1 repository of jonas. When jonas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-05-14 10:34:21+02:00, jonas@stripped +4 -0 ndb - bug#28348 remove LCP files when dropping table storage/ndb/include/kernel/signaldata/FsOpenReq.hpp@stripped, 2007-05-14 10:34:20+02:00, jonas@stripped +2 -0 add tup as user (for fsremove) storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2007-05-14 10:34:20+02:00, jonas@stripped +10 -1 add remove LCP stuff storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-05-14 10:34:20+02:00, jonas@stripped +4 -0 add remove LCP stuff storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp@stripped, 2007-05-14 10:34:20+02:00, jonas@stripped +87 -0 remove each LCP file regardless if present or not # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jonas # Host: perch.ndb.mysql.com # Root: /home/jonas/src/51-telco-gca --- 1.8/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp 2007-05-14 10:34:26 +02:00 +++ 1.9/storage/ndb/include/kernel/signaldata/FsOpenReq.hpp 2007-05-14 10:34:26 +02:00 @@ -44,6 +44,8 @@ friend class Restore; friend class Dblqh; + friend class Dbtup; + /** * For printing */ --- 1.61/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2007-05-14 10:34:26 +02:00 +++ 1.62/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2007-05-14 10:34:26 +02:00 @@ -972,6 +972,8 @@ struct { Uint32 tabUserPtr; Uint32 tabUserRef; + Uint32 m_lcpno; + Uint32 m_fragPtrI; } m_dropTable; State tableStatus; }; @@ -1533,6 +1535,11 @@ void execACCKEYREF(Signal* signal); void execACC_ABORTCONF(Signal* signal); + + // Drop table + void execFSREMOVEREF(Signal*); + void execFSREMOVECONF(Signal*); + //------------------------------------------------------------------ //------------------------------------------------------------------ // Methods to handle execution of TUPKEYREQ + ATTRINFO. @@ -2423,7 +2430,9 @@ void drop_fragment_free_extent_log_buffer_callback(Signal*, Uint32, Uint32); void drop_fragment_unmap_pages(Signal*, TablerecPtr, FragrecordPtr, Uint32); void drop_fragment_unmap_page_callback(Signal* signal, Uint32, Uint32); - + void drop_fragment_fsremove(Signal*, TablerecPtr, FragrecordPtr); + void drop_fragment_fsremove_done(Signal*, TablerecPtr, FragrecordPtr); + // Initialisation void initData(); void initRecords(); --- 1.37/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2007-05-14 10:34:26 +02:00 +++ 1.38/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2007-05-14 10:34:26 +02:00 @@ -102,6 +102,10 @@ addRecSignal(GSN_ACCKEYREF, &Dbtup::execACCKEYREF); addRecSignal(GSN_ACC_ABORTCONF, &Dbtup::execACC_ABORTCONF); + // Drop table + addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF, true); + addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF, true); + attrbufrec = 0; fragoperrec = 0; fragrecord = 0; --- 1.36/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp 2007-05-14 10:34:26 +02:00 +++ 1.37/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp 2007-05-14 10:34:26 +02:00 @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1282,6 +1283,24 @@ sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB); return; } + + /** + * Remove LCP's for fragment + */ + tabPtr.p->m_dropTable.m_lcpno = 0; + tabPtr.p->m_dropTable.m_fragPtrI = fragPtr.i; + drop_fragment_fsremove(signal, tabPtr, fragPtr); +} + +void +Dbtup::drop_fragment_fsremove_done(Signal* signal, + TablerecPtr tabPtr, + FragrecordPtr fragPtr) +{ + /** + * LCP's removed... + * now continue with "next" + */ Uint32 logfile_group_id = fragPtr.p->m_logfile_group_id ; releaseFragPages(fragPtr.p); Uint32 i; @@ -1300,6 +1319,74 @@ sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB); return; } + +// Remove LCP + +void +Dbtup::drop_fragment_fsremove(Signal* signal, + TablerecPtr tabPtr, + FragrecordPtr fragPtr) +{ + FsRemoveReq* req = (FsRemoveReq*)signal->getDataPtrSend(); + req->userReference = reference(); + req->userPointer = tabPtr.i; + req->directory = 0; + req->ownDirectory = 0; + + Uint32 lcpno = tabPtr.p->m_dropTable.m_lcpno; + Uint32 fragId = fragPtr.p->fragmentId; + Uint32 tableId = fragPtr.p->fragTableId; + + FsOpenReq::setVersion(req->fileNumber, 5); + FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA); + FsOpenReq::v5_setLcpNo(req->fileNumber, lcpno); + FsOpenReq::v5_setTableId(req->fileNumber, tableId); + FsOpenReq::v5_setFragmentId(req->fileNumber, fragId); + sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal, + FsRemoveReq::SignalLength, JBB); +} + +void +Dbtup::execFSREMOVEREF(Signal* signal) +{ + jamEntry(); + FsRef* ref = (FsRef*)signal->getDataPtr(); + Uint32 userPointer = ref->userPointer; + FsConf* conf = (FsConf*)signal->getDataPtrSend(); + conf->userPointer = userPointer; + execFSREMOVECONF(signal); +} + +void +Dbtup::execFSREMOVECONF(Signal* signal) +{ + jamEntry(); + FsConf* conf = (FsConf*)signal->getDataPtrSend(); + + TablerecPtr tabPtr; + FragrecordPtr fragPtr; + + tabPtr.i = conf->userPointer; + ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec); + + ndbrequire(tabPtr.p->tableStatus == DROPPING); + + fragPtr.i = tabPtr.p->m_dropTable.m_fragPtrI; + ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); + + tabPtr.p->m_dropTable.m_lcpno++; + if (tabPtr.p->m_dropTable.m_lcpno < 3) + { + jam(); + drop_fragment_fsremove(signal, tabPtr, fragPtr); + } + else + { + jam(); + drop_fragment_fsremove_done(signal, tabPtr, fragPtr); + } +} +// End remove LCP void Dbtup::start_restore_lcp(Uint32 tableId, Uint32 fragId)