Ack, only after incorporating the following comments.

1. Please do
/mqd_asapi_unbind();//
//                saAmfFinalize(pMqd->amf_hdl);//
//                ncshm_give_hdl(pMqd->hdl);//
//                mqd_cb_shut(pMqd);//
/
in case of return FAILURE for mqd_clm_init().

2. Please correct mqd_clm_init(). Not required to do the following steps 
in mqd_clm_init() while returning for failures.

                mqd_mbcsv_finalize(cb);
                if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
                        TRACE_2("MDS Deregistration Failed");
                }


Thanks,
Ramesh.

On 4/28/2016 8:10 PM, mathi.naic...@oracle.com wrote:
>   osaf/services/saf/mqsv/mqd/mqd_api.c |  95 
> ++++++++++++++++++++---------------
>   1 files changed, 53 insertions(+), 42 deletions(-)
>
>
> With the introduction of spares support #79, all services were modified to 
> wait for AMF role assignment
> to register with MDS and proceed further with their lifecycle.
> However, this is not necessary and would create a problem of 1781.
> i.e. All services should ideally register with CLM independent of their HA 
> roles as provided by AMF or RDA.
> But ofcourse until now only AMF, EVT, CKPT, MSG, NTF, SMF have been 
> integrated with CLM.
> This patch makes the services register with CLM before entering the wait() 
> for AMF role.
> NTF service is already handling this correctly.
> This is also necessary to make OpenSAF services run - without abort, on nodes 
> that are administratively
> locked/shutdown via CLM node admin commands.
> A separate patch for SMF follow.
>
> diff --git a/osaf/services/saf/mqsv/mqd/mqd_api.c 
> b/osaf/services/saf/mqsv/mqd/mqd_api.c
> --- a/osaf/services/saf/mqsv/mqd/mqd_api.c
> +++ b/osaf/services/saf/mqsv/mqd/mqd_api.c
> @@ -113,6 +113,55 @@ uint32_t mqd_lib_req(NCS_LIB_REQ_INFO *i
>       return rc;
>   }   /* End of mqd_lib_req() */
>   
> +static SaAisErrorT mqd_clm_init (MQD_CB *cb)
> +{
> +     SaAisErrorT saErr = SA_AIS_OK;
> +     SaVersionT clm_version;
> +     SaClmCallbacksT mqd_clm_cbk;
> +
> +     m_MQSV_GET_AMF_VER(clm_version);
> +     mqd_clm_cbk.saClmClusterNodeGetCallback = NULL;
> +     mqd_clm_cbk.saClmClusterTrackCallback = mqd_clm_cluster_track_callback;
> +
> +     saErr = saClmInitialize(&cb->clm_hdl, &mqd_clm_cbk, &clm_version);
> +     if (saErr != SA_AIS_OK) {
> +             LOG_ER("saClmInitialize failed with error %u", (unsigned) 
> saErr);
> +             mqd_mbcsv_finalize(cb);
> +             if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
> +                     TRACE_2("MDS Deregistration Failed");
> +             }
> +             goto done;
> +     }
> +     TRACE_1("saClmInitialize success");
> +
> +     saErr = saClmSelectionObjectGet(cb->clm_hdl, &cb->clm_sel_obj);
> +     if (SA_AIS_OK != saErr) {
> +             LOG_ER("saClmSelectionObjectGet failed with error %u", 
> (unsigned) saErr);
> +             mqd_mbcsv_finalize(cb);
> +             if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
> +                     TRACE_2("MDS Deregistration Failed");
> +             }
> +             goto done;
> +     }
> +     TRACE_1("saClmSelectionObjectGet success");
> +
> +     saErr = saClmClusterTrack(cb->clm_hdl, SA_TRACK_CHANGES_ONLY, NULL);
> +     if (SA_AIS_OK != saErr) {
> +             LOG_ER("saClmClusterTrack failed with error %u", (unsigned) 
> saErr);
> +             mqd_mbcsv_finalize(cb);
> +             if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
> +                     TRACE_2("MDS Deregistration Failed");
> +             }
> +             goto done;
> +     }
> +     TRACE_1("saClmClusterTrack success");
> +
> +done:
> +     saClmFinalize(cb->clm_hdl);
> +
> +     return saErr;
> +}
> +
>   
> /****************************************************************************\
>     PROCEDURE NAME : mqd_lib_init
>    
> @@ -256,6 +305,9 @@ static uint32_t mqd_lib_init(void)
>               return rc;
>       }
>   
> +     if (mqd_clm_init(pMqd) != SA_AIS_OK)
> +             return NCSCC_RC_FAILURE;
> +             
>       if ((rc = initialize_for_assignment(pMqd, pMqd->ha_state)) !=
>               NCSCC_RC_SUCCESS) {
>               LOG_ER("initialize_for_assignment FAILED %u", (unsigned) rc);
> @@ -271,9 +323,8 @@ uint32_t initialize_for_assignment(MQD_C
>   {
>       TRACE_ENTER2("ha_state = %d", (int) ha_state);
>       uint32_t rc = NCSCC_RC_SUCCESS;
> -     SaClmCallbacksT mqd_clm_cbk;
> -     SaVersionT clm_version;
>       SaAisErrorT saErr = SA_AIS_OK;
> +
>       if (cb->fully_initialized || ha_state == SA_AMF_HA_QUIESCED) {
>               goto done;
>       }
> @@ -293,46 +344,6 @@ uint32_t initialize_for_assignment(MQD_C
>               goto done;
>       }
>   
> -     m_MQSV_GET_AMF_VER(clm_version);
> -     mqd_clm_cbk.saClmClusterNodeGetCallback = NULL;
> -     mqd_clm_cbk.saClmClusterTrackCallback = mqd_clm_cluster_track_callback;
> -
> -     saErr = saClmInitialize(&cb->clm_hdl, &mqd_clm_cbk, &clm_version);
> -     if (saErr != SA_AIS_OK) {
> -             LOG_ER("saClmInitialize failed with error %u", (unsigned) 
> saErr);
> -             mqd_mbcsv_finalize(cb);
> -             if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
> -                     TRACE_2("MDS Deregistration Failed");
> -             }
> -             rc = NCSCC_RC_FAILURE;
> -             goto done;
> -     }
> -     TRACE_1("saClmInitialize success");
> -
> -     saErr = saClmSelectionObjectGet(cb->clm_hdl, &cb->clm_sel_obj);
> -     if (SA_AIS_OK != saErr) {
> -             LOG_ER("saClmSelectionObjectGet failed with error %u", 
> (unsigned) saErr);
> -             mqd_mbcsv_finalize(cb);
> -             if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
> -                     TRACE_2("MDS Deregistration Failed");
> -             }
> -             rc = NCSCC_RC_FAILURE;
> -             goto done;
> -     }
> -     TRACE_1("saClmSelectionObjectGet success");
> -
> -     saErr = saClmClusterTrack(cb->clm_hdl, SA_TRACK_CHANGES_ONLY, NULL);
> -     if (SA_AIS_OK != saErr) {
> -             LOG_ER("saClmClusterTrack failed with error %u", (unsigned) 
> saErr);
> -             mqd_mbcsv_finalize(cb);
> -             if (mqd_mds_shut(cb) != NCSCC_RC_SUCCESS) {
> -                     TRACE_2("MDS Deregistration Failed");
> -             }
> -             rc = NCSCC_RC_FAILURE;
> -             goto done;
> -     }
> -     TRACE_1("saClmClusterTrack success");
> -
>       /* MQD Imm Initialization */
>       saErr = mqd_imm_initialize(cb);
>       if (saErr != SA_AIS_OK) {

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to