Commit 44c483cd authored by tomas@poseidon.mysql.com's avatar tomas@poseidon.mysql.com

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1

into  poseidon.mysql.com:/home/tomas/mysql-5.1-new-ndb
parents f05c519a 6c03020b
...@@ -562,6 +562,7 @@ NdbEventOperationImpl::execute_nolock() ...@@ -562,6 +562,7 @@ NdbEventOperationImpl::execute_nolock()
// add kernel reference // add kernel reference
// removed on TE_STOP, TE_CLUSTER_FAILURE, or error below // removed on TE_STOP, TE_CLUSTER_FAILURE, or error below
m_ref_count++; m_ref_count++;
m_node_bit_mask.set(0u);
DBUG_PRINT("info", ("m_ref_count: %u for op: %p", m_ref_count, this)); DBUG_PRINT("info", ("m_ref_count: %u for op: %p", m_ref_count, this));
int r= NdbDictionaryImpl::getImpl(*myDict).executeSubscribeEvent(*this); int r= NdbDictionaryImpl::getImpl(*myDict).executeSubscribeEvent(*this);
if (r == 0) { if (r == 0) {
...@@ -594,6 +595,7 @@ NdbEventOperationImpl::execute_nolock() ...@@ -594,6 +595,7 @@ NdbEventOperationImpl::execute_nolock()
// remove kernel reference // remove kernel reference
// added above // added above
m_ref_count--; m_ref_count--;
m_node_bit_mask.clear(0u);
DBUG_PRINT("info", ("m_ref_count: %u for op: %p", m_ref_count, this)); DBUG_PRINT("info", ("m_ref_count: %u for op: %p", m_ref_count, this));
m_state= EO_ERROR; m_state= EO_ERROR;
mi_type= 0; mi_type= 0;
...@@ -1810,6 +1812,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op, ...@@ -1810,6 +1812,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
op->m_ref_count, op, SubTableData::getNdbdNodeId(ri))); op->m_ref_count, op, SubTableData::getNdbdNodeId(ri)));
break; break;
case NdbDictionary::Event::_TE_ACTIVE: case NdbDictionary::Event::_TE_ACTIVE:
DBUG_ASSERT(op->m_node_bit_mask.get(0u) != 0);
op->m_node_bit_mask.set(SubTableData::getNdbdNodeId(ri)); op->m_node_bit_mask.set(SubTableData::getNdbdNodeId(ri));
// internal event, do not relay to user // internal event, do not relay to user
DBUG_PRINT("info", DBUG_PRINT("info",
...@@ -1818,7 +1821,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op, ...@@ -1818,7 +1821,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
DBUG_RETURN_EVENT(0); DBUG_RETURN_EVENT(0);
break; break;
case NdbDictionary::Event::_TE_CLUSTER_FAILURE: 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(); op->m_node_bit_mask.clear();
DBUG_ASSERT(op->m_ref_count > 0); DBUG_ASSERT(op->m_ref_count > 0);
...@@ -1838,8 +1841,14 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op, ...@@ -1838,8 +1841,14 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
op->theMainOp->m_ref_count, op->theMainOp)); op->theMainOp->m_ref_count, op->theMainOp));
} }
} }
else
{
DBUG_ASSERT(op->m_node_bit_mask.isclear() != 0);
}
break; break;
case NdbDictionary::Event::_TE_STOP: 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)); op->m_node_bit_mask.clear(SubTableData::getNdbdNodeId(ri));
if (op->m_node_bit_mask.isclear()) if (op->m_node_bit_mask.isclear())
{ {
...@@ -1860,6 +1869,10 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op, ...@@ -1860,6 +1869,10 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
op->theMainOp->m_ref_count, op->theMainOp)); op->theMainOp->m_ref_count, op->theMainOp));
} }
} }
else
{
op->m_node_bit_mask.set(0u);
}
break; break;
default: default:
break; break;
...@@ -2599,6 +2612,8 @@ EventBufData_list::add_gci_op(Gci_op g) ...@@ -2599,6 +2612,8 @@ EventBufData_list::add_gci_op(Gci_op g)
this, old_list)); this, old_list));
delete [] old_list; delete [] old_list;
} }
else
assert(old_list == 0);
DBUG_PRINT_EVENT("info", ("this: %p new m_gci_op_list: %p", DBUG_PRINT_EVENT("info", ("this: %p new m_gci_op_list: %p",
this, m_gci_op_list)); this, m_gci_op_list));
m_gci_op_alloc = n; m_gci_op_alloc = n;
......
...@@ -421,6 +421,8 @@ public: ...@@ -421,6 +421,8 @@ public:
when m_node_bit_mask becomes clear, the kernel reference is when m_node_bit_mask becomes clear, the kernel reference is
removed from m_ref_count 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; Bitmask<(unsigned int)_NDB_NODE_BITMASK_SIZE> m_node_bit_mask;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment