Skip to content

Commit 7d3791a

Browse files
Ole John Askedahlerlend
authored andcommitted
Bug#33800633 startChangeNeighbour problem
Revert of original patch. Testing with debug binaries has revealed problems with hitting several different assert related to handling of the TrpId queue mechanism. Likely cause is that get_trp() seems to deliver the same TrpId to two different (assist_send-threads), one where the TrpId is delivered through the neighbour priority mechaninsm, and another where it is delivered as a non-neighbour. If this happens it breaks the protection mechanisms if the transporter buffers, where only a single threads is assumed to operate on the same TrpId. Root cause may be that the patch now being reverted called insert_trp() on transporters having data to sent as part of startChangeNeighbourNode() - making it a non-neighbour TrpId awaiting sends. However, the later call to setNeighbourNode() may reinstantiate the same NodeId as a neighbour again. Thus the same TrpId coulde be returned both as a non-neighbour as a neighbour and be operated upon on two different threads. Change-Id: Icada4600e008d551e97af2b31abd070f5e4ac68a
1 parent cfeaa26 commit 7d3791a

File tree

1 file changed

+4
-9
lines changed
  • storage/ndb/src/kernel/vm

1 file changed

+4
-9
lines changed

storage/ndb/src/kernel/vm/mt.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,21 +2049,16 @@ class thr_send_threads {
20492049
NdbMutex_Unlock(m_send_threads[send_instance].send_thread_mutex);
20502050
}
20512051
void startChangeNeighbourNode() {
2052-
for (Uint32 i = 0; i < MAX_NTRANSPORTERS; i++) {
2053-
m_trp_state[i].m_neighbour_trp = false;
2054-
}
20552052
for (Uint32 i = 0; i < globalData.ndbMtSendThreads; i++) {
20562053
NdbMutex_Lock(m_send_threads[i].send_thread_mutex);
2057-
for (Uint32 j = 0; j < m_send_threads[i].m_num_neighbour_trps; j++) {
2058-
const TrpId trp_id = m_send_threads[i].m_neighbour_trps[j];
2059-
if (m_trp_state[trp_id].m_data_available > 0) {
2060-
// Was a neighbour with pending sends, add to send-queue.
2061-
insert_trp(m_send_threads[i].m_neighbour_trps[j], &m_send_threads[i]);
2062-
}
2054+
for (Uint32 j = 0; j < MAX_NEIGHBOURS; j++) {
20632055
m_send_threads[i].m_neighbour_trps[j] = 0;
20642056
}
20652057
m_send_threads[i].m_num_neighbour_trps = 0;
20662058
}
2059+
for (Uint32 i = 0; i < MAX_NTRANSPORTERS; i++) {
2060+
m_trp_state[i].m_neighbour_trp = false;
2061+
}
20672062
}
20682063
void setNeighbourNode(NodeId nodeId) {
20692064
TrpId trpId[MAX_NODE_GROUP_TRANSPORTERS];

0 commit comments

Comments
 (0)