MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jonas Date:March 3 2006 5:29pm
Subject:bk commit into 5.1 tree (jonas:1.2217) BUG#16913
View as plain text  
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.2217 06/03/03 18:29:47 jonas@eel.(none) +2 -0
  ndb dd - bug#16913
    Use shared pool for tablespaces/datafiles in tsman

  storage/ndb/src/kernel/blocks/tsman.hpp
    1.6 06/03/03 18:29:42 jonas@eel.(none) +22 -10
    Use shared pool for tablespaces/datafiles in tsman

  storage/ndb/src/kernel/blocks/tsman.cpp
    1.10 06/03/03 18:29:42 jonas@eel.(none) +30 -26
    Use shared pool for tablespaces/datafiles in tsman

# 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.9/storage/ndb/src/kernel/blocks/tsman.cpp	2006-02-15 13:20:12 +01:00
+++ 1.10/storage/ndb/src/kernel/blocks/tsman.cpp	2006-03-03 18:29:42 +01:00
@@ -83,9 +83,7 @@
 
   addRecSignal(GSN_GET_TABINFOREQ, &Tsman::execGET_TABINFOREQ);
 
-  m_tablespace_pool.setSize(10);
   m_tablespace_hash.setSize(10);
-  m_file_pool.setSize(10);
   m_file_hash.setSize(10);
 }
   
@@ -109,6 +107,12 @@
     m_ctx.m_config.getOwnConfigIterator();
   ndbrequire(p != 0);
 
+  Pool_context pc;
+  pc.m_block = this;
+
+  m_file_pool.init(RT_TSMAN_FILE, pc);
+  m_tablespace_pool.init(RT_TSMAN_FILEGROUP, pc);
+
   ReadConfigConf * conf = (ReadConfigConf*)signal->getDataPtrSend();
   conf->senderRef = reference();
   conf->senderData = senderData;
@@ -431,10 +435,10 @@
 
 bool 
 Tsman::find_file_by_id(Ptr<Datafile>& ptr, 
-		       DLList<Datafile>::Head& head, 
+		       Datafile_list::Head& head, 
 		       Uint32 id)
 {
-  LocalDLList<Datafile> list(m_file_pool, head);
+  Local_datafile_list list(m_file_pool, head);
   for(list.first(ptr); !ptr.isNull(); list.next(ptr))
     if(ptr.p->m_file_id == id)
       return true;
@@ -522,7 +526,7 @@
     }
     
     new (file_ptr.p) Datafile(req);
-    LocalDLList<Datafile> tmp(m_file_pool, ptr.p->m_meta_files);
+    Local_datafile_list tmp(m_file_pool, ptr.p->m_meta_files);
     tmp.add(file_ptr);
 
     file_ptr.p->m_state = Datafile::FS_CREATING;
@@ -649,7 +653,7 @@
   
   {
     m_tablespace_pool.getPtr(lg_ptr, ptr.p->m_tablespace_ptr_i);
-    LocalDLList<Datafile> list(m_file_pool, lg_ptr.p->m_meta_files);
+    Local_datafile_list list(m_file_pool, lg_ptr.p->m_meta_files);
     list.release(ptr);
   }
 }
@@ -833,7 +837,7 @@
   sendSignal(ptr.p->m_create.m_senderRef, GSN_CREATE_FILE_REF, signal, 
 	     CreateFileImplRef::SignalLength, JBB);
   
-  LocalDLList<Datafile> meta(m_file_pool, lg_ptr.p->m_meta_files);
+  Local_datafile_list meta(m_file_pool, lg_ptr.p->m_meta_files);
   meta.release(ptr);
 }
 
@@ -1104,8 +1108,8 @@
       (getNodeState().getNodeRestartInProgress() &&
        getNodeState().starting.restartType == NodeState::ST_INITIAL_NODE_RESTART))
   {
-    LocalDLList<Datafile> free(m_file_pool, ts_ptr.p->m_free_files);
-    LocalDLList<Datafile> meta(m_file_pool, ts_ptr.p->m_meta_files);
+    Local_datafile_list free(m_file_pool, ts_ptr.p->m_free_files);
+    Local_datafile_list meta(m_file_pool, ts_ptr.p->m_meta_files);
     meta.remove(ptr);
     free.add(ptr);
   }
@@ -1144,7 +1148,7 @@
 
   Ptr<Datafile> file_ptr;
   {
-    LocalDLList<Datafile> meta(m_file_pool, lg_ptr.p->m_meta_files);
+    Local_datafile_list meta(m_file_pool, lg_ptr.p->m_meta_files);
     meta.first(file_ptr);
   }
 
@@ -1249,18 +1253,18 @@
   }
   ptr.p->m_online.m_first_free_extent= firstFree;
   
-  LocalDLList<Datafile> meta(m_file_pool, lg_ptr.p->m_meta_files);
+  Local_datafile_list meta(m_file_pool, lg_ptr.p->m_meta_files);
   Ptr<Datafile> next = ptr;
   meta.next(next);
   if(firstFree != RNIL)
   {
-    LocalDLList<Datafile> free(m_file_pool, lg_ptr.p->m_free_files);
+    Local_datafile_list free(m_file_pool, lg_ptr.p->m_free_files);
     meta.remove(ptr);
     free.add(ptr);
   }
   else
   {
-    LocalDLList<Datafile> full(m_file_pool, lg_ptr.p->m_full_files);
+    Local_datafile_list full(m_file_pool, lg_ptr.p->m_full_files);
     meta.remove(ptr);
     full.add(ptr);
   }
@@ -1299,13 +1303,13 @@
       if (find_file_by_id(file_ptr, fg_ptr.p->m_full_files, req.file_id))
       {
 	jam();
-	LocalDLList<Datafile> full(m_file_pool, fg_ptr.p->m_full_files);
+	Local_datafile_list full(m_file_pool, fg_ptr.p->m_full_files);
 	full.remove(file_ptr);
       }
       else if(find_file_by_id(file_ptr, fg_ptr.p->m_free_files, req.file_id))
       {
 	jam();
-	LocalDLList<Datafile> free(m_file_pool, fg_ptr.p->m_free_files);
+	Local_datafile_list free(m_file_pool, fg_ptr.p->m_free_files);
 	free.remove(file_ptr);
       }
       else
@@ -1314,7 +1318,7 @@
 	break;
       }
       
