List:Commits« Previous MessageNext Message »
From:jonas Date:January 26 2006 11:07am
Subject:bk commit into 5.1 tree (jonas:1.2076) BUG#16787
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.2076 06/01/26 12:07:21 jonas@stripped +4 -0
  bug#16787 - ndb dd - fix datafiles with more than 1 extent page

  storage/ndb/src/kernel/blocks/tsman.cpp
    1.4 06/01/26 12:07:19 jonas@stripped +25 -3
    Fix creating of datafiles with more than 1 extent page

  storage/ndb/src/kernel/blocks/pgman.cpp
    1.5 06/01/26 12:07:19 jonas@stripped +8 -3
    Increase page entry pool
    Run LCP loop wo/ continueb

  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
    1.24 06/01/26 12:07:19 jonas@stripped +2 -2
    Increase extent pool

  storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
    1.6 06/01/26 12:07:18 jonas@stripped +7 -0
    qd fix for inconsistency tsman/tup

# 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-new

--- 1.5/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp	2006-01-25 09:47:53 +01:00
+++ 1.6/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp	2006-01-26 12:07:18 +01:00
@@ -346,12 +346,19 @@
     if ((pos= alloc.find_extent(sz)) != RNIL)
     {
       jam();
+      Uint32 cnt = 0;
       LocalDLList<Extent_info> list(c_extent_pool, alloc.m_free_extents[pos]);
       list.first(ext);
+      while((pageBits= tsman.alloc_page_from_extent(&ext.p->m_key, bits)) < 0)
+	if(!list.next(ext) || ++cnt < 10)
+	  break;
+      if (cnt == 10 || ext.isNull())
+	goto alloc;
       list.remove(ext);
     }
     else
     {
+  alloc:
       jam();
       /**
        * We need to alloc an extent

--- 1.4/storage/ndb/src/kernel/blocks/pgman.cpp	2006-01-25 09:47:53 +01:00
+++ 1.5/storage/ndb/src/kernel/blocks/pgman.cpp	2006-01-26 12:07:19 +01:00
@@ -125,7 +125,7 @@
   if (page_buffer > 0)
   {
     page_buffer /= GLOBAL_PAGE_SIZE; // in pages
-    m_page_entry_pool.setSize(2*page_buffer);
+    m_page_entry_pool.setSize(100*page_buffer);
     m_page_request_pool.setSize(10000);
     m_param.m_max_pages = page_buffer;
     m_param.m_max_hot_pages = (page_buffer * 9) / 10;
@@ -145,7 +145,7 @@
   m_max_io_waits(64),
   m_stats_loop_delay(1000),
   m_cleanup_loop_delay(200),
-  m_lcp_loop_delay(200)
+  m_lcp_loop_delay(0)
 {
 }
 
@@ -411,6 +411,8 @@
     return true;
   }
 
+  ndbrequire(false);
+  
   return false;
 }
 
@@ -739,7 +741,10 @@
   {
     Uint32 delay = m_param.m_lcp_loop_delay;
     signal->theData[0] = PgmanContinueB::LCP_LOOP;
-    sendSignalWithDelay(PGMAN_REF, GSN_CONTINUEB, signal, delay, 1);
+    if (delay)
+      sendSignalWithDelay(PGMAN_REF, GSN_CONTINUEB, signal, delay, 1);
+    else
+      sendSignal(PGMAN_REF, GSN_CONTINUEB, signal, 1, JBB);
   }
 #ifdef VM_TRACE
   debugOut << "PGMAN: <do_lcp_loop on=" << m_lcp_loop_on

--- 1.3/storage/ndb/src/kernel/blocks/tsman.cpp	2006-01-24 11:41:55 +01:00
+++ 1.4/storage/ndb/src/kernel/blocks/tsman.cpp	2006-01-26 12:07:19 +01:00
@@ -148,7 +148,15 @@
     release_extent_pages(signal, ptr);
     return;
   }
+  case TsmanContinueB::LOAD_EXTENT_PAGES:
+  {
+    Ptr<Datafile> ptr;
+    m_file_pool.getPtr(ptr, ptrI);
+    load_extent_pages(signal, ptr);
+    return;
+  }
   }
+  ndbrequire(false);
 }
 
 #ifdef VM_TRACE
@@ -702,8 +710,9 @@
    * Update file size
    */
   pages = 1 + extent_pages + data_pages;
-  hi = (pages * File_formats::NDB_PAGE_SIZE) >> 32;
-  lo = (pages * File_formats::NDB_PAGE_SIZE) & 0xFFFFFFFF;
+  Uint64 bytes = pages * File_formats::NDB_PAGE_SIZE;
+  hi = bytes >> 32;
+  lo = bytes & 0xFFFFFFFF;
   req->file_size_hi = hi;
   req->file_size_lo = lo;
 
@@ -1185,7 +1194,7 @@
        * Last extent header page...
        *   set correct no of extent headers
        */
-      extents= datapages / size;
+      extents= (datapages / size) % per_page;
     }
     for(Uint32 j = 0; j<extents; j++)
     {
@@ -1712,9 +1721,12 @@
     /**
      * Toggle word
      */
+    Uint32 old = header->get_free_bits(page_no_in_extent);
     unsigned bit = 
       (header->get_free_bits(page_no_in_extent) & ((1 << (SZ - 1)) - 1));
     header->update_free_bits(page_no_in_extent, bit);
+    ndbout_c("toggle page: (%d, %d, %d) from %x to %x", 
+	     key->m_page_no, extent, page_no_in_extent, old, bit);
     return 0;
   }
   
@@ -1815,6 +1827,14 @@
       shift &= 31;
     }
 
+#if 0
+    printf("req.bits: %d bits: ", req.bits);
+    for(Uint32 i = 0; i<size; i++)
+    {
+      printf("%x", header->get_free_bits(i));
+    }
+    ndbout_c("");
+#endif
     err= AllocPageReq::NoPageFree;
   }
   
@@ -1822,6 +1842,8 @@
   return;
   
 found:
+  ndbout_c("alloc page: (%d, %d, %d)", 
+	   data_off + extent * size + page_no, per_page + extent, page_no);
   src_bits |= (1 << (SZ - 1)); // high unlogged, allocated bit
   header->update_free_bits(page_no, src_bits);
   rep->bits= src_bits & ((1 << (SZ - 1)) - 1); 

--- 1.23/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2006-01-11 09:26:03 +01:00
+++ 1.24/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2006-01-26 12:07:19 +01:00
@@ -307,9 +307,9 @@
   c_buildIndexPool.setSize(c_noOfBuildIndexRec);
   c_triggerPool.setSize(noOfTriggers);
 
-  c_extent_pool.setSize(256);
+  c_extent_pool.setSize(8192);
   c_extent_hash.setSize(1024); // 4k
-  c_page_request_pool.setSize(100);
+  c_page_request_pool.setSize(1000);
   
   Uint32 nScanOp;       // use TUX config for now
   ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp));
Thread
bk commit into 5.1 tree (jonas:1.2076) BUG#16787jonas26 Jan