3578 jonas oreland 2011-10-13 [merge]
ndb - merge 71 to 72
modified:
mysql-test/suite/ndb/r/ndbinfo.result
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp
storage/ndb/src/kernel/vm/DLHashTable.hpp
storage/ndb/src/kernel/vm/NdbinfoTables.cpp
3577 Jonas Oreland 2011-10-12 [merge]
ndb - merge 71 to 72
modified:
mysql-test/suite/ndb/r/ndb_basic.result
mysql-test/suite/ndb/r/ndb_index_stat.result
mysql-test/suite/ndb/r/ndbinfo.result
sql/ha_ndb_index_stat.cc
sql/ha_ndb_index_stat.h
sql/ha_ndbcluster.cc
storage/ndb/include/ndb_constants.h
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
storage/ndb/src/kernel/vm/Ndbinfo.hpp
storage/ndb/src/kernel/vm/NdbinfoTables.cpp
storage/ndb/test/include/HugoCalculator.hpp
storage/ndb/test/include/HugoOperations.hpp
storage/ndb/test/src/HugoOperations.cpp
=== modified file 'mysql-test/suite/ndb/r/ndbinfo.result'
--- a/mysql-test/suite/ndb/r/ndbinfo.result 2011-10-12 11:33:43 +0000
+++ b/mysql-test/suite/ndb/r/ndbinfo.result 2011-10-13 17:13:02 +0000
@@ -37,7 +37,7 @@ table_id table_name comment
9 nodes node status
10 diskpagebuffer disk page buffer info
11 threadblocks which blocks are run in which threads
-12 threadstat threadstat
+12 threadstat Statistics on execution threads
13 transactions transactions
14 operations operations
SELECT COUNT(*) FROM ndb$tables;
@@ -54,7 +54,7 @@ table_id table_name comment
9 nodes node status
10 diskpagebuffer disk page buffer info
11 threadblocks which blocks are run in which threads
-12 threadstat threadstat
+12 threadstat Statistics on execution threads
13 transactions transactions
14 operations operations
SELECT * FROM ndb$tables WHERE table_name = 'LOGDESTINATION';
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2011-10-12 11:33:43 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2011-10-13 17:13:02 +0000
@@ -2687,10 +2687,7 @@ private:
bool validate_filter(Signal*);
bool match_and_print(Signal*, Ptr<TcConnectionrec>);
- void ndbinfo_write_op(Signal* signal,
- DbinfoScanReq * req,
- Ndbinfo::Ratelimit * rl,
- TcConnectionrecPtr tcPtr);
+ void ndbinfo_write_op(Ndbinfo::Row&, TcConnectionrecPtr tcPtr);
void define_backup(Signal*);
void execDEFINE_BACKUP_REF(Signal*);
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-10-12 11:33:43 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-10-13 17:13:02 +0000
@@ -23422,7 +23422,9 @@ void Dblqh::execDBINFO_SCANREQ(Signal *s
{
jam();
ptrCheckGuard(tcPtr, ctcConnectrecFileSize, tcConnectionrec);
- ndbinfo_write_op(signal, &req, &rl, tcPtr);
+ Ndbinfo::Row row(signal, req);
+ ndbinfo_write_op(row, tcPtr);
+ ndbinfo_send_row(signal, req, row, rl);
tcPtr.i = tcPtr.p->nextHashRec;
}
bucket++;
@@ -23437,12 +23439,8 @@ void Dblqh::execDBINFO_SCANREQ(Signal *s
}
void
-Dblqh::ndbinfo_write_op(Signal* signal,
- DbinfoScanReq * req,
- Ndbinfo::Ratelimit * rl,
- TcConnectionrecPtr tcPtr)
+Dblqh::ndbinfo_write_op(Ndbinfo::Row & row, TcConnectionrecPtr tcPtr)
{
- Ndbinfo::Row row(signal, *req);
row.write_uint32(getOwnNodeId());
row.write_uint32(instance()); // block instance
row.write_uint32(tcPtr.i); // objid
@@ -23511,8 +23509,6 @@ Dblqh::ndbinfo_write_op(Signal* signal,
row.write_uint32(tcPtr.p->transactionState);
row.write_uint32(0);
}
-
- ndbinfo_send_row(signal, *req, row, *rl);
}
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2011-10-07 18:15:59 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2011-10-13 17:13:02 +0000
@@ -1986,10 +1986,7 @@ private:
bool validate_filter(Signal*);
bool match_and_print(Signal*, ApiConnectRecordPtr);
- void ndbinfo_write_trans(Signal* signal,
- DbinfoScanReq * req,
- Ndbinfo::Ratelimit * rl,
- ApiConnectRecordPtr transPtr);
+ bool ndbinfo_write_trans(Ndbinfo::Row&, ApiConnectRecordPtr);
#ifdef ERROR_INSERT
bool testFragmentDrop(Signal* signal);
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-10-07 18:15:59 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-10-13 17:13:02 +0000
@@ -13295,7 +13295,12 @@ void Dbtc::execDBINFO_SCANREQ(Signal *si
for (Uint32 i = 0; i < maxloop; i++)
{
ptrCheckGuard(ptr, capiConnectFilesize, apiConnectRecord);
- ndbinfo_write_trans(signal, &req, &rl, ptr);
+ Ndbinfo::Row row(signal, req);
+ if (ndbinfo_write_trans(row, ptr))
+ {
+ jam();
+ ndbinfo_send_row(signal, req, row, rl);
+ }
ptr.i ++;
if (ptr.i == capiConnectFilesize)
@@ -13318,11 +13323,8 @@ done:
ndbinfo_send_scan_conf(signal, req, rl);
}
-void
-Dbtc::ndbinfo_write_trans(Signal* signal,
- DbinfoScanReq * req,
- Ndbinfo::Ratelimit * rl,
- ApiConnectRecordPtr transPtr)
+bool
+Dbtc::ndbinfo_write_trans(Ndbinfo::Row & row, ApiConnectRecordPtr transPtr)
{
Uint32 conState = transPtr.p->apiConnectstate;
@@ -13338,7 +13340,7 @@ Dbtc::ndbinfo_write_trans(Signal* signal
conState == CS_DISCONNECTED ||
conState == CS_RESTART)
{
- return;
+ return false;
}
char transid[64];
@@ -13347,7 +13349,6 @@ Dbtc::ndbinfo_write_trans(Signal* signal
transPtr.p->transid[0],
transPtr.p->transid[1]);
- Ndbinfo::Row row(signal, *req);
row.write_uint32(getOwnNodeId());
row.write_uint32(instance()); // block instance
row.write_uint32(transPtr.i);
@@ -13404,7 +13405,7 @@ Dbtc::ndbinfo_write_trans(Signal* signal
Uint32 apiTimer = getApiConTimer(transPtr.i);
row.write_uint32(apiTimer ? (ctcTimer - apiTimer) / 100 : 0);
- ndbinfo_send_row(signal, *req, row, *rl);
+ return true;
}
bool
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-10-13 17:13:02 +0000
@@ -842,6 +842,8 @@ public:
static Uint32 mt_buildIndexFragment_wrapper(void*);
private:
Uint32 mt_buildIndexFragment(struct mt_BuildIndxCtx*);
+
+ Signal* c_signal_bug32040;
};
// Dbtux::TupLoc
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp 2011-10-13 17:13:02 +0000
@@ -91,6 +91,8 @@ Dbtux::Dbtux(Block_context& ctx, Uint32
addRecSignal(GSN_NODE_STATE_REP, &Dbtux::execNODE_STATE_REP, true);
addRecSignal(GSN_DROP_FRAG_REQ, &Dbtux::execDROP_FRAG_REQ);
+
+ c_signal_bug32040 = 0;
}
Dbtux::~Dbtux()
@@ -153,6 +155,7 @@ Dbtux::execSTTOR(Signal* signal)
CLEAR_ERROR_INSERT_VALUE;
c_tup = (Dbtup*)globalData.getBlock(DBTUP, instance());
ndbrequire(c_tup != 0);
+ c_signal_bug32040 = signal;
break;
case 3:
jam();
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-10-13 17:13:02 +0000
@@ -911,7 +911,11 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool
}
#endif
// cannot be moved away from tuple we have locked
+#if defined VM_TRACE || defined ERROR_INSERT
ndbrequire(scan.m_state != ScanOp::Locked);
+#else
+ ndbrequire(fromMaintReq || scan.m_state != ScanOp::Locked);
+#endif
// scan direction
const unsigned idir = scan.m_descending; // 0, 1
const int jdir = 1 - 2 * (int)idir; // 1, -1
@@ -921,6 +925,24 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool
NodeHandle origNode(frag);
selectNode(origNode, pos.m_loc);
ndbrequire(islinkScan(origNode, scanPtr));
+ if (unlikely(scan.m_state == ScanOp::Locked)) {
+ // bug#32040 - no fix, just unlock and continue
+ jam();
+ if (scan.m_accLockOp != RNIL) {
+ jam();
+ Signal* signal = c_signal_bug32040;
+ AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend();
+ lockReq->returnCode = RNIL;
+ lockReq->requestInfo = AccLockReq::Abort;
+ lockReq->accOpPtr = scan.m_accLockOp;
+ EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ, signal, AccLockReq::UndoSignalLength);
+ jamEntry();
+ ndbrequire(lockReq->returnCode == AccLockReq::Success);
+ scan.m_accLockOp = RNIL;
+ scan.m_lockwait = false;
+ }
+ scan.m_state = ScanOp::Next;
+ }
// current node in loop
NodeHandle node = origNode;
// copy of entry found
=== modified file 'storage/ndb/src/kernel/vm/DLHashTable.hpp'
--- a/storage/ndb/src/kernel/vm/DLHashTable.hpp 2011-10-07 18:15:59 +0000
+++ b/storage/ndb/src/kernel/vm/DLHashTable.hpp 2011-10-13 17:13:02 +0000
@@ -27,11 +27,16 @@
* (with a double linked list)
*
* The entries in the hashtable must have the following methods:
- * -# bool equal(const class T &) const;
+ * -# bool U::equal(const class U &) const;
* Which should return equal if the to objects have the same key
- * -# Uint32 hashValue() const;
+ * -# Uint32 U::hashValue() const;
* Which should return a 32 bit hashvalue
+ *
+ * and the following members:
+ * -# Uint32 U::nextHash;
+ * -# Uint32 U::prevHash;
*/
+
template <typename P, typename T, typename U = T>
class DLHashTableImpl
{
@@ -211,7 +216,7 @@ inline
void
DLHashTableImpl<P, T, U>::add(Ptr<T> & obj)
{
- const Uint32 hv = obj.p->hashValue() & mask;
+ const Uint32 hv = obj.p->U::hashValue() & mask;
const Uint32 i = hashValues[hv];
if(i == RNIL)
@@ -288,7 +293,7 @@ inline
void
DLHashTableImpl<P, T, U>::remove(Ptr<T> & ptr, const T & key)
{
- const Uint32 hv = key.hashValue() & mask;
+ const Uint32 hv = key.U::hashValue() & mask;
Uint32 i;
T * p;
@@ -300,7 +305,7 @@ DLHashTableImpl<P, T, U>::remove(Ptr<T>
while(i != RNIL)
{
p = thePool.getPtr(i);
- if(key.equal(* p))
+ if(key.U::equal(* p))
{
const Uint32 next = p->U::nextHash;
if(prev.i == RNIL)
@@ -366,7 +371,7 @@ DLHashTableImpl<P, T, U>::remove(Ptr<T>
}
else
{
- const Uint32 hv = ptr.p->hashValue() & mask;
+ const Uint32 hv = ptr.p->U::hashValue() & mask;
if (hashValues[hv] == ptr.i)
{
hashValues[hv] = next;
@@ -400,7 +405,7 @@ DLHashTableImpl<P, T, U>::release(Ptr<T>
}
else
{
- const Uint32 hv = ptr.p->hashValue() & mask;
+ const Uint32 hv = ptr.p->U::hashValue() & mask;
if (hashValues[hv] == ptr.i)
{
hashValues[hv] = next;
@@ -493,7 +498,7 @@ inline
bool
DLHashTableImpl<P, T, U>::find(Ptr<T> & ptr, const T & key) const
{
- const Uint32 hv = key.hashValue() & mask;
+ const Uint32 hv = key.U::hashValue() & mask;
Uint32 i;
T * p;
@@ -502,7 +507,7 @@ DLHashTableImpl<P, T, U>::find(Ptr<T> &
while(i != RNIL)
{
p = thePool.getPtr(i);
- if(key.equal(* p))
+ if(key.U::equal(* p))
{
ptr.i = i;
ptr.p = p;
=== modified file 'storage/ndb/src/kernel/vm/NdbinfoTables.cpp'
--- a/storage/ndb/src/kernel/vm/NdbinfoTables.cpp 2011-10-12 11:33:43 +0000
+++ b/storage/ndb/src/kernel/vm/NdbinfoTables.cpp 2011-10-13 17:13:02 +0000
@@ -172,68 +172,68 @@ DECLARE_NDBINFO_TABLE(DISKPAGEBUFFER, 9)
DECLARE_NDBINFO_TABLE(THREADBLOCKS, 4) =
{ { "threadblocks", 4, 0, "which blocks are run in which threads" },
{
- {"node_id", Ndbinfo::Number, ""},
- {"thr_no", Ndbinfo::Number, ""},
- {"block_number", Ndbinfo::Number, ""},
- {"block_instance", Ndbinfo::Number, ""},
+ {"node_id", Ndbinfo::Number, "node id"},
+ {"thr_no", Ndbinfo::Number, "thread number"},
+ {"block_number", Ndbinfo::Number, "block number"},
+ {"block_instance", Ndbinfo::Number, "block instance"},
}
};
DECLARE_NDBINFO_TABLE(THREADSTAT, 18) =
-{ { "threadstat", 18, 0, "threadstat" },
+{ { "threadstat", 18, 0, "Statistics on execution threads" },
{
//{"0123456701234567"}
- {"node_id", Ndbinfo::Number, ""},
- {"thr_no", Ndbinfo::Number, ""},
- {"thr_nm", Ndbinfo::String, ""},
- {"c_loop", Ndbinfo::Number64,""},
- {"c_exec", Ndbinfo::Number64,""},
- {"c_wait", Ndbinfo::Number64,""},
- {"c_l_sent_prioa", Ndbinfo::Number64,""},
- {"c_l_sent_priob", Ndbinfo::Number64,""},
- {"c_r_sent_prioa", Ndbinfo::Number64,""},
- {"c_r_sent_priob", Ndbinfo::Number64,""},
- {"os_tid", Ndbinfo::Number64,""},
- {"os_now", Ndbinfo::Number64,""},
- {"os_ru_utime", Ndbinfo::Number64,""},
- {"os_ru_stime", Ndbinfo::Number64,""},
- {"os_ru_minflt", Ndbinfo::Number64,""},
- {"os_ru_majflt", Ndbinfo::Number64,""},
- {"os_ru_nvcsw", Ndbinfo::Number64,""},
- {"os_ru_nivcsw", Ndbinfo::Number64,""}
+ {"node_id", Ndbinfo::Number, "node id"},
+ {"thr_no", Ndbinfo::Number, "thread number"},
+ {"thr_nm", Ndbinfo::String, "thread name"},
+ {"c_loop", Ndbinfo::Number64,"No of loops in main loop"},
+ {"c_exec", Ndbinfo::Number64,"No of signals executed"},
+ {"c_wait", Ndbinfo::Number64,"No of times waited for more input"},
+ {"c_l_sent_prioa", Ndbinfo::Number64,"No of prio A signals sent to own node"},
+ {"c_l_sent_priob", Ndbinfo::Number64,"No of prio B signals sent to own node"},
+ {"c_r_sent_prioa", Ndbinfo::Number64,"No of prio A signals sent to remote node"},
+ {"c_r_sent_priob", Ndbinfo::Number64,"No of prio B signals sent to remote node"},
+ {"os_tid", Ndbinfo::Number64,"OS thread id"},
+ {"os_now", Ndbinfo::Number64,"OS gettimeofday (millis)"},
+ {"os_ru_utime", Ndbinfo::Number64,"OS user CPU time (micros)"},
+ {"os_ru_stime", Ndbinfo::Number64,"OS system CPU time (micros)"},
+ {"os_ru_minflt", Ndbinfo::Number64,"OS page reclaims (soft page faults"},
+ {"os_ru_majflt", Ndbinfo::Number64,"OS page faults (hard page faults)"},
+ {"os_ru_nvcsw", Ndbinfo::Number64,"OS voluntary context switches"},
+ {"os_ru_nivcsw", Ndbinfo::Number64,"OS involuntary context switches"}
}
};
DECLARE_NDBINFO_TABLE(TRANSACTIONS, 10) =
{ { "transactions", 10, 0, "transactions" },
{
- {"node_id", Ndbinfo::Number, ""},
- {"block_instance", Ndbinfo::Number, ""},
- {"objid", Ndbinfo::Number, ""},
- {"apiref", Ndbinfo::Number, ""},
- {"transid", Ndbinfo::String, ""},
- {"state", Ndbinfo::Number, ""},
- {"flags", Ndbinfo::Number, ""},
- {"c_ops", Ndbinfo::Number, "No of operations" },
- {"outstanding", Ndbinfo::Number, "Outstanding request" },
- {"timer", Ndbinfo::Number, "(in seconds)"},
+ {"node_id", Ndbinfo::Number, "node id"},
+ {"block_instance", Ndbinfo::Number, "TC instance no"},
+ {"objid", Ndbinfo::Number, "Object id of transaction object"},
+ {"apiref", Ndbinfo::Number, "API reference"},
+ {"transid", Ndbinfo::String, "Transaction id"},
+ {"state", Ndbinfo::Number, "Transaction state"},
+ {"flags", Ndbinfo::Number, "Transaction flags"},
+ {"c_ops", Ndbinfo::Number, "No of operations in transaction" },
+ {"outstanding", Ndbinfo::Number, "Currently outstanding request" },
+ {"timer", Ndbinfo::Number, "Timer (seconds)"},
}
};
DECLARE_NDBINFO_TABLE(OPERATIONS, 11) =
{ { "operations", 11, 0, "operations" },
{
- {"node_id", Ndbinfo::Number, ""},
- {"block_instance", Ndbinfo::Number, ""},
- {"objid", Ndbinfo::Number, ""},
- {"tcref", Ndbinfo::Number, ""},
- {"apiref", Ndbinfo::Number, ""},
- {"transid", Ndbinfo::String, ""},
- {"tableid", Ndbinfo::Number, ""},
- {"fragmentid", Ndbinfo::Number, ""},
- {"op", Ndbinfo::Number, ""},
- {"state", Ndbinfo::Number, ""},
- {"flags", Ndbinfo::Number, ""}
+ {"node_id", Ndbinfo::Number, "node id"},
+ {"block_instance", Ndbinfo::Number, "LQH instance no"},
+ {"objid", Ndbinfo::Number, "Object id of operation object"},
+ {"tcref", Ndbinfo::Number, "TC reference"},
+ {"apiref", Ndbinfo::Number, "API reference"},
+ {"transid", Ndbinfo::String, "Transaction id"},
+ {"tableid", Ndbinfo::Number, "Table id"},
+ {"fragmentid", Ndbinfo::Number, "Fragment id"},
+ {"op", Ndbinfo::Number, "Operation type"},
+ {"state", Ndbinfo::Number, "Operation state"},
+ {"flags", Ndbinfo::Number, "Operation flags"}
}
};
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-cluster branch (jonas.oreland:3577 to 3578) | jonas oreland | 14 Oct |