When processing "MBCSV_PEER_UP_MSG" msg in case dispatch all from user, the msg may be too old. The msg may be come from the node that already rebooted. This reason cause mbcsv loop forever in WHILE loop, because the active node cannot find the adest of peer msg.
The solution is that find entity in peer list and compare if the peer node id that already exist. If the peer node id exist in the entity (get node id from peer anchor), this mean that mbcsv already processed the "MBCSV_PEER_UP_MSG" for that peer node. --- src/mbc/mbcsv_peer.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/mbc/mbcsv_peer.c b/src/mbc/mbcsv_peer.c index f863591c4..736c015c2 100644 --- a/src/mbc/mbcsv_peer.c +++ b/src/mbc/mbcsv_peer.c @@ -64,7 +64,7 @@ static const char *disc_trace[] = {"Peer UP msg", "Peer DOWN msg", * peer entity and returns peer pointer. * * Input: peer_list - MBCSv peer list. -* anchor - Anchor value of the peer to be serched in the list. +* anchor - Anchor value of the peer to be searched in the list. * * Returns: Peer instance pointer. * @@ -83,6 +83,36 @@ PEER_INST *mbcsv_search_and_return_peer(PEER_INST *peer_list, return NULL; } +/**************************************************************************\ +* PROCEDURE: mbcsv_check_if_peer_node_id_exist +* +* Purpose: This function searches entire MBCA peer list for the peer entity +* and checking if the peer nodeId is exist in peer entity +* +* Input: peer_list - MBCSv peer list. +* anchor - Anchor value of the peer to be searched in the list. +* +* Returns: True/False +* +* Notes: +* +\**************************************************************************/ +bool mbcsv_check_if_peer_node_id_exist(PEER_INST *peer_list, + MBCSV_ANCHOR anchor) +{ + PEER_INST *peer; + uint32_t node_id; + uint32_t peer_node_id = anchor >> 32; + + for (peer = peer_list; peer != NULL; peer = peer->next) { + node_id = peer->peer_anchor >> 32; + if (node_id == peer_node_id) + return true; + } + + return false; +} + /**************************************************************************\ * PROCEDURE: mbcsv_add_new_peer * @@ -733,6 +763,15 @@ uint32_t mbcsv_process_peer_up_info(MBCSV_EVT *msg, CKPT_INST *ckpt, } } + // If the node id exist in any peer entity of the peer list, we already + // got peer up message for that peer node. So This peer up message + // is invalid and just ignore it. Fixed bug #2899 + if (mbcsv_check_if_peer_node_id_exist( + ckpt->peer_list, msg->rcvr_peer_key.peer_anchor) == true) { + TRACE_LEAVE2("Peer up message is too old. Just ignore this"); + return NCSCC_RC_SUCCESS; + } + if (0 != (mbx = mbcsv_get_mbx(msg->rcvr_peer_key.pwe_hdl, msg->rcvr_peer_key.svc_id))) { -- 2.15.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel