List:Internals« Previous MessageNext Message »
From:jonas.oreland Date:March 23 2005 7:45am
Subject:bk commit into 5.1-ndb tree (joreland:1.1796)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1-ndb 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.1796 05/03/23 07:45:08 joreland@stripped +2 -0
  wl1870 - ndb diskdata -
    fix reservation of undo space

  ndb/src/ndbapi/ndberror.c
    1.34 05/03/23 07:45:05 joreland@stripped +2 -0
    fix out of undo space error codes

  ndb/src/kernel/blocks/lgman.cpp
    1.22 05/03/23 07:45:05 joreland@stripped +26 -5
    fix out of undo space error codes

# 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:	joreland
# Host:	eel.hemma.oreland.se.ndb.mysql.com
# Root:	/home/jonas/src/mysql-5.1-ndb-dd

--- 1.21/ndb/src/kernel/blocks/lgman.cpp	Tue Mar 22 15:53:38 2005
+++ 1.22/ndb/src/kernel/blocks/lgman.cpp	Wed Mar 23 07:45:05 2005
@@ -73,7 +73,7 @@
   m_file_pool.setSize(10);
   m_file_hash.setSize(10);
   m_data_buffer_pool.setSize(10);
-  m_log_buffer_waiter_pool.setSize(10);
+  m_log_buffer_waiter_pool.setSize(10000);
 }
   
 Lgman::~Lgman()
@@ -387,8 +387,8 @@
   Uint32 senderData = ptr.p->m_create.m_senderData;
 
   ptr.p->m_online.m_fd = fd;
-  ptr.p->m_online.m_tail_offset = 0; // skip zero page
-  ptr.p->m_online.m_head_offset = 0; // skip zero page
+  ptr.p->m_online.m_tail_offset = 0;
+  ptr.p->m_online.m_head_offset = 0;
   ptr.p->m_online.m_outstanding = 0;
   ptr.p->m_state = Undofile::FS_ONLINE;
   
@@ -400,10 +400,17 @@
 	       CreateFileImplConf::SignalLength, JBB);
   }
 
+  Uint64 add= ptr.p->m_file_size - 1;
+  lg_ptr.p->m_free_file_words += add * GLOBAL_PAGE_SIZE_WORDS;
+
   if(lg_ptr.p->m_current_file_ptr_i == RNIL)
   {
     jam();
     lg_ptr.p->m_current_file_ptr_i= ptr.i;
+    /**
+     * Keep 1 free page just in case
+     */
+    lg_ptr.p->m_free_file_words -= GLOBAL_PAGE_SIZE_WORDS;
   }
 }
 
@@ -1075,9 +1082,23 @@
 }
 
 int
-Lgman::alloc_log_space(Uint32 logfile_group_ref, Uint32 words)
+Lgman::alloc_log_space(Uint32 ref, Uint32 words)
 {
-  return 0;
+  Logfile_group key;
+  key.m_logfile_group_id= ref;
+  Ptr<Logfile_group> ptr;
+  if(m_logfile_group_hash.find(ptr, key) && ptr.p->m_free_file_words >=
words)
+  {
+    ptr.p->m_free_file_words -= words;
+    return 0;
+  }
+  
+  if(ptr.isNull())
+  {
+    return -1;
+  }
+  
+  return 1501;
 }
 
 int

--- 1.33/ndb/src/ndbapi/ndberror.c	Tue Mar  8 09:30:45 2005
+++ 1.34/ndb/src/ndbapi/ndberror.c	Wed Mar 23 07:45:05 2005
@@ -74,6 +74,7 @@
  *  900 - TUX
  * 1200 - LQH
  * 1300 - BACKUP
+ * 1500 - LGMAN
  * 4000 - API
  * 4100 - ""
  * 4200 - ""
@@ -173,6 +174,7 @@
   { 4021, TR, "Out of Send Buffer space in NDB API" },
   { 4022, TR, "Out of Send Buffer space in NDB API" },
   { 4032, TR, "Out of Send Buffer space in NDB API" },
+  { 1501, TR, "Out of undo space" },
 
   /**
    * InsufficientSpace
Thread
bk commit into 5.1-ndb tree (joreland:1.1796)jonas.oreland23 Mar