List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:June 15 2009 1:31pm
Subject:bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:2909)
View as plain text  
#At file:///home/msvensson/mysql/7.1-ndbinfo/ based on revid:magnus.blaudd@stripped9-8q28yeywx8ey1kx3

 2909 Magnus Blåudd	2009-06-15
      ndbinfo
       - Proxy DBINFO_* signals in LocalProxy so that all instances of each block
         can report their values.
       - Adjust the blocks code to send in the latest Dbinfo* signal format
       - Adjust the table layouts

    modified:
      storage/ndb/include/kernel/signaldata/DbinfoScan.hpp
      storage/ndb/src/kernel/blocks/LocalProxy.cpp
      storage/ndb/src/kernel/blocks/LocalProxy.hpp
      storage/ndb/src/kernel/blocks/backup/Backup.cpp
      storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbinfo/Dbinfo.cpp
      storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_helpers.cpp
      storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_tables.h
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp
      storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp
      storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/kernel/blocks/trix/Trix.cpp
=== modified file 'storage/ndb/include/kernel/signaldata/DbinfoScan.hpp'
--- a/storage/ndb/include/kernel/signaldata/DbinfoScan.hpp	2009-06-15 13:12:19 +0000
+++ b/storage/ndb/include/kernel/signaldata/DbinfoScan.hpp	2009-06-15 13:31:37 +0000
@@ -96,6 +96,7 @@ class DbinfoScanConf {
   friend class Dbtup;
   friend class Dbtux;
   friend class DbUtil;
+  friend class LocalProxy;
   friend class Qmgr;
   friend class Suma;
   friend class Trix;
@@ -142,6 +143,7 @@ class DbinfoScanRef {
 
   /* Sender(s) */
   friend class Dbinfo;
+  friend class LocalProxy;
 
   friend bool printDBINFO_SCAN_REF(FILE * output, const Uint32 * theData,
                                    Uint32 len, Uint16 receiverBlockNo);

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2009-05-12 18:40:56 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2009-06-15 13:31:37 +0000
@@ -83,6 +83,10 @@ LocalProxy::LocalProxy(BlockNumber block
   addRecSignal(GSN_DROP_TRIG_IMPL_REQ, &LocalProxy::execDROP_TRIG_IMPL_REQ);
   addRecSignal(GSN_DROP_TRIG_IMPL_CONF, &LocalProxy::execDROP_TRIG_IMPL_CONF);
   addRecSignal(GSN_DROP_TRIG_IMPL_REF, &LocalProxy::execDROP_TRIG_IMPL_REF);
+
+  // GSN_DBINFO_SCANREQ
+  addRecSignal(GSN_DBINFO_SCANREQ, &LocalProxy::execDBINFO_SCANREQ);
+  addRecSignal(GSN_DBINFO_SCANCONF, &LocalProxy::execDBINFO_SCANCONF);
 }
 
 LocalProxy::~LocalProxy()
@@ -971,4 +975,70 @@ LocalProxy::sendDROP_TRIG_IMPL_CONF(Sign
   ssRelease<Ss_DROP_TRIG_IMPL_REQ>(ssId);
 }
 
+// GSN_DBINFO_SCANREQ
+
+void
+LocalProxy::execDBINFO_SCANREQ(Signal* signal)
+{
+  Ss_DBINFO_SCANREQ& ss = ssSeize<Ss_DBINFO_SCANREQ>(1);
+
+  const DbinfoScanReq* req = (const DbinfoScanReq*)signal->getDataPtr();
+  ss.m_req = *req;
+  ndbrequire(signal->getLength() == DbinfoScanReq::SignalLength ||

+             signal->getLength() == DbinfoScanReq::SignalLengthWithCursor);
+  ss.m_len = signal->getLength();
+  sendREQ(signal, ss);
+}
+
+void
+LocalProxy::execDBINFO_SCANCONF(Signal* signal)
+{
+  Ss_DBINFO_SCANREQ& ss = ssFind<Ss_DBINFO_SCANREQ>(1);
+  recvCONF(signal, ss);
+}
+
+void
+LocalProxy::sendDBINFO_SCANREQ(Signal* signal, Uint32 ssId)
+{
+  Ss_DBINFO_SCANREQ& ss = ssFind<Ss_DBINFO_SCANREQ>(ssId);
+
+  DbinfoScanReq* req = (DbinfoScanReq*)signal->getDataPtrSend();
+  *req = ss.m_req;
+  req->senderRef = reference();
+  req->instance = ss.m_worker;
+  sendSignal(workerRef(ss.m_worker), GSN_DBINFO_SCANREQ,
+             signal, ss.m_len, JBB);
+}
+
+void
+LocalProxy::sendDBINFO_SCANCONF(Signal* signal, Uint32 ssId)
+{
+  Ss_DBINFO_SCANREQ& ss = ssFind<Ss_DBINFO_SCANREQ>(ssId);
+  const DbinfoScanConf* conf = (const DbinfoScanConf*)signal->getDataPtr();
+  const Uint32 reqlength = signal->getLength();
+  if (!lastReply(ss))
+    return;
+
+  if (ss.m_error == 0)
+  {
+    jam();
+    DbinfoScanConf *conf = (DbinfoScanConf*)signal->getDataPtrSend();
+    memcpy(conf,&ss.m_req, reqlength * sizeof(Uint32));
+    conf->requestInfo &= ~(DbinfoScanConf::MoreData);
+    sendSignal(ss.m_req.senderRef, GSN_DBINFO_SCANCONF,
+               signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
+  }
+  else
+  {
+    jam();
+    DbinfoScanRef *ref = (DbinfoScanRef*)signal->getDataPtrSend();
+    ref->tableId = conf->tableId;
+    ref->apiTxnId = conf->apiTxnId;
+    ref->errorCode = ss.m_error;
+    sendSignal(ss.m_req.senderRef, GSN_DBINFO_SCANREF, signal,
+               DbinfoScanRef::SignalLength, JBB);
+  }
+  ssRelease<Ss_DBINFO_SCANREQ>(ssId);
+}
+
 BLOCK_FUNCTIONS(LocalProxy)

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2009-04-16 15:40:18 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2009-06-15 13:31:37 +0000
@@ -28,6 +28,7 @@
 #include <signaldata/NFCompleteRep.hpp>
 #include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/DropTrigImpl.hpp>
+#include <signaldata/DbinfoScan.hpp>
 
 /*
  * Proxy blocks for MT LQH.
@@ -553,6 +554,25 @@ protected:
   void execDROP_TRIG_IMPL_CONF(Signal*);
   void execDROP_TRIG_IMPL_REF(Signal*);
   void sendDROP_TRIG_IMPL_CONF(Signal*, Uint32 ssId);
+
+  // GSN_DBINFO_SCANREQ
+  struct Ss_DBINFO_SCANREQ : SsSequential {
+    DbinfoScanReq m_req;
+    Uint32 m_len;
+    Ss_DBINFO_SCANREQ() {
+      m_sendREQ = &LocalProxy::sendDBINFO_SCANREQ;
+      m_sendCONF = &LocalProxy::sendDBINFO_SCANCONF;
+    }
+    enum { poolSize = 3 };
+    static SsPool<Ss_DBINFO_SCANREQ>& pool(LocalProxy* proxy) {
+      return proxy->c_ss_DBINFO_SCANREQ;
+    }
+  };
+  SsPool<Ss_DBINFO_SCANREQ> c_ss_DBINFO_SCANREQ;
+  void execDBINFO_SCANREQ(Signal*);
+  void sendDBINFO_SCANREQ(Signal*, Uint32 ssId);
+  void execDBINFO_SCANCONF(Signal*);
+  void sendDBINFO_SCANCONF(Signal*, Uint32 ssId);
 };
 
 #endif

=== modified file 'storage/ndb/src/kernel/blocks/backup/Backup.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2009-05-29 06:23:51 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2009-06-15 13:31:37 +0000
@@ -684,7 +684,7 @@ void Backup::execDBINFO_SCANREQ(Signal *
       dbinfo_write_row_column_uint32(&r, (Uint32)ptr.p->noOfLogBytes); // TODO
       dbinfo_write_row_column_uint32(&r, (Uint32)ptr.p->noOfLogRecords); //TODO
       dbinfo_write_row_column_uint32(&r, ptr.p->errorCode);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
   else if( req.tableId == NDBINFO_BACKUP_PARAMETERS_TABLEID )
@@ -704,7 +704,7 @@ void Backup::execDBINFO_SCANREQ(Signal *
     dbinfo_write_row_column_uint32(&r, c_pagePool.getSize());
     dbinfo_write_row_column_uint32(&r, c_defaults.m_compressed_backup);
     dbinfo_write_row_column_uint32(&r, c_defaults.m_compressed_lcp);
-    dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+    dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
   }
   else if( req.tableId == NDBINFO_POOLS_TABLEID )
   {
@@ -735,23 +735,24 @@ void Backup::execDBINFO_SCANREQ(Signal *
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "BACKUP";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp	2009-06-15 13:31:37 +0000
@@ -8234,22 +8234,23 @@ void Dbacc::execDBINFO_SCANREQ(Signal *s
 
   if(req.tableId == NDBINFO_MEMUSAGE_TABLEID)
   {
+    jam();
     dbinfo_write_row_init(&r, buf, sizeof(buf));
-    const char *imstr= "IndexMemory";
-    dbinfo_write_row_column(&r, "IndexMemory", 11);
     dbinfo_write_row_column_uint32(&r, getOwnNodeId());
+    dbinfo_write_row_column_uint32(&r, blockToMain(number()));// block number
+    dbinfo_write_row_column_uint32(&r, req.instance);         // block instance
+    dbinfo_write_row_column(&r, "IndexMemory", 11);
     Uint32 page_size_kb= sizeof(*rpPageptr.p);;
     dbinfo_write_row_column(&r, (char*)&page_size_kb, 4); // 8kb
     dbinfo_write_row_column_uint32(&r, cnoOfAllocatedPages); // alloced pages
     dbinfo_write_row_column_uint32(&r, cpagesize); // number of pages
-    dbinfo_write_row_column(&r, "DBACC", strlen("DBACC"));
-    dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+    dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2009-06-01 14:57:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2009-06-15 13:31:37 +0000
@@ -368,23 +368,24 @@ void Dbdict::execDBINFO_SCANREQ(Signal *
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "DBDICT";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbinfo/Dbinfo.cpp'
--- a/storage/ndb/src/kernel/blocks/dbinfo/Dbinfo.cpp	2008-11-10 11:44:02 +0000
+++ b/storage/ndb/src/kernel/blocks/dbinfo/Dbinfo.cpp	2009-06-15 13:31:37 +0000
@@ -203,6 +203,7 @@ void Dbinfo::execDUMP_STATE_ORD(Signal* 
     DbinfoScanReq *req = (DbinfoScanReq*)signal->theData;
     req->tableId= tableId;
     req->senderRef= reference();
+    req->apiRef= reference();
     req->apiTxnId= tableId;
     req->requestInfo= DbinfoScanReq::AllColumns | DbinfoScanReq::StartScan;
     req->colBitmapLo= ~0;
@@ -226,6 +227,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
   DbinfoScanReq req= *(DbinfoScanReq*)signal->theData;
 
   const Uint32 tableId= req.tableId;
+  const Uint32 apiRef= req.apiRef;
   const Uint32 senderRef= req.senderRef;
   const Uint32 apiTxnId= req.apiTxnId;
   //const Uint32 colBitmapLo= req.colBitmapLo;
@@ -240,7 +242,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
 
   int continue_sending;
 
-  char buf[512];
+  char buf[1024];
   struct dbinfo_row r;
   struct dbinfo_ratelimit rl;
 
@@ -271,7 +273,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
                               strlen(ndbinfo_tables[i]->name));
       dbinfo_write_row_column(&r, create_sql, strlen(create_sql));
 
-      dbinfo_send_row(signal,r,rl,apiTxnId,senderRef);
+      dbinfo_send_row(signal,r,rl,apiTxnId,apiRef);
     }
 
     if(!dbinfo_ratelimit_continue(&rl) && i < number_ndbinfo_tables)
@@ -326,7 +328,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
         dbinfo_write_row_column(&r, t->col[j].name, strlen(t->col[j].name));
         const char* coltype_name= ndbinfo_coltype_to_string(t->col[j].coltype);
         dbinfo_write_row_column(&r, coltype_name, strlen(coltype_name));
-        dbinfo_send_row(signal,r,rl, apiTxnId,senderRef);
+        dbinfo_send_row(signal,r,rl, apiTxnId,apiRef);
 
         continue_sending= dbinfo_ratelimit_continue(&rl);
       }
@@ -362,7 +364,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
       DbinfoScanRef *ref= (DbinfoScanRef*)signal->getDataPtrSend();
       ref->tableId= tableId;
       ref->apiTxnId= apiTxnId;
-      ref->errorCode= 1;
+      ref->errorCode= DbinfoScanRef::NoTable;
       sendSignal(senderRef, GSN_DBINFO_SCANREF, signal,
                  DbinfoScanRef::SignalLength, JBB);
       break;
@@ -383,6 +385,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
       DbinfoScanReq *oreq= (DbinfoScanReq*)signal->getDataPtrSend();
 
       memcpy(signal->getDataPtrSend(),&ireq,DbinfoScanReq::SignalLength*sizeof(Uint32));
+      oreq->senderRef= reference();
       oreq->cursor.cur_requestInfo= 0;
       oreq->cursor.cur_node= 0;
       oreq->cursor.cur_block= DBINFO;
@@ -417,7 +420,7 @@ void Dbinfo::execDBINFO_SCANREQ(Signal *
       DbinfoScanReq *oreq= (DbinfoScanReq*)signal->getDataPtrSend();
 
       memcpy(signal->getDataPtrSend(),&ireq,signal->getLength()*sizeof(Uint32));
-
+      oreq->senderRef= reference(); //marty
       oreq->cursor.cur_block= dbinfo_blocks[next_dbinfo_block];
 
       sendSignal(numberToRef(oreq->cursor.cur_block, oreq->cursor.cur_node),
@@ -436,6 +439,7 @@ void Dbinfo::execDBINFO_SCANCONF(Signal 
 
   const Uint32 tableId= conf.tableId;
   const Uint32 senderRef= conf.senderRef;
+  const Uint32 apiRef= conf.apiRef;
   const Uint32 apiTxnId= conf.apiTxnId;
   //const Uint32 colBitmapLo= conf.colBitmapLo;
   //const Uint32 colBitmapHi= conf.colBitmapHi;
@@ -459,7 +463,7 @@ void Dbinfo::execDBINFO_SCANCONF(Signal 
 
   int next_dbinfo_block= 0;
 
-  if(signal->getLength() == 3) // we have the ACK from a DUMP initiated scan
+  if(signal->getLength() == DbinfoScanConf::DoneLength) // we have the ACK from a DUMP initiated scan
   {
     jam();
     ndbout_c("FINISHED DBINFO DUMP Scan on %u",signal->theData[0]);
@@ -506,7 +510,8 @@ void Dbinfo::execDBINFO_SCANCONF(Signal 
       apiconf->tableId= tableId;
       apiconf->senderRef= senderRef;
       apiconf->apiTxnId= apiTxnId;
-      sendSignal(senderRef, GSN_DBINFO_SCANCONF, signal, 3, JBB);
+      sendSignal(apiRef, GSN_DBINFO_SCANCONF, signal,
+                 DbinfoScanConf::DoneLength, JBB);
       return;
     }
   }

=== modified file 'storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_helpers.cpp'
--- a/storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_helpers.cpp	2008-10-08 20:29:28 +0000
+++ b/storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_helpers.cpp	2009-06-15 13:31:37 +0000
@@ -27,14 +27,13 @@ int dbinfo_write_row_column(struct dbinf
   r->endrow+= ah.getHeaderSize()*sizeof(Uint32);
 
   memcpy(&r->buf[r->endrow], col, clen);
-
   r->endrow+=clen;
   return 0;
 }
 
 int dbinfo_write_row_column_uint32(struct dbinfo_row *r, Uint32 value)
 {
-  return dbinfo_write_row_column(r, (char*)&value, sizeof(value));
+  return dbinfo_write_row_column(r, (char*)&value, sizeof(Uint32));
 }
 
 void dbinfo_ratelimit_init(struct dbinfo_ratelimit *rl, struct DbinfoScanReq *r)

=== modified file 'storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_tables.h'
--- a/storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_tables.h	2008-11-10 11:44:02 +0000
+++ b/storage/ndb/src/kernel/blocks/dbinfo/ndbinfo_tables.h	2009-06-15 13:31:37 +0000
@@ -12,7 +12,6 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
 #ifndef NDBINFO_TABLES_H
 #define NDBINFO_TABLES_H
 
@@ -41,15 +40,16 @@ DECLARE_NDBINFO_TABLE(ndbinfo_COLUMNS,4)
           {"COLUMN_TYPE", NDBINFO_TYPE_STRING},
         }};
 
-DECLARE_NDBINFO_TABLE(ndbinfo_MEMUSAGE,6)
-     = { "MEMUSAGE", 6, 0,
+DECLARE_NDBINFO_TABLE(ndbinfo_MEMUSAGE,7)
+     = { "MEMUSAGE", 7, 0,
         {
-          {"RESOURCE_NAME",    NDBINFO_TYPE_STRING},
           {"NODE_ID",          NDBINFO_TYPE_NUMBER},
-          {"PAGE_SIZE_KB",     NDBINFO_TYPE_NUMBER},
+          {"BLOCK_NUMBER",     NDBINFO_TYPE_NUMBER},
+          {"BLOCK_INSTANCE",   NDBINFO_TYPE_NUMBER},
+          {"RESOURCE_NAME",    NDBINFO_TYPE_STRING},
+          {"PAGE_SIZE",        NDBINFO_TYPE_NUMBER},
           {"PAGES_USED",       NDBINFO_TYPE_NUMBER},
           {"PAGES_TOTAL",      NDBINFO_TYPE_NUMBER},
-          {"BLOCK",            NDBINFO_TYPE_STRING},
         }};
 
 DECLARE_NDBINFO_TABLE(ndbinfo_LOGDESTINATION,5) =
@@ -100,11 +100,12 @@ DECLARE_NDBINFO_TABLE(ndbinfo_BACKUP_PAR
    }
 };
 
-DECLARE_NDBINFO_TABLE(ndbinfo_POOLS,5)
-= { "POOLS", 5, 0,
+DECLARE_NDBINFO_TABLE(ndbinfo_POOLS,6)
+= { "POOLS", 6, 0,
    {
      {"NODE_ID",                  NDBINFO_TYPE_NUMBER},
-     {"BLOCK",                    NDBINFO_TYPE_STRING},
+     {"BLOCK_NUMBER",             NDBINFO_TYPE_NUMBER},
+     {"BLOCK_INSTANCE",           NDBINFO_TYPE_NUMBER},
      {"POOL_NAME",                NDBINFO_TYPE_STRING},
      {"FREE",                     NDBINFO_TYPE_NUMBER},
      {"SIZE",                     NDBINFO_TYPE_NUMBER},

=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2009-06-15 13:31:37 +0000
@@ -12312,16 +12312,17 @@ void Dbtc::execDBINFO_SCANREQ(Signal *si
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "DBTC";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
@@ -12343,7 +12344,7 @@ void Dbtc::execDBINFO_SCANREQ(Signal *si
                               strlen(ndbinfo_tables[i]->name));
       dbinfo_write_row_column(&r, create_sql, strlen(create_sql));
 
-      dbinfo_send_row(signal,r,rl,apiTxnId,senderRef);
+      dbinfo_send_row(signal,r,rl,apiTxnId,apiRef);
     }
 
     if(!dbinfo_ratelimit_continue(&rl) && i < number_ndbinfo_tables)
@@ -12366,7 +12367,7 @@ void Dbtc::execDBINFO_SCANREQ(Signal *si
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2009-06-01 14:57:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2009-06-15 13:31:37 +0000
@@ -3059,6 +3059,8 @@ private:
   Uint32 czero;
   Uint32 cCopyProcedure;
   Uint32 cCopyLastSeg;
+  Uint32 cTotPages;
+  Uint32 cTotNoFragPages;
 
  // A little bit bigger to cover overwrites in copy algorithms (16384 real size).
 #define ZATTR_BUFFER_SIZE 16384

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp	2009-06-15 13:31:37 +0000
@@ -78,12 +78,29 @@ void Dbtup::execDBINFO_SCANREQ(Signal* s
   DbinfoScanReq req= *(DbinfoScanReq*)signal->theData;
   const Uint32 reqlength= signal->getLength();
 
+  const Uint32 tableId= req.tableId;
+  const Uint32 instance= req.instance;
+
   char buf[1024];
   struct dbinfo_row r;
   struct dbinfo_ratelimit rl;
 
   dbinfo_ratelimit_init(&rl, &req);
 
+  if(tableId == NDBINFO_MEMUSAGE_TABLEID)
+  {
+    jam();
+    dbinfo_write_row_init(&r, buf, sizeof(buf));
+    dbinfo_write_row_column_uint32(&r, getOwnNodeId());
+    dbinfo_write_row_column_uint32(&r, blockToMain(number()));// block number
+    dbinfo_write_row_column_uint32(&r, instance);             // block instance
+    dbinfo_write_row_column(&r, "DataMemory", 10);
+    Uint32 page_size_kb= sizeof(Page);;
+    dbinfo_write_row_column(&r, (char*)&page_size_kb, 4); // 8kb
+    dbinfo_write_row_column_uint32(&r, cTotNoFragPages); // alloced pages
+    dbinfo_write_row_column_uint32(&r, cTotPages); // number of pages
+    dbinfo_send_row(signal,r,rl,req.apiTxnId,req.apiRef);
+  }
   if(req.tableId == NDBINFO_POOLS_TABLEID)
   {
     struct {
@@ -116,25 +133,25 @@ void Dbtup::execDBINFO_SCANREQ(Signal* s
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "DBTUP";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);       // block number
+      dbinfo_write_row_column_uint32(&r, instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, reqlength * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
-  ndbout_c("DBTUP done doing DBINFO");
 }
 
 #ifdef VM_TRACE

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2009-06-01 14:57:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2009-06-15 13:31:37 +0000
@@ -55,6 +55,7 @@ void Dbtup::initData() 
   // Records with constant sizes
   init_list_sizes();
   cpackedListIndex = 0;
+  cTotNoFragPages = 0;
 }//Dbtup::initData()
 
 Dbtup::Dbtup(Block_context& ctx, Uint32 instanceNumber)
@@ -456,6 +457,11 @@ void Dbtup::initRecords() 
     m_ctx.m_config.getOwnConfigIterator();
   ndbrequire(p != 0);
 
+  // Check avalable data memory pages
+  Uint64 dataMem;
+  ndb_mgm_get_int64_parameter(p, CFG_DB_DATA_MEM, &dataMem);
+  cTotPages = dataMem / (ZWORDS_ON_PAGE * 4);
+
   // Records with dynamic sizes
   void* ptr = m_ctx.m_mm.get_memroot();
   c_page_pool.set((Page*)ptr, (Uint32)~0);

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp	2009-06-15 13:31:37 +0000
@@ -262,7 +262,7 @@ Dbtup::allocFragPage(Fragrecord* regFrag
   }
   
   regFragPtr->noOfPages = cnt + 1;
-  
+  cTotNoFragPages++;
   c_page_pool.getPtr(pagePtr);
   init_page(regFragPtr, pagePtr, pageId);
   
@@ -370,6 +370,7 @@ Dbtup::allocFragPage(Tablerec* tabPtrP, 
   }
   
   fragPtrP->noOfPages = cnt + 1;
+  cTotNoFragPages++;
   if (page_no + 1 > max)
   {
     jam();
@@ -427,6 +428,7 @@ Dbtup::releaseFragPage(Fragrecord* fragP
   }
 
   fragPtrP->noOfPages = cnt - 1;
+  cTotNoFragPages--;
   if (DBUG_PAGE_MAP)
     ndbout_c("release(%u %u)@%s", logicalPageId, pagePtr.i, where);
   do_check_page_map(fragPtrP);

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp	2009-06-15 13:31:37 +0000
@@ -66,23 +66,24 @@ void Dbtux::execDBINFO_SCANREQ(Signal *s
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "DBTC";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp'
--- a/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp	2009-06-15 13:31:37 +0000
@@ -726,23 +726,24 @@ void DbUtil::execDBINFO_SCANREQ(Signal *
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "DBUTIL";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 void

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2009-06-15 13:31:37 +0000
@@ -1539,23 +1539,24 @@ void Suma::execDBINFO_SCANREQ(Signal *si
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "SUMA";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

=== modified file 'storage/ndb/src/kernel/blocks/trix/Trix.cpp'
--- a/storage/ndb/src/kernel/blocks/trix/Trix.cpp	2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/trix/Trix.cpp	2009-06-15 13:31:37 +0000
@@ -520,23 +520,24 @@ void Trix::execDBINFO_SCANREQ(Signal *si
           { NULL, 0, 0}
         };
 
+    BlockNumber bn = blockToMain(number());
     for(int i=0; pools[i].poolname; i++)
     {
       dbinfo_write_row_init(&r, buf, sizeof(buf));
       dbinfo_write_row_column_uint32(&r, getOwnNodeId());
-      const char *blockname= "TRIX";
-      dbinfo_write_row_column(&r, blockname, strlen(blockname));
+      dbinfo_write_row_column_uint32(&r, bn);           // block number
+      dbinfo_write_row_column_uint32(&r, req.instance); // block instance
       dbinfo_write_row_column(&r, pools[i].poolname, strlen(pools[i].poolname));
       dbinfo_write_row_column_uint32(&r, pools[i].free);
       dbinfo_write_row_column_uint32(&r, pools[i].size);
-      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.senderRef);
+      dbinfo_send_row(signal, r, rl, req.apiTxnId, req.apiRef);
     }
   }
 
   DbinfoScanConf *conf= (DbinfoScanConf*)signal->getDataPtrSend();
   memcpy(conf,&req, DbinfoScanReq::SignalLengthWithCursor * sizeof(Uint32));
   conf->requestInfo &= ~(DbinfoScanConf::MoreData);
-  sendSignal(DBINFO_REF, GSN_DBINFO_SCANCONF,
+  sendSignal(req.senderRef, GSN_DBINFO_SCANCONF,
              signal, DbinfoScanConf::SignalLengthWithCursor, JBB);
 }
 

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20090615133137-edma6n8v30fuwsg1.bundle
Thread
bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:2909)Magnus Blåudd15 Jun