summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authortomas@poseidon.mysql.com <>2007-01-25 18:14:51 +0700
committertomas@poseidon.mysql.com <>2007-01-25 18:14:51 +0700
commit44c483cdda9ad2eb1c8d356471e0b233730d71ca (patch)
treee70f76f503ecdc086acb7e622a037ad505d7fc3f /storage
parentf05c519a6b225556fa3aa46a885d5b8571d326ac (diff)
parent6c03020b012bd7e4c346efb1d1ed30ad27e55295 (diff)
downloadmariadb-git-44c483cdda9ad2eb1c8d356471e0b233730d71ca.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
Diffstat (limited to 'storage')
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp17
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp2
2 files changed, 18 insertions, 1 deletions
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index fe10cf133c2..828ba51bc21 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -562,6 +562,7 @@ NdbEventOperationImpl::execute_nolock()
// add kernel reference
// removed on TE_STOP, TE_CLUSTER_FAILURE, or error below
m_ref_count++;
+ m_node_bit_mask.set(0u);
DBUG_PRINT("info", ("m_ref_count: %u for op: %p", m_ref_count, this));
int r= NdbDictionaryImpl::getImpl(*myDict).executeSubscribeEvent(*this);
if (r == 0) {
@@ -594,6 +595,7 @@ NdbEventOperationImpl::execute_nolock()
// remove kernel reference
// added above
m_ref_count--;
+ m_node_bit_mask.clear(0u);
DBUG_PRINT("info", ("m_ref_count: %u for op: %p", m_ref_count, this));
m_state= EO_ERROR;
mi_type= 0;
@@ -1810,6 +1812,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
op->m_ref_count, op, SubTableData::getNdbdNodeId(ri)));
break;
case NdbDictionary::Event::_TE_ACTIVE:
+ DBUG_ASSERT(op->m_node_bit_mask.get(0u) != 0);
op->m_node_bit_mask.set(SubTableData::getNdbdNodeId(ri));
// internal event, do not relay to user
DBUG_PRINT("info",
@@ -1818,7 +1821,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
DBUG_RETURN_EVENT(0);
break;
case NdbDictionary::Event::_TE_CLUSTER_FAILURE:
- if (!op->m_node_bit_mask.isclear())
+ if (op->m_node_bit_mask.get(0))
{
op->m_node_bit_mask.clear();
DBUG_ASSERT(op->m_ref_count > 0);
@@ -1838,8 +1841,14 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
op->theMainOp->m_ref_count, op->theMainOp));
}
}
+ else
+ {
+ DBUG_ASSERT(op->m_node_bit_mask.isclear() != 0);
+ }
break;
case NdbDictionary::Event::_TE_STOP:
+ DBUG_ASSERT(op->m_node_bit_mask.get(0u) != 0);
+ op->m_node_bit_mask.clear(0u);
op->m_node_bit_mask.clear(SubTableData::getNdbdNodeId(ri));
if (op->m_node_bit_mask.isclear())
{
@@ -1860,6 +1869,10 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
op->theMainOp->m_ref_count, op->theMainOp));
}
}
+ else
+ {
+ op->m_node_bit_mask.set(0u);
+ }
break;
default:
break;
@@ -2599,6 +2612,8 @@ EventBufData_list::add_gci_op(Gci_op g)
this, old_list));
delete [] old_list;
}
+ else
+ assert(old_list == 0);
DBUG_PRINT_EVENT("info", ("this: %p new m_gci_op_list: %p",
this, m_gci_op_list));
m_gci_op_alloc = n;
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
index 04a62b91002..6d58688fa88 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
@@ -421,6 +421,8 @@ public:
when m_node_bit_mask becomes clear, the kernel reference is
removed from m_ref_count
+
+ node id 0 is used to denote that cluster has a reference
*/
Bitmask<(unsigned int)_NDB_NODE_BITMASK_SIZE> m_node_bit_mask;