From: Date: March 3 2006 7:16pm Subject: bk commit into 5.1 tree (jonas:1.2218) BUG#16386 List-Archive: http://lists.mysql.com/commits/3440 X-Bug: 16386 Message-Id: <20060303181631.2F71E2DEC3F@eel> 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 1.2218 06/03/03 19:16:24 jonas@eel.(none) +2 -0 ndb dd - bug#16386 Use shared pool for logfile group/undofiles in lgman storage/ndb/src/kernel/blocks/lgman.hpp 1.8 06/03/03 19:16:19 jonas@eel.(none) +18 -7 Use shared pool for logfile group/undofiles in lgman storage/ndb/src/kernel/blocks/lgman.cpp 1.17 06/03/03 19:16:19 jonas@eel.(none) +27 -26 Use shared pool for logfile group/undofiles in lgman # 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: eel.(none) # Root: /home/jonas/src/51-ndb --- 1.16/storage/ndb/src/kernel/blocks/lgman.cpp 2006-03-02 16:44:09 +01:00 +++ 1.17/storage/ndb/src/kernel/blocks/lgman.cpp 2006-03-03 19:16:19 +01:00 @@ -93,10 +93,7 @@ addRecSignal(GSN_GET_TABINFOREQ, &Lgman::execGET_TABINFOREQ); m_last_lsn = 1; - m_logfile_group_pool.setSize(10); m_logfile_group_hash.setSize(10); - m_file_pool.setSize(10); - m_data_buffer_pool.setSize(10); } Lgman::~Lgman() @@ -122,6 +119,9 @@ Pool_context pc; pc.m_block = this; m_log_waiter_pool.wo_pool_init(RT_LGMAN_LOG_WAITER, pc); + m_file_pool.init(RT_LGMAN_FILE, pc); + m_logfile_group_pool.init(RT_LGMAN_FILEGROUP, pc); + m_data_buffer_pool.setSize(10); ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend(); conf->senderRef = reference(); @@ -438,7 +438,7 @@ ndbrequire(ptr.p->m_meta_files.isEmpty()); ndbrequire(ptr.p->m_outstanding_fs == 0); - LocalDLFifoList list(m_file_pool, ptr.p->m_files); + Local_undofile_list list(m_file_pool, ptr.p->m_files); Ptr file_ptr; if (list.first(file_ptr)) @@ -529,7 +529,8 @@ } new (file_ptr.p) Undofile(req, ptr.i); - LocalDLFifoList tmp(m_file_pool, ptr.p->m_meta_files); + + Local_undofile_list tmp(m_file_pool, ptr.p->m_meta_files); tmp.add(file_ptr); open_file(signal, file_ptr, req->requestInfo); @@ -649,7 +650,7 @@ CreateFileImplRef::SignalLength, JBB); } - LocalDLFifoList meta(m_file_pool, lg_ptr.p->m_meta_files); + Local_undofile_list meta(m_file_pool, lg_ptr.p->m_meta_files); meta.release(ptr); } @@ -683,9 +684,9 @@ bool Lgman::find_file_by_id(Ptr& ptr, - DLFifoList::Head& head, Uint32 id) + Local_undofile_list::Head& head, Uint32 id) { - LocalDLFifoList list(m_file_pool, head); + Local_undofile_list list(m_file_pool, head); for(list.first(ptr); !ptr.isNull(); list.next(ptr)) if(ptr.p->m_file_id == id) return true; @@ -704,8 +705,8 @@ if(ptr.p->m_state == Undofile::FS_CREATING) { jam(); - LocalDLFifoList free(m_file_pool, lg_ptr.p->m_files); - LocalDLFifoList meta(m_file_pool, lg_ptr.p->m_meta_files); + Local_undofile_list free(m_file_pool, lg_ptr.p->m_files); + Local_undofile_list meta(m_file_pool, lg_ptr.p->m_meta_files); first= free.isEmpty(); meta.remove(ptr); if(!first) @@ -812,7 +813,7 @@ { jam(); { - LocalDLFifoList list(m_file_pool, lg_ptr.p->m_files); + Local_undofile_list list(m_file_pool, lg_ptr.p->m_files); list.release(ptr); } drop_filegroup_drop_files(signal, lg_ptr, senderRef, senderData); @@ -820,7 +821,7 @@ else { jam(); - LocalDLFifoList list(m_file_pool, lg_ptr.p->m_meta_files); + Local_undofile_list list(m_file_pool, lg_ptr.p->m_meta_files); list.release(ptr); CreateFileImplConf* conf= (CreateFileImplConf*)signal->getDataPtr(); @@ -967,7 +968,7 @@ { Ptr file; m_file_pool.getPtr(file, head.m_ptr_i); - LocalDLFifoList list(m_file_pool, ptr.p->m_files); + Local_undofile_list list(m_file_pool, ptr.p->m_files); do { @@ -1632,7 +1633,7 @@ ptr.p->m_last_sync_req_lsn = lsn; // And logfile_group Ptr next = filePtr; - LocalDLFifoList files(m_file_pool, ptr.p->m_files); + Local_undofile_list files(m_file_pool, ptr.p->m_files); if(!files.next(next)) { jam(); @@ -1683,7 +1684,7 @@ Uint32 tot= 0; Uint64 lsn = 0; { - LocalDLFifoList files(m_file_pool, lg_ptr.p->m_files); + Local_undofile_list files(m_file_pool, lg_ptr.p->m_files); while(cnt && ! (ptr.p->m_state & Undofile::FS_OUTSTANDING)) { Uint32 state= ptr.p->m_state; @@ -1888,7 +1889,7 @@ ptr.p->m_free_file_words += free * File_formats::UNDO_PAGE_WORDS; Ptr next = filePtr; - LocalDLFifoList files(m_file_pool, ptr.p->m_files); + Local_undofile_list files(m_file_pool, ptr.p->m_files); while(files.next(next) && (next.p->m_state & Undofile::FS_EMPTY)) ndbrequire(next.i != filePtr.i); if(next.isNull()) @@ -2083,7 +2084,7 @@ /** * Read first page from each undofile (1 file at a time...) */ - LocalDLFifoList files(m_file_pool, ptr.p->m_meta_files); + Local_undofile_list files(m_file_pool, ptr.p->m_meta_files); Ptr file_ptr; files.first(file_ptr); @@ -2120,7 +2121,7 @@ * and m_files is sorted acording to lsn */ ndbrequire(!ptr.p->m_files.isEmpty()); - LocalDLFifoList read_files(m_file_pool, ptr.p->m_files); + Local_undofile_list read_files(m_file_pool, ptr.p->m_files); read_files.last(file_ptr); @@ -2181,7 +2182,7 @@ if(lg_ptr.p->m_next_reply_ptr_i == ptr.i) { Uint32 tot= 0; - LocalDLFifoList files(m_file_pool, lg_ptr.p->m_files); + Local_undofile_list files(m_file_pool, lg_ptr.p->m_files); while(cnt && ! (ptr.p->m_state & Undofile::FS_OUTSTANDING)) { Uint32 state= ptr.p->m_state; @@ -2245,8 +2246,8 @@ * Insert into m_files */ { - LocalDLFifoList meta(m_file_pool, lg_ptr.p->m_meta_files); - LocalDLFifoList files(m_file_pool, lg_ptr.p->m_files); + Local_undofile_list meta(m_file_pool, lg_ptr.p->m_meta_files); + Local_undofile_list files(m_file_pool, lg_ptr.p->m_files); meta.remove(ptr); Ptr loop; @@ -2370,7 +2371,7 @@ ptr.p->m_next_reply_ptr_i = file_ptr.i; { - LocalDLFifoList files(m_file_pool, ptr.p->m_files); + Local_undofile_list files(m_file_pool, ptr.p->m_files); if(tail == 1) { /** @@ -2423,8 +2424,8 @@ * Perform initial sorting of logfile groups */ Ptr group; - DLFifoList& list= m_logfile_group_list; - DLFifoList tmp(m_logfile_group_pool); + Logfile_group_list& list= m_logfile_group_list; + Logfile_group_list tmp(m_logfile_group_pool); list.first(group); while(!group.isNull()) @@ -2632,7 +2633,7 @@ Ptr prev = filePtr; { - LocalDLFifoList files(m_file_pool, ptr.p->m_files); + Local_undofile_list files(m_file_pool, ptr.p->m_files); if(!files.prev(prev)) { jam(); @@ -2892,7 +2893,7 @@ if(pages >= diff) { pages -= diff; - LocalDLFifoList files(m_file_pool, ptr.p->m_files); + Local_undofile_list files(m_file_pool, ptr.p->m_files); if(!files.next(file)) files.first(file); tail.m_idx = 1; --- 1.7/storage/ndb/src/kernel/blocks/lgman.hpp 2006-03-01 10:18:56 +01:00 +++ 1.8/storage/ndb/src/kernel/blocks/lgman.hpp 2006-03-03 19:16:19 +01:00 @@ -99,6 +99,7 @@ Undofile(){} Undofile(const struct CreateFileImplReq*, Uint32 lg_ptr_i); + Uint32 m_magic; Uint32 m_file_id; // Dict obj id Uint32 m_logfile_group_ptr_i; @@ -140,6 +141,9 @@ }; }; + typedef RecordPool Undofile_pool; + typedef DLFifoListImpl Undofile_list; + typedef LocalDLFifoListImpl Local_undofile_list; typedef LocalDataBuffer<15> Page_map; struct Buffer_idx @@ -156,6 +160,7 @@ Logfile_group(){} Logfile_group(const struct CreateFilegroupImplReq*); + Uint32 m_magic; union { Uint32 key; Uint32 m_logfile_group_id; @@ -200,8 +205,8 @@ Buffer_idx m_file_pos[2]; // 0 tail, 1 head = { file_ptr_i, page_no } Uint64 m_free_file_words; // Free words in logfile group - DLFifoList::Head m_files; // Files in log - DLFifoList::Head m_meta_files;// Files being created or dropped + Undofile_list::Head m_files; // Files in log + Undofile_list::Head m_meta_files;// Files being created or dropped Uint32 m_free_buffer_words; // Free buffer page words Log_waiter_list::Head m_log_buffer_waiters; @@ -226,6 +231,11 @@ } }; + typedef RecordPool Logfile_group_pool; + typedef DLFifoListImpl Logfile_group_list; + typedef LocalDLFifoListImpl Local_logfile_group_list; + typedef KeyTableImpl Logfile_group_hash; + /** * Alloc/free space in log * Alloction will be removed at either/or @@ -237,16 +247,17 @@ private: friend class Logfile_client; - ArrayPool m_file_pool; - ArrayPool m_logfile_group_pool; + + Undofile_pool m_file_pool; + Logfile_group_pool m_logfile_group_pool; Log_waiter_pool m_log_waiter_pool; Page_map::DataBufferPool m_data_buffer_pool; Uint64 m_last_lsn; Uint32 m_latest_lcp; - DLFifoList m_logfile_group_list; - KeyTable m_logfile_group_hash; + Logfile_group_list m_logfile_group_list; + Logfile_group_hash m_logfile_group_hash; bool alloc_logbuffer_memory(Ptr, Uint32 pages); void init_logbuffer_pointers(Ptr); @@ -280,7 +291,7 @@ void stop_run_undo_log(Signal* signal); void init_tail_ptr(Signal* signal, Ptr ptr); - bool find_file_by_id(Ptr&, DLFifoList::Head&, Uint32 id); + bool find_file_by_id(Ptr&, Undofile_list::Head&, Uint32 id); void create_file_commit(Signal* signal, Ptr, Ptr); void create_file_abort(Signal* signal, Ptr, Ptr);