List:Commits« Previous MessageNext Message »
From:jonas Date:March 14 2007 2:51pm
Subject:bk commit into 5.1 tree (jonas:1.2117) BUG#27005
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-03-14 14:51:31+01:00, jonas@stripped +1 -0
  ndb - bug#27005 (wl2325-5.0)
      Handle API failure during resend
      API failure could cause release of table object, which will make resend crash
        when dereferencing table object
      
      Solution, use table_id+hash+schemaversion instead of *raw* pointer in resend

  storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2007-03-14 14:51:30+01:00,
jonas@stripped +40 -23
    Handle API failure during resend
    API failure could cause release of table object, which will make resend crash
      when dereferencing table object
    
    Solution, use table_id+hash+schemaversion instead of *raw* pointer in resend

# 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/drop5

--- 1.34/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-03-14 14:51:34 +01:00
+++ 1.35/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-03-14 14:51:34 +01:00
@@ -708,6 +708,17 @@
     Restart.resetRestart(signal);
   }
 
+  if (ERROR_INSERTED(13032))
+  {
+    Uint32 node = c_subscriber_nodes.find(0);
+    if (node != NodeBitmask::NotFound)
+    {
+      ndbout_c("Inserting API_FAILREQ node: %u", node);
+      signal->theData[0] = node;
+      EXECUTE_DIRECT(QMGR, GSN_API_FAILREQ, signal, 1);
+    }
+  }
+  
   signal->theData[0] = SumaContinueB::RESEND_BUCKET;
 
   NdbNodeBitmask tmp;
@@ -3273,6 +3284,9 @@
   f_bufferLock = 0;
   b_bufferLock = 0;
 
+  ndbrequire(tabPtr.p = c_tablePool.getPtr(tabPtr.i));
+  Uint32 tableId = tabPtr.p->m_tableId;
+
   Uint32 bucket= hashValue % c_no_of_buckets;
   m_max_seen_gci = (gci > m_max_seen_gci ? gci : m_max_seen_gci);
   if(m_active_buckets.get(bucket) || 
@@ -3289,11 +3303,9 @@
     /**
      * Signal to subscriber(s)
      */
-    ndbrequire(tabPtr.p = c_tablePool.getPtr(tabPtr.i));
-    
     SubTableData * data = (SubTableData*)signal->getDataPtrSend();//trg;
     data->gci            = gci;
-    data->tableId        = tabPtr.p->m_tableId;
+    data->tableId        = tableId;
     data->operation      = event;
     data->logType        = 0;
     
@@ -3313,10 +3325,11 @@
   else 
   {
     Uint32* dst;
-    Uint32 sz = f_trigBufferSize + b_trigBufferSize + 2;
+    Uint32 sz = f_trigBufferSize + b_trigBufferSize + 3;
     if((dst = get_buffer_ptr(signal, bucket, gci, sz)))
     {
-      * dst++ = tabPtr.i;
+      * dst++ = tableId;
+      * dst++ = tabPtr.p->m_schemaVersion;
       * dst++ = (event << 16) | f_trigBufferSize;
       memcpy(dst, f_buffer, f_trigBufferSize << 2);
       dst += f_trigBufferSize;
@@ -4770,38 +4783,42 @@
     {
       g_cnt++;
       Uint32 table = * src++ ;
+      Uint32 schemaversion = * src ++;
       Uint32 event = * src >> 16;
       Uint32 sz_1 = (* src ++) & 0xFFFF;
 
-      ndbassert(sz - 2 >= sz_1);
+      ndbassert(sz - 3 >= sz_1);
       
       LinearSectionPtr ptr[3];
       const Uint32 nptr= reformat(signal, ptr, 
 				  src, sz_1, 
-				  src + sz_1, sz - 2 - sz_1);
+				  src + sz_1, sz - 3 - sz_1);
       
       /**
        * Signal to subscriber(s)
        */
       Ptr<Table> tabPtr;
-      ndbrequire(tabPtr.p = c_tablePool.getPtr(table));
-      
-      SubTableData * data = (SubTableData*)signal->getDataPtrSend();//trg;
-      data->gci            = last_gci;
-      data->tableId        = tabPtr.p->m_tableId;
-      data->operation      = event;
-      data->logType        = 0;
-      
+      if (c_tables.find(tabPtr, table) && 
+	  tabPtr.p->m_schemaVersion == schemaversion)
       {
-	LocalDLList<Subscriber> list(c_subscriberPool,tabPtr.p->c_subscribers);
-	SubscriberPtr subbPtr;
-	for(list.first(subbPtr); !subbPtr.isNull(); list.next(subbPtr))
+	SubTableData * data = (SubTableData*)signal->getDataPtrSend();//trg;
+	data->gci            = last_gci;
+	data->tableId        = table;
+	data->operation      = event;
+	data->logType        = 0;
+	
 	{
-	  DBUG_PRINT("info",("GSN_SUB_TABLE_DATA to node %d",
-			     refToNode(subbPtr.p->m_senderRef)));
-	  data->senderData = subbPtr.p->m_senderData;
-	  sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal,
-		     SubTableData::SignalLength, JBB, ptr, nptr);
+	  LocalDLList<Subscriber> list(c_subscriberPool,
+				       tabPtr.p->c_subscribers);
+	  SubscriberPtr subbPtr;
+	  for(list.first(subbPtr); !subbPtr.isNull(); list.next(subbPtr))
+	  {
+	    DBUG_PRINT("info",("GSN_SUB_TABLE_DATA to node %d",
+			       refToNode(subbPtr.p->m_senderRef)));
+	    data->senderData = subbPtr.p->m_senderData;
+	    sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal,
+		       SubTableData::SignalLength, JBB, ptr, nptr);
+	  }
 	}
       }
     }
Thread
bk commit into 5.1 tree (jonas:1.2117) BUG#27005jonas14 Mar