Hi Minh, ack, code review and mdstest run. One minor comment below. /Thanks HansN
On 10/25/18 04:40, Minh Chau wrote: > If split brain happens and network merges back, at this point in time > there are a few mds events coming to payloads, which are the SVC UP > from the other controller; SVC down from services in both controllers > due to reboot from split brain detection. > In the ticket description, the first partition includes SC1, PL3, > the second partition includes SC2, PL4, PL5. The amfnd on PL3 is > missing NCSMDS_DOWN with vdest in the below scenario: > > - SVC up event from the other amfd (on SC2) > - SVC down event from amfd (SC1), it's the same active adest from > mds-PL3's view, start await_active timer, but no NCSMDS_DOWN with > vdest is sent because the adest on SC2 exists. > - SVC down event from amfd (SC2), it's different active adest. > > Because the payloads reside in different partitions so they don't > have the same active adest view at mds level. When both SCs go down > due to split brain detection, the same SVC down events occur and > comes to all payloads, but they have different view so they behave > differently to the payloads in the other partition. > > The patch adds an additional condition to send NCSMDS_DOWN if there is > no actual adest existed > --- > src/mds/mds_c_api.c | 80 > ++++++++++++++++++++++++++++++----------------------- > 1 file changed, 46 insertions(+), 34 deletions(-) > > diff --git a/src/mds/mds_c_api.c b/src/mds/mds_c_api.c > index f5ba318..73849cc 100644 > --- a/src/mds/mds_c_api.c > +++ b/src/mds/mds_c_api.c > @@ -3644,13 +3644,58 @@ uint32_t mds_mcm_svc_down(PW_ENV_ID pwe_id, > MDS_SVC_ID svc_id, V_DEST_RL role, > local_svc_hdl, svc_id, vdest_id, > &active_adest, &tmr_running, > &subtn_result_info, true); > - [HansN] is this log message informative/needed? > + m_MDS_LOG_INFO("MCM:API: svc_down: " > + "active_adest:%lu", active_adest); > /* First delete the entry */ > mds_subtn_res_tbl_del( > local_svc_hdl, svc_id, vdest_id, adest, > vdest_policy, svc_sub_part_ver, > archword_type); > > + MDS_SUBSCRIPTION_RESULTS_INFO *s_info = NULL; > + bool adest_exists = false; > + > + /* if no adest remains for this svc > + * send MDS_DOWN > + */ > + status = mds_subtn_res_tbl_getnext_any( > + local_svc_hdl, svc_id, > + &s_info); > + > + while (status != NCSCC_RC_FAILURE) { > + if (s_info->key.vdest_id != > + m_VDEST_ID_FOR_ADEST_ENTRY) { > + adest_exists = true; > + break; > + } > + > + status = mds_subtn_res_tbl_getnext_any( > + local_svc_hdl, svc_id, &s_info); > + } > + > + if (active_adest != adest > + && vdest_policy == NCS_VDEST_TYPE_MxN > + && adest_exists == false) { > + m_MDS_LOG_INFO("MCM:API: svc_down : " > + "svc_id = %s(%d) on DEST id = > %d " > + "got NO_ACTIVE for svc_id = > %s(%d) " > + "on Vdest id = %d Adest = %s, rem_svc_pvt_ver=%d", > + get_svc_names( > + > m_MDS_GET_SVC_ID_FROM_SVC_HDL(local_svc_hdl)), > + m_MDS_GET_SVC_ID_FROM_SVC_HDL( > + local_svc_hdl), > + m_MDS_GET_VDEST_ID_FROM_SVC_HDL( > + local_svc_hdl), > + get_svc_names(svc_id), svc_id, > + vdest_id, > + > log_subtn_result_info->sub_adest_details, > + svc_sub_part_ver); > + status = mds_mcm_user_event_callback( > + local_svc_hdl, pwe_id, svc_id, > + role, vdest_id, 0, NCSMDS_DOWN, > + svc_sub_part_ver, > archword_type); > + } > + > if (active_adest == adest) { > if (vdest_policy == > NCS_VDEST_TYPE_MxN) { > @@ -3698,39 +3743,6 @@ uint32_t mds_mcm_svc_down(PW_ENV_ID pwe_id, MDS_SVC_ID > svc_id, V_DEST_RL role, > ->sub_adest_details, > svc_sub_part_ver); > { > - > MDS_SUBSCRIPTION_RESULTS_INFO > - *subtn_result_info = > - NULL; > - bool adest_exists = > - false; > - > - /* if no adest remains > - * for this svc, send > - * MDS_DOWN */ > - status = > - > mds_subtn_res_tbl_getnext_any( > - local_svc_hdl, > - svc_id, > - > &subtn_result_info); > - > - while ( > - status != > - NCSCC_RC_FAILURE) { > - if > (subtn_result_info > - ->key > - > .vdest_id != > - > m_VDEST_ID_FOR_ADEST_ENTRY) { > - > adest_exists = > - > true; > - break; > - } > - > - status = > mds_subtn_res_tbl_getnext_any( > - > local_svc_hdl, > - svc_id, > - > &subtn_result_info); > - } > - > if (adest_exists == > false) { > /* No other _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel