List:Commits« Previous MessageNext Message »
From:jonas oreland Date:February 15 2011 8:52am
Subject:bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3436)
View as plain text  
#At file:///home/jonas/src/70-spj-svs/ based on revid:ole.john.aske@stripped

 3436 jonas oreland	2011-02-15 [merge]
      ndb spj - merge 70-main

    modified:
      storage/ndb/src/common/debugger/signaldata/FsRef.cpp
      storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
      storage/ndb/src/kernel/blocks/lgman.cpp
      storage/ndb/src/kernel/error/ErrorReporter.cpp
=== modified file 'storage/ndb/src/common/debugger/signaldata/FsRef.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/FsRef.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/FsRef.cpp	2011-02-15 08:46:20 +0000
@@ -38,7 +38,7 @@ printFSREF(FILE * output, const Uint32 *
     fprintf(output, "No error");
     break;
   default:
-    fprintf(output, ndbd_exit_message(sig->getErrorCode(sig->errorCode), &cl));
+    fprintf(output, "%s", ndbd_exit_message(sig->getErrorCode(sig->errorCode), &cl));
     break;
   }
   fprintf(output, "\n");

=== modified file 'storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp'
--- a/storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp	2011-02-15 08:46:20 +0000
@@ -77,7 +77,7 @@ SHM_Transporter::checkConnected(){
 		    "shmctl(%d, IPC_STAT) errno: %d(%s). ", shmId,
 		    errno, strerror(errno));
     make_error_info(buf+r, sizeof(buf)-r);
-    DBUG_PRINT("error",(buf));
+    DBUG_PRINT("error",("%s", buf));
     switch (errno)
     {
     case EACCES:

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2011-02-08 15:13:13 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2011-02-15 08:52:34 +0000
@@ -3320,6 +3320,10 @@ private:
                            const Dbtup::ScanOp& op);
   void commit_operation(Signal*, Uint32, Tuple_header*, PagePtr,
 			Operationrec*, Fragrecord*, Tablerec*);
+  int retrieve_data_page(Signal*,
+                         Page_cache_client::Request,
+                         OperationrecPtr);
+  int retrieve_log_page(Signal*, FragrecordPtr, OperationrecPtr);
   
   void dealloc_tuple(Signal* signal, Uint32, Page*, Tuple_header*, 
 		     Operationrec*, Fragrecord*, Tablerec*);

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp	2011-02-10 10:16:09 +0000
@@ -475,6 +475,86 @@ Dbtup::disk_page_log_buffer_callback(Sig
   c_lqh->tupcommit_conf_callback(signal, regOperPtr.p->userpointer);
 }
 
+int Dbtup::retrieve_data_page(Signal *signal,
+                              Page_cache_client::Request req,
+                              OperationrecPtr regOperPtr)
+{
+  req.m_callback.m_callbackData= regOperPtr.i;
+  req.m_callback.m_callbackFunction =
+    safe_cast(&Dbtup::disk_page_commit_callback);
+
+  /*
+   * Consider commit to be correlated.  Otherwise pk op + commit makes
+   * the page hot.   XXX move to TUP which knows better.
+   */
+  int flags= regOperPtr.p->op_struct.op_type |
+    Page_cache_client::COMMIT_REQ | Page_cache_client::CORR_REQ;
+  Page_cache_client pgman(this, c_pgman);
+  int res= pgman.get_page(signal, req, flags);
+  m_pgman_ptr = pgman.m_ptr;
+
+  switch(res){
+  case 0:
+    /**
+     * Timeslice
+     */
+    jam();
+    signal->theData[0] = 1;
+    return res;
+  case -1:
+    ndbrequire("NOT YET IMPLEMENTED" == 0);
+    break;
+  default:
+    jam();
+  }
+  {
+    PagePtr tmpptr;
+    tmpptr.i = m_pgman_ptr.i;
+    tmpptr.p = reinterpret_cast<Page*>(m_pgman_ptr.p);
+
+    disk_page_set_dirty(tmpptr);
+  }
+  regOperPtr.p->m_commit_disk_callback_page= res;
+  regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
+
+  return res;
+}
+
+int Dbtup::retrieve_log_page(Signal *signal,
+                             FragrecordPtr regFragPtr,
+                             OperationrecPtr regOperPtr)
+{
+  jam();
+  /**
+   * Only last op on tuple needs "real" commit,
+   *   hence only this one should have m_wait_log_buffer
+   */
+
+  CallbackPtr cb;
+  cb.m_callbackData= regOperPtr.i;
+  cb.m_callbackIndex = DISK_PAGE_LOG_BUFFER_CALLBACK;
+  Uint32 sz= regOperPtr.p->m_undo_buffer_space;
+
+  D("Logfile_client - execTUP_COMMITREQ");
+  Logfile_client lgman(this, c_lgman, regFragPtr.p->m_logfile_group_id);
+  int res= lgman.get_log_buffer(signal, sz, &cb);
+  jamEntry();
+  switch(res){
+  case 0:
+    jam();
+    signal->theData[0] = 1;
+    return res;
+  case -1:
+    ndbrequire("NOT YET IMPLEMENTED" == 0);
+    break;
+  default:
+    jam();
+  }
+  regOperPtr.p->op_struct.m_wait_log_buffer= 0;
+
+  return res;
+}
+
 /**
  * Move to the first operation performed on this tuple
  */
@@ -640,44 +720,12 @@ void Dbtup::execTUP_COMMITREQ(Signal* si
       
       ndbassert(tuple_ptr->m_header_bits & Tuple_header::DISK_PART);
     }
