List:Commits« Previous MessageNext Message »
From:jonas Date:July 3 2007 12:12pm
Subject:bk commit into 5.1 tree (jonas:1.2549) BUG#25901
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@stripped, 2007-07-03 14:12:27+02:00, jonas@stripped +3 -0
  ndb - bug#25901
    handle undofile/logfile groups that were created while node was node

  storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-07-03 14:12:24+02:00, jonas@stripped +13 -9
    Make sure that START_RECREQ is run on lgman/tsman even during initial node restart

  storage/ndb/src/kernel/blocks/lgman.cpp@stripped, 2007-07-03 14:12:24+02:00, jonas@stripped +13 -4
    Set state to LG_STARTING during node/system restart

  storage/ndb/src/kernel/blocks/lgman.hpp@stripped, 2007-07-03 14:12:24+02:00, jonas@stripped +2 -1
    add new state

# 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/mysql-5.1-new-ndb

--- 1.29/storage/ndb/src/kernel/blocks/lgman.cpp	2007-07-03 14:12:33 +02:00
+++ 1.30/storage/ndb/src/kernel/blocks/lgman.cpp	2007-07-03 14:12:33 +02:00
@@ -346,6 +346,12 @@
     
     m_logfile_group_hash.add(ptr);
     m_logfile_group_list.add(ptr);
+
+    if (getNodeState().getNodeRestartInProgress() ||
+        getNodeState().getSystemRestartInProgress())
+    {
+      ptr.p->m_state = Logfile_group::LG_STARTING;
+    }
     
     CreateFilegroupImplConf* conf= 
       (CreateFilegroupImplConf*)signal->getDataPtr();
@@ -370,8 +376,6 @@
 {
   jamEntry();
 
-  jamEntry();
-
   Uint32 errorCode = 0;
   DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr();  
   do 
@@ -717,7 +721,8 @@
   Uint32 senderData = ptr.p->m_create.m_senderData;
 
   bool first= false;
-  if(ptr.p->m_state == Undofile::FS_CREATING)
+  if(ptr.p->m_state == Undofile::FS_CREATING &&
+     (lg_ptr.p->m_state & Logfile_group::LG_ONLINE))
   {
     jam();
     Local_undofile_list free(m_file_pool, lg_ptr.p->m_files);
@@ -2082,13 +2087,17 @@
 void
 Lgman::find_log_head(Signal* signal, Ptr<Logfile_group> ptr)
 {
+  ndbrequire(ptr.p->m_state & 
+             (Logfile_group::LG_STARTING | Logfile_group::LG_SORTING));
+
   if(ptr.p->m_meta_files.isEmpty() && ptr.p->m_files.isEmpty())
   {
     jam();
     /**
      * Logfile_group wo/ any files 
      */
-    
+    ptr.p->m_state &= ~(Uint32)Logfile_group::LG_STARTING;
+    ptr.p->m_state |= Logfile_group::LG_ONLINE;
     m_logfile_group_list.next(ptr);
     signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD;
     signal->theData[1] = ptr.i;

--- 1.9/storage/ndb/src/kernel/blocks/lgman.hpp	2007-07-03 14:12:33 +02:00
+++ 1.10/storage/ndb/src/kernel/blocks/lgman.hpp	2007-07-03 14:12:33 +02:00
@@ -175,13 +175,14 @@
       ,LG_SORTING             = 0x002  // Sorting files
       ,LG_SEARCHING           = 0x004  // Searching in last file
       ,LG_EXEC_THREAD         = 0x008  // Execute thread is running
-      ,LG_READ_THREAD         = 0x010 // Read thread is running
+      ,LG_READ_THREAD         = 0x010  // Read thread is running
       ,LG_FORCE_SYNC_THREAD   = 0x020
       ,LG_SYNC_WAITERS_THREAD = 0x040
       ,LG_CUT_LOG_THREAD      = 0x080
       ,LG_WAITERS_THREAD      = 0x100
       ,LG_FLUSH_THREAD        = 0x200
       ,LG_DROPPING            = 0x400
+      ,LG_STARTING            = 0x800
     };
 
     static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD |

--- 1.162/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-07-03 14:12:33 +02:00
+++ 1.163/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-07-03 14:12:33 +02:00
@@ -14215,15 +14215,6 @@
    *   WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED
    *   WITH A PROPER GCI.
    *------------------------------------------------------------------------ */
-  if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){
-    jam();
-    cstartRecReq = 2;
-    StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
-    conf->startingNodeId = getOwnNodeId();
-    sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, 
-	       StartRecConf::SignalLength, JBB);
-    return;
-  }//if
 
   if (c_lcp_restoring_fragments.isEmpty())
   {
@@ -14276,6 +14267,19 @@
   
   jam();
   csrExecUndoLogState = EULS_COMPLETED;
+
+  if(cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+  {
+    jam();
+    cstartRecReq = 2;
+
+    StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
+    conf->startingNodeId = getOwnNodeId();
+    sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, 
+	       StartRecConf::SignalLength, JBB);
+    return;
+  }
+
   c_lcp_complete_fragments.first(fragptr);
   build_acc(signal, fragptr.i);
   return;
Thread
bk commit into 5.1 tree (jonas:1.2549) BUG#25901jonas3 Jul