List:Commits« Previous MessageNext Message »
From:mikael Date:February 28 2007 5:20pm
Subject:bk commit into 5.1 tree (mikron:1.2454)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron 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-02-28 18:20:14+01:00, mikron@stripped +9 -0
  Merge 24.37.251.10.in-addr.arpa:/Users/mikron/mysql_clones/wl3682
  into  24.37.251.10.in-addr.arpa:/Users/mikron/mysql_clones/benchmark
  MERGE: 1.2409.7.3

  sql/ha_ndbcluster.cc@stripped, 2007-02-28 18:20:11+01:00, mikron@stripped +0 -0
    manual merge
    MERGE: 1.397.9.1

  storage/ndb/include/mgmapi/ndb_logevent.h@stripped, 2007-02-28 18:20:11+01:00, mikron@stripped +0 -2
    manual merge
    MERGE: 1.8.2.1

  storage/ndb/include/portlib/NdbTick.h@stripped, 2007-02-28 18:18:31+01:00, mikron@stripped +0 -0
    Auto merged
    MERGE: 1.3.2.1

  storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2007-02-28 18:18:31+01:00, mikron@stripped +0 -0
    Auto merged
    MERGE: 1.27.7.2

  storage/ndb/src/common/portlib/NdbTick.c@stripped, 2007-02-28 18:18:31+01:00, mikron@stripped +0 -0
    Auto merged
    MERGE: 1.7.1.1

  storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp@stripped, 2007-02-28 18:18:31+01:00, mikron@stripped +0 -0
    Auto merged
    MERGE: 1.34.1.1

  storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp@stripped, 2007-02-28 18:18:31+01:00, mikron@stripped +0 -0
    Auto merged
    MERGE: 1.81.1.1

  storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2007-02-28 18:18:31+01:00, mikron@stripped +0 -0
    Auto merged
    MERGE: 1.46.3.1

  storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-02-28 18:20:11+01:00, mikron@stripped +2 -2
    manual merge
    MERGE: 1.133.1.3

# 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:	mikron
# Host:	24.37.251.10.in-addr.arpa
# Root:	/Users/mikron/mysql_clones/benchmark/RESYNC

--- 1.6/storage/ndb/include/portlib/NdbTick.h	2007-02-20 15:47:23 +01:00
+++ 1.7/storage/ndb/include/portlib/NdbTick.h	2007-02-28 18:18:31 +01:00
@@ -38,7 +38,6 @@
 int NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros);
 
 #define TIME_MEASUREMENT
-#ifdef TIME_MEASUREMENT
 
 struct MicroSecondTimer {
   NDB_TICKS seconds;
@@ -54,7 +53,6 @@
 NDB_TICKS NdbTick_getMicrosPassed(struct MicroSecondTimer start,
                             struct MicroSecondTimer stop);
 int NdbTick_getMicroTimer(struct MicroSecondTimer* time_now);
-#endif
 
 #ifdef	__cplusplus
 }

--- 1.34/storage/ndb/src/common/debugger/EventLogger.cpp	2007-02-20 15:47:23 +01:00
+++ 1.35/storage/ndb/src/common/debugger/EventLogger.cpp	2007-02-28 18:18:31 +01:00
@@ -507,6 +507,32 @@
 		       theData[4],
 		       theData[5]);
 }
+void getTextReportLockTimers(QQQQ)
+{
+  BaseString::snprintf(m_text, m_text_len, 
+                       "Total lock waits = %u, Locks less than \n"
+                       "64 us %u, 128 us %u, 256 us %u, 512 us %u,"
+                       "1 ms %u, 2 ms %u, 4.1 ms %u, 8.2 ms %u,"
+                       "16.4 ms %u, 32.8 ms %u, 65.5 ms %u, 131 ms %u",
+                       "262 ms %u, 524 ms %u, 1 s %u, larger than 1 s %u",
+		       theData[17], 
+		       theData[1], 
+		       theData[2], 
+		       theData[3], 
+		       theData[4],
+		       theData[5], 
+		       theData[6], 
+		       theData[7], 
+		       theData[8],
+		       theData[9],
+		       theData[10],
+		       theData[11],
+		       theData[12],
+		       theData[13],
+		       theData[14],
+		       theData[15],
+		       theData[16]);
+}
 void getTextTransReportCounters(QQQQ) {
   // -------------------------------------------------------------------  
   // Report information about transaction activity once per 10 seconds.
@@ -516,7 +542,7 @@
 		       "Read Count = %u, Simple Read Count = %u,\n"
 		       "Write Count = %u, AttrInfo Count = %u, "
 		       "Concurrent Operations = %u, Abort Count = %u\n"
-		       " Scans: %u Range scans: %u", 
+		       " Scans: %u Range scans: %u\n",
 		       theData[1], 
 		       theData[2], 
 		       theData[3], 
@@ -526,7 +552,10 @@
 		       theData[7], 
 		       theData[8],
 		       theData[9],
-		       theData[10]);
+		       theData[10],
+		       theData[11],
+		       theData[12],
+		       theData[13]);
 }
 void getTextOperationReportCounters(QQQQ) {
   BaseString::snprintf(m_text, m_text_len,
@@ -1014,6 +1043,7 @@
   ROW(SendBytesStatistic,      LogLevel::llStatistic,   9, Logger::LL_INFO ),
   ROW(ReceiveBytesStatistic,   LogLevel::llStatistic,   9, Logger::LL_INFO ),
   ROW(MemoryUsage,             LogLevel::llStatistic,   5, Logger::LL_INFO ),
+  ROW(ReportLockTimers,        LogLevel::llStatistic,   8, Logger::LL_INFO ),
 
   // ERROR
   ROW(TransporterError,        LogLevel::llError,  2, Logger::LL_ERROR   ),

--- 1.8/storage/ndb/src/common/portlib/NdbTick.c	2007-01-24 18:57:02 +01:00
+++ 1.9/storage/ndb/src/common/portlib/NdbTick.c	2007-02-28 18:18:31 +01:00
@@ -71,7 +71,6 @@
 }
 
 #endif
-#ifdef TIME_MEASUREMENT
 int
 NdbTick_getMicroTimer(struct MicroSecondTimer* input_timer)
 {
@@ -102,4 +101,3 @@
   }
   return ret_value;
 }
-#endif

--- 1.35/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp	2007-02-14 06:35:28 +01:00
+++ 1.36/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp	2007-02-28 18:18:31 +01:00
@@ -22,6 +22,7 @@
 
 #include <pc.hpp>
 #include <SimulatedBlock.hpp>
+#include <NdbTick.h>
 
 #ifdef DBACC_C
 // Debug Macros
@@ -153,6 +154,7 @@
 #define ZREL_FRAG 6
 #define ZREL_DIR 7
 #define ZREPORT_MEMORY_USAGE 8
+#define ZREPORT_LOCK_TIMER 9
 
 /* ------------------------------------------------------------------------- */
 /* ERROR CODES                                                               */
@@ -478,6 +480,7 @@
 /* OPERATIONREC                                                                      */
 /* --------------------------------------------------------------------------------- */
 struct Operationrec {
+  struct MicroSecondTimer m_lock_timer;
   Uint32 m_op_bits;
   Uint32 localdata[2];
   Uint32 elementIsforward;
@@ -842,6 +845,9 @@
   void reportMemoryUsage(Signal* signal, int gth);
   void reenable_expand_after_redo_log_exection_complete(Signal*);
 
+  void report_lock_timers(Signal *signal);
+  void insert_lock_timer_statistics(struct MicroSecondTimer start);
+
   // charsets
   void xfrmKeyData(Signal* signal);
 
@@ -1070,6 +1076,7 @@
   Uint32 tscanTrid1;
   Uint32 tscanTrid2;
 
+  Uint32 c_no_lock_waits[16];
   Uint32 ctest;
   Uint32 clqhPtr;
   BlockReference clqhBlockRef;

--- 1.82/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2007-02-14 06:35:28 +01:00
+++ 1.83/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2007-02-28 18:18:31 +01:00
@@ -109,7 +109,8 @@
       releaseDirResources(signal, fragIndex, dirIndex, startIndex);
       break;
     }
