diff options
Diffstat (limited to 'storage/ndb')
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/suma/Suma.cpp | 9 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp | 22 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp | 6 |
4 files changed, 32 insertions, 7 deletions
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index ba5920415e9..25eea0087b4 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -348,7 +348,7 @@ void Dbdict::packTableIntoPages(Signal* signal) memset(&pagePtr.p->word[0], 0, 4 * ZPAGE_HEADER_SIZE); LinearWriter w(&pagePtr.p->word[ZPAGE_HEADER_SIZE], - 8 * ZSIZE_OF_PAGES_IN_WORDS); + ZMAX_PAGES_OF_TABLE_DEFINITION * ZSIZE_OF_PAGES_IN_WORDS); w.first(); switch((DictTabInfo::TableType)type) { case DictTabInfo::SystemTable: diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index f68d36c6c0e..1ad78034eae 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -2565,6 +2565,9 @@ Suma::reportAllSubscribers(Signal *signal, return; } +#ifdef VM_TRACE + ndbout_c("reportAllSubscribers"); +#endif SubTableData * data = (SubTableData*)signal->getDataPtrSend(); data->gci = m_last_complete_gci + 1; data->tableId = subPtr.p->m_tableId; @@ -2591,6 +2594,12 @@ Suma::reportAllSubscribers(Signal *signal, data->senderData = subbPtr.p->m_senderData; sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal, SubTableData::SignalLength, JBB); +#ifdef VM_TRACE + ndbout_c("sent %s(%d) to node %d", + table_event == NdbDictionary::Event::_TE_SUBSCRIBE ? + "SUBSCRIBE" : "UNSUBSCRIBE", (int) table_event, + refToNode(subbPtr.p->m_senderRef)); +#endif } } } diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp index b491e00ba65..f282ab825f0 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp @@ -1173,15 +1173,17 @@ NdbEventBuffer::nextEvent() NdbEventOperationImpl* NdbEventBuffer::getGCIEventOperations(Uint32* iter, Uint32* event_types) { + DBUG_ENTER("NdbEventBuffer::getGCIEventOperations"); EventBufData_list::Gci_ops *gci_ops = m_available_data.first_gci_ops(); if (*iter < gci_ops->m_gci_op_count) { EventBufData_list::Gci_op g = gci_ops->m_gci_op_list[(*iter)++]; if (event_types != NULL) *event_types = g.event_types; - return g.op; + DBUG_PRINT("info", ("gci: %d", (unsigned)gci_ops->m_gci)); + DBUG_RETURN(g.op); } - return NULL; + DBUG_RETURN(NULL); } void @@ -1647,11 +1649,19 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op, else { // event with same op, PK found, merge into old buffer + Uint32 old_op = data->sdata->operation; if (unlikely(merge_data(sdata, ptr, data))) { op->m_has_error = 3; DBUG_RETURN_EVENT(-1); } + Uint32 new_op = data->sdata->operation; + + // make Gci_ops reflect the merge by delete old and add new + EventBufData_list::Gci_op g = { op, (1 << old_op) }; + // bucket->m_data.del_gci_op(g); // XXX whats wrong? fix later + g.event_types = (1 << new_op); + bucket->m_data.add_gci_op(g); } DBUG_RETURN_EVENT(0); } @@ -2184,7 +2194,7 @@ void EventBufData_list::append_list(EventBufData_list *list, Uint64 gci) } void -EventBufData_list::add_gci_op(Gci_op g) +EventBufData_list::add_gci_op(Gci_op g, bool del) { assert(g.op != NULL); Uint32 i; @@ -2193,7 +2203,10 @@ EventBufData_list::add_gci_op(Gci_op g) break; } if (i < m_gci_op_count) { - m_gci_op_list[i].event_types |= g.event_types; + if (! del) + m_gci_op_list[i].event_types |= g.event_types; + else + m_gci_op_list[i].event_types &= ~ g.event_types; } else { if (m_gci_op_count == m_gci_op_alloc) { Uint32 n = 1 + 2 * m_gci_op_alloc; @@ -2207,6 +2220,7 @@ EventBufData_list::add_gci_op(Gci_op g) m_gci_op_alloc = n; } assert(m_gci_op_count < m_gci_op_alloc); + assert(! del); m_gci_op_list[m_gci_op_count++] = g; } } diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp index 9ce85a61361..044ac58ade1 100644 --- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp +++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp @@ -129,9 +129,11 @@ public: }; Gci_ops *first_gci_ops(); Gci_ops *next_gci_ops(); -private: // case 1 above; add Gci_op to single list - void add_gci_op(Gci_op g); + void add_gci_op(Gci_op g, bool del = false); + // delete bit from existing flags + void del_gci_op(Gci_op g) { add_gci_op(g, true); } +private: // case 2 above; move single list or multi list from // one list to another void move_gci_ops(EventBufData_list *list, Uint64 gci); |