|
|||||||||||
|
Re: bk commit - 4.1 tree (istruewing:1.2630) BUG#26379
From: Ingo Strüwing <ingo(at)mysql.com>
Date: Fri Jul 13 2007 - 12:51:48 EDT
Dmitri Lenev wrote:
>> ChangeSet@1.2630, 2007-05-21 17:48:22+02:00, istruewing@chilla.local +23 -0 >> Bug#26379 - Combination of FLUSH TABLE and REPAIR TABLE corrupts >> a MERGE table I committed an intermediate study for the new open approach: bk commit into 5.1 tree (istruewing:1.2530) BUG#26379 date: 2007-07-13 17:58:57+02:00 This is able to open a merge table successfully. No attempt is made yet to close it, or treat it otherwise. I have a couple of questions. Please see below. > 1) myrg_open(): Done. > 2) ha_myisammrg::extra(): Done. > Also we might need a separate parameter value that will tell I fail to see why this could be necessary. The closing thread won't use the children during close. Other threads have their own instances open. > It is probably a good idea to add asserts which will The way I understood your suggestions, and the way I implemented them, this seems not necessary. The initial open does not allocate any MERGE object. So there is a NULL MYRG_INFO pointer in ha_myisammrg. Attempts to use it will fail anyway. But again I don't see how this could happen at all. Same reason as with close. > 3) open_tables()/close_thread_tables() (tentatively): As you can see from my patch I understood the above so that I should add the children to the table list (next_global) when a merge table is opened, and remove them after the last child has been opened. > During the close_thread_tables() If we want to finally close the MERGE table, we could take a similar approach as with open (add children to open_tables and mark them "old"). But when we want to release the table to the cache for later reuse by the same or another thread, then we must not do the same with the children. The MERGE storage engine holds references to the MyISAM table objects. So we must assure that the same TABLE objects with their MyISAM objects become children of the MERGE table when it is reused. The alternative would be to re-reference the MyISAM tables from the MERGE table every time the MERGE table is reused. We must also repeat the compatibility checks, which are costly. Please advise.
...
IMHO we do not need to change anything here. We took the children off the table list. So lock_tables() won't handle them directly.
...
This may be the appropriate place to raise the question: How to handle MERGE tables when a child is refreshed? In this case we must at least re-reference this child and check its compatibility. If we don't want to over-stress extra(), then we should do this by re-opening the whole MERGE table. Anyway we need to know about the parent-child relationship in the table cache. Unless we re-open the MERGE table on every reuse as I mentioned above. ...
Regards
-- Ingo Strüwing, Senior Software Developer MySQL GmbH, Radlkoferstr. 2, D-81373 München Geschäftsführer: Kaj Arnö - HRB München 162140 -- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived on Fri Jul 13 12:51:58 2007 This archive was generated by hypermail 2.1.8 : Thu Aug 02 2007 - 01:56:11 EDT |
||||||||||
|
|||||||||||