-  case ZREPORT_MEMORY_USAGE:{
+  case ZREPORT_MEMORY_USAGE:
+  {
     jam();
     Uint32 cnt = signal->theData[1];
     static int c_currentMemUsed = 0;
@@ -143,7 +144,13 @@
     sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 2);    
     return;
   }
-
+  case ZREPORT_LOCK_TIMER:
+  {
+    report_lock_timers(signal);
+    signal->theData[0] = ZREPORT_LOCK_TIMER;
+    sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 10000, 1);    
+    break;
+  }
   default:
     ndbrequire(false);
     break;
@@ -209,6 +216,8 @@
     signal->theData[0] = ZREPORT_MEMORY_USAGE;
     signal->theData[1] = 0;
     sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 1000, 2);    
+    signal->theData[0] = ZREPORT_LOCK_TIMER;
+    sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 10000, 1);    
     break;
   default:
     jam();
@@ -1427,6 +1436,7 @@
     fragrecptr.i = nextOp.p->fragptr;
     ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec);
     
+    insert_lock_timer_statistics(nextOp.p->m_lock_timer);
     sendAcckeyconf(signal);
     sendSignal(nextOp.p->userblockref, GSN_ACCKEYCONF, 
 	       signal, 6, JBB);
@@ -1502,6 +1512,7 @@
       return;
     } else if (return_result == ZSERIAL_QUEUE) {
       jam();
+      NdbTick_getMicroTimer(&operationRecPtr.p->m_lock_timer);
       signal->theData[0] = RNIL;
       return;
     } else {
@@ -4859,7 +4870,7 @@
 
 conf:
   newOwner.p->m_op_bits = opbits;
-
+  insert_lock_timer_statistics(newOwner.p->m_lock_timer);
   sendAcckeyconf(signal);
   sendSignal(newOwner.p->userblockref, GSN_ACCKEYCONF, 
 	     signal, 6, JBB);
@@ -8536,3 +8547,39 @@
   //  signal->theData[0] = src[0];
   //  signal->theData[1] = src[1];
 }
+
+void Dbacc::insert_lock_timer_statistics(struct MicroSecondTimer start)
+{
+  struct MicroSecondTimer stop;
+  Uint32 inx = 15;
+  Uint32 i;
+  Uint32 current_max_micros = 64;
+  NdbTick_getMicroTimer(&stop);
+  NDB_TICKS micros_passed = NdbTick_getMicrosPassed(start, stop);
+
+  for (i = 0; i < 16; i++)
+  {
+    if (current_max_micros >= micros_passed)
+    {
+      inx = i;
+      break;
+    }
+    current_max_micros <<= 1;
+  } 
+  c_no_lock_waits[inx]++;
+}
+
+void Dbacc::report_lock_timers(Signal *signal)
+{
+  Uint32 i;
+  Uint32 tot_count = 0;
+  signal->theData[0] = NDB_LE_ReportLockTimers;
+  for (i = 0; i < 16; i++)
+  {
+    tot_count += c_no_lock_waits[i];
+    signal->theData[i+1] = c_no_lock_waits[i];
+  }
+  signal->theData[17] = tot_count;
+  sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 18, JBB);
+}
+

--- 1.50/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2007-02-21 09:45:33 +01:00
+++ 1.51/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2007-02-28 18:18:31 +01:00
@@ -1686,10 +1686,14 @@
     UintR cconcurrentOp;
     Uint32 c_scan_count;
     Uint32 c_range_scan_count;
+    Uint32 c_single_scan_count;
+    Uint32 c_single_scan_no_distr;
+    Uint32 c_op_no_distr;
     void reset () { 
       cattrinfoCount = ctransCount = ccommitCount = creadCount =
 	csimpleReadCount = cwriteCount = cabortCount =
-	c_scan_count = c_range_scan_count = 0; 
+	c_scan_count = c_range_scan_count = c_single_scan_count =
+        c_single_scan_no_distr = c_op_no_distr = 0;
     }
     Uint32 report(Signal* signal){
       signal->theData[0] = NDB_LE_TransReportCounters;
@@ -1703,7 +1707,10 @@
       signal->theData[8] = cabortCount;
       signal->theData[9] = c_scan_count;
       signal->theData[10] = c_range_scan_count;
-      return 11;
+      signal->theData[11] = c_single_scan_count;
+      signal->theData[12] = c_single_scan_no_distr;
+      signal->theData[13] = c_op_no_distr;
+      return 14;
     }
   } c_counters;
   

