MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:January 14 2011 1:15pm
Subject:bzr push into mysql-5.1-telco-6.3 branch (jonas:3376 to 3378) Bug#59502
View as plain text  
 3378 Jonas Oreland	2011-01-14
      ndb - bug#59502 - check outstanding fs in LgmanContinueB::DROP_FILEGROUP

    modified:
      storage/ndb/src/kernel/blocks/lgman.cpp
 3377 Jonas Oreland	2011-01-14
      ndb - bug#59501 - don't remove tablespace/datafile object while END_LCP is running

    modified:
      storage/ndb/src/kernel/blocks/tsman.cpp
      storage/ndb/src/kernel/blocks/tsman.hpp
 3376 Jonas Oreland	2011-01-14
      ndb - bug#59496 - check ALLOC-bit instead of op == ZINSERT

    modified:
      storage/ndb/src/kernel/blocks/ERROR_codes.txt
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
      storage/ndb/test/ndbapi/testBasic.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp	2010-03-15 09:25:49 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp	2011-01-14 13:15:12 +0000
@@ -244,7 +244,8 @@ Lgman::execCONTINUEB(Signal* signal){
     jam();
     Ptr<Logfile_group> ptr;
     m_logfile_group_pool.getPtr(ptr, ptrI);
-    if (ptr.p->m_state & Logfile_group::LG_THREAD_MASK)
+    if ((ptr.p->m_state & Logfile_group::LG_THREAD_MASK) ||
+        ptr.p->m_outstanding_fs > 0)
     {
       jam();
       sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100, 

=== modified file 'storage/ndb/src/kernel/blocks/tsman.cpp'
--- a/storage/ndb/src/kernel/blocks/tsman.cpp	2010-02-08 16:38:27 +0000
+++ b/storage/ndb/src/kernel/blocks/tsman.cpp	2011-01-14 13:10:00 +0000
@@ -437,6 +437,13 @@ Tsman::execDROP_FILEGROUP_REQ(Signal* si
       ptr.p->m_state = Tablespace::TS_DROPPING;
       break;
     case DropFilegroupImplReq::Commit:
+      if (ptr.p->m_ref_count)
+      {
+        jam();
+        sendSignalWithDelay(reference(), GSN_DROP_FILEGROUP_REQ, signal,
+                            100, signal->getLength());
+        return;
+      }
       m_tablespace_list.remove(ptr);
       m_tablespace_hash.release(ptr);
       break;
@@ -1411,6 +1418,14 @@ Tsman::execDROP_FILE_REQ(Signal* signal)
     }
     case DropFileImplReq::Commit:
       ndbrequire(find_file_by_id(file_ptr, fg_ptr.p->m_meta_files, req.file_id));
+      if (file_ptr.p->m_ref_count)
+      {
+        jam();
+        sendSignalWithDelay(reference(), GSN_DROP_FILE_REQ, signal,
+                            100, signal->getLength());
+        return;
+      }
+      
       file_ptr.p->m_create.m_extent_pages = 
 	file_ptr.p->m_online.m_offset_data_pages - 1;
       file_ptr.p->m_create.m_senderRef = req.senderRef;
@@ -1462,7 +1477,8 @@ Tsman::Tablespace::Tablespace(Tsman* ts,
 {
   m_tablespace_id = req->filegroup_id;
   m_version = req->filegroup_version;
-  
+  m_ref_count = 0;
+
   m_extent_size = DIV(req->tablespace.extent_size, File_formats::NDB_PAGE_SIZE);
 #if defined VM_TRACE || defined ERROR_INSERT
   ndbout << "DD tsman: ts id:" << m_tablespace_id << " extent pages/bytes:" << m_extent_size << "/" << m_extent_size*File_formats::NDB_PAGE_SIZE  << endl;
@@ -1476,6 +1492,7 @@ Tsman::Datafile::Datafile(const struct C
   m_file_no = RNIL;
   m_fd = RNIL;
   m_online.m_first_free_extent = RNIL;
+  m_ref_count = 0;
     
   m_create.m_senderRef = req->senderRef; // During META
   m_create.m_senderData = req->senderData; // During META
@@ -2047,8 +2064,10 @@ Tsman::execEND_LCP_REQ(Signal* signal)
    * Move extents from "lcp" free list to real free list
    */
   Ptr<Tablespace> ptr;
-  if(m_tablespace_list.first(ptr))
+  if (m_tablespace_list.first(ptr))
   {
+    jam();
+    ptr.p->m_ref_count ++;
     signal->theData[0] = TsmanContinueB::END_LCP;
     signal->theData[1] = ptr.i;
     signal->theData[2] = 0;    // free
@@ -2062,6 +2081,8 @@ Tsman::end_lcp(Signal* signal, Uint32 pt
 {
   Ptr<Tablespace> ptr;
   m_tablespace_list.getPtr(ptr, ptrI);
+  ndbrequire(ptr.p->m_ref_count);
+  ptr.p->m_ref_count--;
   
   Ptr<Datafile> file;
   file.i = filePtrI;
@@ -2082,6 +2103,8 @@ Tsman::end_lcp(Signal* signal, Uint32 pt
     else
     {
       tmp.getPtr(file);
+      ndbrequire(file.p->m_ref_count);
+      file.p->m_ref_count--;
     }
     break;
   }
@@ -2101,6 +2124,8 @@ Tsman::end_lcp(Signal* signal, Uint32 pt
     else
     {
       tmp.getPtr(file);
+      ndbrequire(file.p->m_ref_count);
+      file.p->m_ref_count--;
     }
     break;
   }
@@ -2183,10 +2208,19 @@ Tsman::end_lcp(Signal* signal, Uint32 pt
       m_tablespace_list.next(ptr);
     }
   }
+  else
+  {
+    jam();
+    ndbrequire(ptr.i != RNIL);
+    m_file_pool.getPtr(file);
+    file.p->m_ref_count++;
+  }
   
 next:
   if(ptr.i != RNIL)
   {
+    ptr.p->m_ref_count++;
+    
     signal->theData[0] = TsmanContinueB::END_LCP;
     signal->theData[1] = ptr.i;
     signal->theData[2] = list;    

=== modified file 'storage/ndb/src/kernel/blocks/tsman.hpp'
--- a/storage/ndb/src/kernel/blocks/tsman.hpp	2009-10-08 10:29:46 +0000
+++ b/storage/ndb/src/kernel/blocks/tsman.hpp	2011-01-14 13:10:00 +0000
@@ -95,7 +95,8 @@ public:
     
     Uint32 m_tablespace_ptr_i;
     Uint32 m_extent_size;   
-    Uint32 m_state;
+    Uint16 m_state;
+    Uint16 m_ref_count;
 
     enum FileState 
     {
@@ -159,7 +160,8 @@ public:
       Uint32 m_tablespace_id;
     };
     Uint32 m_version;
-    Uint32 m_state;
+    Uint16 m_state;
+    Uint16 m_ref_count; // Can't release when m_ref_count > 0
 
     enum TablespaceState 
     {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-6.3 branch (jonas:3376 to 3378) Bug#59502Jonas Oreland14 Jan