From: Thien M. H. <thi...@de...> - 2024-06-03 07:56:28
|
Hi Thang, ACK with 4 minor comments. Best Regards, Thien -----Original Message----- From: Thang Duc Nguyen <tha...@de...> Sent: Saturday, May 25, 2024 6:21 PM To: Thien Minh Huynh <thi...@de...>; Dat Tran Quoc Phan <dat...@de...> Cc: ope...@li...; Thang Duc Nguyen <tha...@de...> Subject: [PATCH 1/1] clm: fix error printed in syslog [#3353] When the opensafd starts failed. The systemd tries to restart opensafd service. The CLMD did not update nodeup state correctly and it causes the error message. The fix is to correct that state. --- src/clm/clmd/clms_evt.cc | 35 ++++++++++++++++++++++++++++++++++- src/clm/clmd/clms_evt.h | 2 ++ src/clm/clmd/clms_mds.cc | 4 ++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/clm/clmd/clms_evt.cc b/src/clm/clmd/clms_evt.cc index 83fe76a1a..9ad7e4d25 100644 --- a/src/clm/clmd/clms_evt.cc +++ b/src/clm/clmd/clms_evt.cc @@ -39,6 +39,7 @@ static uint32_t process_api_evt(CLMSV_CLMS_EVT *evt); static uint32_t proc_clma_updn_mds_msg(CLMSV_CLMS_EVT *evt); +static uint32_t proc_clmna_updn_mds_msg(CLMSV_CLMS_EVT *evt); static uint32_t proc_mds_node_evt(CLMSV_CLMS_EVT *evt); static uint32_t proc_rda_evt(CLMSV_CLMS_EVT *evt); static uint32_t proc_mds_quiesced_ack_msg(CLMSV_CLMS_EVT *evt); @@ -77,7 +78,11 @@ static const CLMSV_CLMS_EVT_HANDLER clms_clmsv_top_level_evt_dispatch_tbl[] = { proc_mds_quiesced_ack_msg, proc_node_lock_tmr_exp_msg, proc_mds_node_evt, - proc_rda_evt}; + proc_rda_evt, + nullptr, + nullptr, + proc_clmna_updn_mds_msg, + proc_clmna_updn_mds_msg}; static const CLMSV_CLMS_CLMA_API_MSG_HANDLER clms_clma_api_msg_dispatcher[] = { proc_initialize_msg, proc_finalize_msg, proc_track_start_msg, @@ -1016,7 +1021,31 @@ done: * @return NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE * */ [Thien] Correct description of this function. [Thien] Handle return code for failure case. +static uint32_t proc_clmna_updn_mds_msg(CLMSV_CLMS_EVT *evt) { + TRACE_ENTER(); + uint32_t rc = NCSCC_RC_SUCCESS; + SaClmNodeIdT node_id = evt->info.node_mds_info.node_id; + CLMS_CLUSTER_NODE *node = nullptr; + node = clms_node_get_by_id(node_id); + if (node == nullptr) { + LOG_WA("node is not exist"); + return rc; + } + + switch (evt->type) { + case CLMSV_CLMS_CLMNA_UP: + break; + case CLMSV_CLMS_CLMNA_DOWN: + node->nodeup = SA_FALSE; + break; + default: + TRACE("Unknown evt type!!!"); + break; [Thien] Correct indent + } + TRACE_LEAVE(); + return rc; +} static uint32_t proc_clma_updn_mds_msg(CLMSV_CLMS_EVT *evt) { TRACE_ENTER(); CLMS_CKPT_REC ckpt; @@ -1740,6 +1769,10 @@ void clms_process_mbx(SYSF_MBX *mbx) { clms_clmsv_top_level_evt_dispatch_tbl[msg->type](msg); break; [Thien] I suggest merge CLMSV_CLMS_CLMA_DOWN and CLMSV_CLMS_CLMNA_DOWN to the same one instead of separate about case. + case CLMSV_CLMS_CLMNA_DOWN: + clms_clmsv_top_level_evt_dispatch_tbl[msg->type](msg); + break; + case CLSMV_CLMS_QUIESCED_ACK: if (clms_cb->ha_state == SA_AMF_HA_ACTIVE) { proc_mds_quiesced_ack_msg(msg); diff --git a/src/clm/clmd/clms_evt.h b/src/clm/clmd/clms_evt.h index 1005456f9..0e694d580 100644 --- a/src/clm/clmd/clms_evt.h +++ b/src/clm/clmd/clms_evt.h @@ -30,6 +30,8 @@ typedef enum clmsv_clms_evt_type { CLMSV_CLMS_RDA_EVT, CLMSV_CLMS_RT_UPDATE, CLMSV_AVND_DOWN_EVT, + CLMSV_CLMS_CLMNA_UP, + CLMSV_CLMS_CLMNA_DOWN, CLMSV_CLMS_EVT_MAX, } CLMSV_CLMS_EVT_TYPE; diff --git a/src/clm/clmd/clms_mds.cc b/src/clm/clmd/clms_mds.cc index 24b5bcd71..82fda66de 100644 --- a/src/clm/clmd/clms_mds.cc +++ b/src/clm/clmd/clms_mds.cc @@ -1237,6 +1237,10 @@ static uint32_t clms_mds_svc_event(struct ncsmds_callback_info *info) { evt->type = CLMSV_AVND_DOWN_EVT; evt->info.node_mds_info.node_id = info->info.svc_evt.i_node_id; evt->info.node_mds_info.nodeup = SA_FALSE; + } else if (info->info.svc_evt.i_svc_id == NCSMDS_SVC_ID_CLMNA) { + evt->type = CLMSV_CLMS_CLMNA_DOWN; + evt->info.mds_info.node_id = info->info.svc_evt.i_node_id; + evt->info.mds_info.mds_dest_id = info->info.svc_evt.i_dest; } if (evt->type) { /* Push the event and we are done */ -- 2.25.1 |