-      LocalDLList<Datafile> meta(m_file_pool, fg_ptr.p->m_meta_files);
+      Local_datafile_list meta(m_file_pool, fg_ptr.p->m_meta_files);
       meta.add(file_ptr);
       
       if (file_ptr.p->m_online.m_used_extent_cnt || 
@@ -1338,16 +1342,16 @@
     case DropFileImplReq::Abort:{
       ndbrequire(find_file_by_id(file_ptr, fg_ptr.p->m_meta_files, req.file_id));
       file_ptr.p->m_state = Datafile::FS_ONLINE;
-      LocalDLList<Datafile> meta(m_file_pool, fg_ptr.p->m_meta_files);
+      Local_datafile_list meta(m_file_pool, fg_ptr.p->m_meta_files);
       meta.remove(file_ptr);
       if (file_ptr.p->m_online.m_first_free_extent != RNIL)
       {
-	LocalDLList<Datafile> free(m_file_pool, fg_ptr.p->m_free_files);
+	Local_datafile_list free(m_file_pool, fg_ptr.p->m_free_files);
 	free.add(file_ptr);
       }
       else
       {
-	LocalDLList<Datafile> full(m_file_pool, fg_ptr.p->m_full_files);
+	Local_datafile_list full(m_file_pool, fg_ptr.p->m_full_files);
 	full.add(file_ptr);
       }
       break;
@@ -1407,7 +1411,7 @@
   
   ndbrequire(m_tablespace_hash.find(ts_ptr, req.request.tablespace_id));
   Uint32 size = ts_ptr.p->m_extent_size;
-  LocalDLList<Datafile> tmp(m_file_pool, ts_ptr.p->m_free_files);
+  Local_datafile_list tmp(m_file_pool, ts_ptr.p->m_free_files);
   
   if (tmp.first(file_ptr))
   {
@@ -1456,7 +1460,7 @@
       if (next_free == RNIL)
       {
 	jam();
-	LocalDLList<Datafile> full(m_file_pool, ts_ptr.p->m_full_files);
+	Local_datafile_list full(m_file_pool, ts_ptr.p->m_full_files);
 	tmp.remove(file_ptr);
 	full.add(file_ptr);
       }
@@ -1988,7 +1992,7 @@
   switch(list){
   case 0:
   {
-    LocalDLList<Datafile> tmp(m_file_pool, ptr.p->m_free_files);
+    Local_datafile_list tmp(m_file_pool, ptr.p->m_free_files);
     if(file.i == RNIL)
     {
       if(!tmp.first(file))
@@ -2005,7 +2009,7 @@
   }
   case 1:
   {
-    LocalDLList<Datafile> tmp(m_file_pool, ptr.p->m_full_files);
+    Local_datafile_list tmp(m_file_pool, ptr.p->m_full_files);
     if(file.i == RNIL)
     {
       if(!tmp.first(file))
@@ -2046,8 +2050,8 @@
       file.p->m_online.m_lcp_free_extent_head = RNIL;
       file.p->m_online.m_lcp_free_extent_tail = RNIL;
 
-      LocalDLList<Datafile> free(m_file_pool, ptr.p->m_free_files);
-      LocalDLList<Datafile> full(m_file_pool, ptr.p->m_full_files);
+      Local_datafile_list free(m_file_pool, ptr.p->m_free_files);
+      Local_datafile_list full(m_file_pool, ptr.p->m_full_files);
       full.remove(file);
       free.add(file);
     }
@@ -2151,7 +2155,7 @@
     return;
   }
 
-  DLHashTable<Datafile>::Iterator iter;
+  Datafile_hash::Iterator iter;
   ndbrequire(m_file_hash.first(iter));
 
   while(iter.curr.p->m_file_id != tableId && m_file_hash.next(iter))

--- 1.5/storage/ndb/src/kernel/blocks/tsman.hpp	2006-02-15 13:20:12 +01:00
+++ 1.6/storage/ndb/src/kernel/blocks/tsman.hpp	2006-03-03 18:29:42 +01:00
@@ -84,6 +84,7 @@
      * - Part of local key
      * - Set by pgman
      */
+    Uint32 m_magic;
     Uint32 m_file_no;
     Uint32 m_file_id;        // Used when talking to DICT
     Uint32 m_fd; // NDBFS
@@ -136,12 +137,18 @@
       return m_file_no == rec.m_file_no;
     }
   };
-  
+
+  typedef RecordPool<Datafile, RWPool> Datafile_pool;
+  typedef DLListImpl<Datafile_pool, Datafile> Datafile_list;
+  typedef LocalDLListImpl<Datafile_pool, Datafile> Local_datafile_list;
+  typedef DLHashTableImpl<Datafile_pool, Datafile> Datafile_hash;
+
   struct Tablespace
   {
     Tablespace(){}
     Tablespace(Tsman*, Lgman*, const struct CreateFilegroupImplReq*);
     
+    Uint32 m_magic;
     union {
       Uint32 key;
       Uint32 m_tablespace_id;
@@ -157,11 +164,11 @@
     };
 
     Uint32 m_extent_size;       // In pages
-    DLList<Datafile>::Head m_free_files; // Files w/ free space
+    Datafile_list::Head m_free_files; // Files w/ free space
     Logfile_client m_logfile_client;
 
-    DLList<Datafile>::Head m_full_files; // Files wo/ free space
-    DLList<Datafile>::Head m_meta_files; // Files being created/dropped
+    Datafile_list::Head m_full_files; // Files wo/ free space
+    Datafile_list::Head m_meta_files; // Files being created/dropped
     
     Uint32 nextHash;
     Uint32 prevHash;
@@ -179,14 +186,19 @@
     }
   };
 
+  typedef RecordPool<Tablespace, RWPool> Tablespace_pool;
+  typedef DLListImpl<Tablespace_pool, Tablespace> Tablespace_list;
+  typedef LocalDLListImpl<Tablespace_pool, Tablespace> Local_tablespace_list;
+  typedef KeyTableImpl<Tablespace_pool, Tablespace> Tablespace_hash;
+
 private:
   friend class Tablespace_client;
-  ArrayPool<Datafile> m_file_pool;
-  ArrayPool<Tablespace> m_tablespace_pool;
+  Datafile_pool m_file_pool;
+  Tablespace_pool m_tablespace_pool;
   
-  DLHashTable<Datafile> m_file_hash;
-  DLList<Tablespace> m_tablespace_list;
-  KeyTable<Tablespace> m_tablespace_hash;
+  Datafile_hash m_file_hash;
+  Tablespace_list m_tablespace_list;
+  Tablespace_hash m_tablespace_hash;
   Page_cache_client m_page_cache_client;
   Lgman * const m_lgman;
   
@@ -209,7 +221,7 @@
   void scan_datafile(Signal*, Uint32, Uint32);
   void scan_extent_headers(Signal*, Ptr<Datafile>);
 
-  bool find_file_by_id(Ptr<Datafile>&, DLList<Datafile>::Head&, Uint32 id);
+  bool find_file_by_id(Ptr<Datafile>&, Datafile_list::Head&, Uint32 id);
   void create_file_abort(Signal* signal, Ptr<Datafile>);
 
   void release_extent_pages(Signal* signal, Ptr<Datafile> ptr);
Thread
bk commit into 5.1 tree (jonas:1.2217) BUG#16913jonas3 Mar