--- 1.139/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-02-21 09:45:33 +01:00
+++ 1.140/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-02-28 18:20:11 +01:00
@@ -3033,7 +3033,11 @@
   Uint8 Tdirty = regTcPtr->dirtyOp;
   tnoOfBackup = tnodeinfo & 3;
   tnoOfStandby = (tnodeinfo >> 8) & 3;
- 
+
+  Uint32 TownNode = getOwnNodeId();
+  Uint32 Tno_distr_count = c_counters.c_op_no_distr;
+  if (Tdata3 == TownNode)
+    c_counters.c_op_no_distr = Tno_distr_count + 1;
   regCachePtr->fragmentDistributionKey = (tnodeinfo >> 16) & 255;
   if (Toperation == ZREAD || Toperation == ZREAD_EX) {
     if (Tdirty == 1) {
@@ -3046,7 +3050,6 @@
       /*-------------------------------------------------------------*/
       arrGuard(tnoOfBackup, MAX_REPLICAS);
       UintR Tindex;
-      UintR TownNode = cownNodeid;
       for (Tindex = 1; Tindex <= tnoOfBackup; Tindex++) {
         UintR Tnode = regTcPtr->tcNodedata[Tindex];
         jam();
@@ -9052,6 +9055,9 @@
     EXECUTE_DIRECT(DBDIH, GSN_DIGETNODESREQ, signal,
                    DiGetNodesReq::SignalLength);
     UintR TerrorIndicator = signal->theData[0];
+    Uint32 Tsingle_scan_count = c_counters.c_single_scan_count;
+    Uint32 Tsingle_scan_no_distr = c_counters.c_single_scan_no_distr;
+    Uint32 TownNode = getOwnNodeId();
     jamEntry();
     if (TerrorIndicator != 0) {
       DihFragCountRef * const ref = (DihFragCountRef*)signal->getDataPtr();
@@ -9062,6 +9068,9 @@
     }
     
     scanptr.p->scanNextFragId = get_conf->fragId;
+    c_counters.c_single_scan_count = Tsingle_scan_count + 1;
+    if (TownNode == get_conf->nodes[0])
+      c_counters.c_single_scan_no_distr = Tsingle_scan_no_distr + 1;
     DihFragCountConf * const conf = (DihFragCountConf*)signal->getDataPtr();
     conf->m_connectionData = tcConnectptr.i;
     conf->m_fragmentCount = 1; // Frag count

--- 1.11/storage/ndb/include/mgmapi/ndb_logevent.h	2007-02-20 15:47:23 +01:00
+++ 1.12/storage/ndb/include/mgmapi/ndb_logevent.h	2007-02-28 18:20:11 +01:00
@@ -175,10 +175,9 @@
     /* 59 used */
 
     /** NDB_MGM_EVENT_CATEGORY_STARTUP */
-    NDB_LE_StartReport = 60
+    NDB_LE_StartReport = 60,
 
-    /* 60 used */
-    /* 61 used */
+    NDB_LE_ReportLockTimers = 61
     /* 62 unused */
 
   };
@@ -529,7 +528,15 @@
 	unsigned abort_count;
 	unsigned scan_count;
 	unsigned range_scan_count;
+        unsigned single_scan_count;
+        unsigned single_scan_no_distr;
+        unsigned op_no_distr;
       } TransReportCounters;
+
+      struct {
+        unsigned no_lock_timer_waits[16];
+        unsigned no_lock_waits;
+      } ReportLockTimers;
       /** Log event specific data for for corresponding NDB_LE_ log event */
       struct {
 	unsigned ops;
Thread
bk commit into 5.1 tree (mikron:1.2454)mikael28 Feb