-    req.m_callback.m_callbackData= regOperPtr.i;
-    req.m_callback.m_callbackFunction = 
-      safe_cast(&Dbtup::disk_page_commit_callback);
-
-    /*
-     * Consider commit to be correlated.  Otherwise pk op + commit makes
-     * the page hot.   XXX move to TUP which knows better.
-     */
-    int flags= regOperPtr.p->op_struct.op_type |
-      Page_cache_client::COMMIT_REQ | Page_cache_client::CORR_REQ;
-    Page_cache_client pgman(this, c_pgman);
-    int res= pgman.get_page(signal, req, flags);
-    m_pgman_ptr = pgman.m_ptr;
-    switch(res){
-    case 0:
-      /**
-       * Timeslice
-       */
-      jam();
-      signal->theData[0] = 1;
-      return;
-    case -1:
-      ndbrequire("NOT YET IMPLEMENTED" == 0);
-      break;
-    default:
-      jam();
-    }
-    get_page = true;
 
+    if (retrieve_data_page(signal, req, regOperPtr) == 0)
     {
-      PagePtr tmpptr;
-      tmpptr.i = m_pgman_ptr.i;
-      tmpptr.p = reinterpret_cast<Page*>(m_pgman_ptr.p);
-      disk_page_set_dirty(tmpptr);
+      return; // Data page has not been retrieved yet.
     }
-    
-    regOperPtr.p->m_commit_disk_callback_page= res;
-    regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
+    get_page = true;
   } 
   
   if(regOperPtr.p->op_struct.m_wait_log_buffer)
@@ -689,25 +737,9 @@ void Dbtup::execTUP_COMMITREQ(Signal* si
      */
     ndbassert(tuple_ptr->m_operation_ptr_i == regOperPtr.i);
     
-    CallbackPtr cb;
-    cb.m_callbackData= regOperPtr.i;
-    cb.m_callbackIndex = DISK_PAGE_LOG_BUFFER_CALLBACK;
-    Uint32 sz= regOperPtr.p->m_undo_buffer_space;
-    
-    D("Logfile_client - execTUP_COMMITREQ");
-    Logfile_client lgman(this, c_lgman, regFragPtr.p->m_logfile_group_id);
-    int res= lgman.get_log_buffer(signal, sz, &cb);
-    jamEntry();
-    switch(res){
-    case 0:
-      jam();
-      signal->theData[0] = 1;
-      return;
-    case -1:
-      ndbrequire("NOT YET IMPLEMENTED" == 0);
-      break;
-    default:
-      jam();
+    if (retrieve_log_page(signal, regFragPtr, regOperPtr) == 0)
+    {
+      return; // Log page has not been retrieved yet.
     }
   }
   

=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp	2011-01-30 20:56:00 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp	2011-02-15 08:46:20 +0000
@@ -369,8 +369,8 @@ Lgman::execDUMP_STATE_ORD(Signal* signal
                            !ptr.p->m_log_buffer_waiters.isEmpty(),
                            !ptr.p->m_log_sync_waiters.isEmpty());
       if (signal->theData[0] == 12001)
-        infoEvent(tmp);
-      ndbout_c(tmp);
+        infoEvent("%s", tmp);
+      ndbout_c("%s", tmp);
 
       BaseString::snprintf(tmp, sizeof(tmp),
                            "   callback_buffer_words: %u"
@@ -379,8 +379,8 @@ Lgman::execDUMP_STATE_ORD(Signal* signal
                            ptr.p->m_free_buffer_words,
                            ptr.p->m_free_file_words);
       if (signal->theData[0] == 12001)
-        infoEvent(tmp);
-      ndbout_c(tmp);
+        infoEvent("%s", tmp);
+      ndbout_c("%s", tmp);
       if (!ptr.p->m_log_buffer_waiters.isEmpty())
       {
 	Ptr<Log_waiter> waiter;
@@ -392,8 +392,8 @@ Lgman::execDUMP_STATE_ORD(Signal* signal
                              waiter.p->m_size,
                              FREE_BUFFER_MARGIN);
         if (signal->theData[0] == 12001)
-          infoEvent(tmp);
-        ndbout_c(tmp);
+          infoEvent("%s", tmp);
+        ndbout_c("%s", tmp);
       }
       if (!ptr.p->m_log_sync_waiters.isEmpty())
       {
@@ -407,8 +407,8 @@ Lgman::execDUMP_STATE_ORD(Signal* signal
                              waiter.i,
                              waiter.p->m_sync_lsn);
         if (signal->theData[0] == 12001)
-          infoEvent(tmp);
-        ndbout_c(tmp);
+          infoEvent("%s", tmp);
+        ndbout_c("%s", tmp);
 	
 	while(!waiter.isNull())
 	{

=== modified file 'storage/ndb/src/kernel/error/ErrorReporter.cpp'
--- a/storage/ndb/src/kernel/error/ErrorReporter.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/error/ErrorReporter.cpp	2011-02-15 08:46:20 +0000
@@ -239,8 +239,8 @@ ErrorReporter::handleError(int messageID
   
   WriteMessage(messageID, problemData, objRef, nst);
 
-  g_eventLogger->info(problemData);
-  g_eventLogger->info(objRef);
+  g_eventLogger->info("%s", problemData);
+  g_eventLogger->info("%s", objRef);
 
   NdbShutdown(messageID, nst);
   exit(1); // kill warning

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3436) jonas oreland15 Feb