[devel] [PATCH 1 of 1] imm:checkpoint only FEVS header for sync messages [#952] v2
osaf/services/saf/immsv/immd/immd_evt.c | 15 --- osaf/services/saf/immsv/immnd/immnd_evt.c | 9 - 2 files changed, 20 insertions(+), 4 deletions(-) At the time of sync, when check-pointing to standby IMMD for IMMND_EVT_D2ND_GLOB_FEVS_REQ_2, the fevs message buffer will be set to NULL and message size will be set to 0. so, that the MBCSV check-pointing happens only for header. diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c --- a/osaf/services/saf/immsv/immd/immd_evt.c +++ b/osaf/services/saf/immsv/immd/immd_evt.c @@ -251,7 +251,7 @@ uint32_t immd_evt_proc_fevs_req(IMMD_CB /* Populate Send the FEVS Event to IMMND */ memset(send_evt, 0, sizeof(IMMSV_EVT)); send_evt.type = IMMSV_EVT_TYPE_IMMND; - send_evt.info.immnd.type = (evt-type == IMMD_EVT_ND2D_FEVS_REQ_2)? + send_evt.info.immnd.type = ((evt-type == IMMD_EVT_ND2D_FEVS_REQ_2)||(evt-type == 0))? IMMND_EVT_D2ND_GLOB_FEVS_REQ_2: IMMND_EVT_D2ND_GLOB_FEVS_REQ; if ((evt-type == 0) (fevs_req-sender_count 0)) { @@ -266,8 +266,8 @@ uint32_t immd_evt_proc_fevs_req(IMMD_CB send_evt.info.immnd.info.fevsReq.msg.size = fevs_req-msg.size; /*Borrow the buffer from the input message instead of copying */ send_evt.info.immnd.info.fevsReq.msg.buf = fevs_req-msg.buf; - send_evt.info.immnd.info.fevsReq.isObjSync = (evt-type == IMMD_EVT_ND2D_FEVS_REQ_2)? - (fevs_req-isObjSync):0x0; + send_evt.info.immnd.info.fevsReq.isObjSync = ((evt-type == IMMD_EVT_ND2D_FEVS_REQ_2) || + (evt-type == 0 ))? (fevs_req-isObjSync):0x0; TRACE_5(immd_evt_proc_fevs_req send_count:%llu size:%u, send_evt.info.immnd.info.fevsReq.sender_count, send_evt.info.immnd.info.fevsReq.msg.size); @@ -280,6 +280,15 @@ uint32_t immd_evt_proc_fevs_req(IMMD_CB mbcp_msg.type = IMMD_A2S_MSG_FEVS; mbcp_msg.info.fevsReq = send_evt.info.immnd.info.fevsReq; + /* FEVS_REQ_2 messages are object sync messages. since this is mbcsv checkpointing + to standby, at the time of sync checkpointing complete fevs event is not required. + Checkpointing the header is sufficient to have the standby SC in sync with the fevs count.*/ + + if(evt-type == IMMD_EVT_ND2D_FEVS_REQ_2){ + mbcp_msg.info.fevsReq.msg.size = 0; + mbcp_msg.info.fevsReq.msg.buf = NULL; + mbcp_msg.info.fevsReq.isObjSync = 0x0; + } /*Checkpoint the message to standby director. Syncronous call=wait for ack */ proc_rc = immd_mbcsv_sync_update(cb, mbcp_msg); diff --git a/osaf/services/saf/immsv/immnd/immnd_evt.c b/osaf/services/saf/immsv/immnd/immnd_evt.c --- a/osaf/services/saf/immsv/immnd/immnd_evt.c +++ b/osaf/services/saf/immsv/immnd/immnd_evt.c @@ -8702,7 +8702,7 @@ static uint32_t immnd_evt_proc_fevs_rcv( SaBoolT originatedAtThisNd = (m_IMMSV_UNPACK_HANDLE_LOW(clnt_hdl) == cb-node_id); if (originatedAtThisNd) { - osafassert(!reply_dest || (reply_dest == cb-immnd_mdest_id)); + osafassert(!reply_dest || (reply_dest == cb-immnd_mdest_id) || isObjSync ); if (cb-fevs_replies_pending) { --(cb-fevs_replies_pending); /*flow control towards IMMD */ } @@ -8731,6 +8731,12 @@ static uint32_t immnd_evt_proc_fevs_rcv( } } + if ((evt-type == IMMND_EVT_D2ND_GLOB_FEVS_REQ_2) (msg-size == 0) (msg-buf == NULL)){ + // This is sync message Re-broadcasted by IMMD standby because of failover + TRACE(Re-broadcasted FEVS at the time of sync); + goto done; + } + /*NORMAL CASE: Received the expected in-order message. */ SaAisErrorT err = SA_AIS_OK; @@ -8749,6 +8755,7 @@ static uint32_t immnd_evt_proc_fevs_rcv( } } + done: cb-highestProcessed++; dequeue_outgoing(cb); TRACE_LEAVE(); -- Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] imm:checkpoint only FEVS header for sync messages [#952] v1
Hi AndersBj, Ok, got it. I will publish the new patch. /Neel. On Wednesday 01 July 2015 12:28 PM, Anders Björnerstedt wrote: Hi Neel, Comments inline. On 07/01/2015 07:52 AM, Neelakanta Reddy wrote: Hi AndersBJ, comments inline. On Tuesday 30 June 2015 05:48 PM, Anders Björnerstedt wrote: Hi Neel, I have some questions on this fevs optimization patch #952 out on review. In general I think it could be possible to make the patch even smaller/simpler. Comments inline On 06/24/2015 09:23 AM, reddy.neelaka...@oracle.com wrote: osaf/services/saf/immsv/immd/immd_evt.c | 22 +++--- osaf/services/saf/immsv/immnd/immnd_evt.c | 9 - 2 files changed, 27 insertions(+), 4 deletions(-) At the time of sync, when check-pointing to standby IMMD for IMMND_EVT_D2ND_GLOB_FEVS_REQ_2, the fevs message buffer will be set to NULL and message size will be set to 0. so, that the MBCSV check-pointing happens only for header. In the immd_evt.c changes below, instead of altering the immnd input event before it is copied to the immd mbcp message and correcting the immnd evt back again after the forwarding; why not instead just copy the immnd to the immd mbcp event (same as today) and correct the immd mbcp evt ? The immd mbcp evt is discarded after it has been mbcp'd. This would leave the immnd evt untouched/unchanged in this function which always feels good/safe, unless you are correcting something more than the problem of this ticket. The enhancement is to reduce the large sync data getting Check pointed to standby director.so, that the mbcsv check-pointing time is reduced (from mds perspective). The is the reason, the immnd event is altered before copied to immd mbcp messaged and corrected the immnd evt back again. You completely missed my point. Of course I know what the enhancement is about. My point is that instead of changing in the main fevs message and then resetting it back after having copied the main message to the mbcp evt, why not simply: 1) Copy the main message to the mbcp evt code unchanged. 2) Adjust the mbcp message so that it is truncated. Thats it. The mbcp message is sent and then discarded. The main message is handled just like today. Simpler. Fewer changes. Same result. So instead of: diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c --- a/osaf/services/saf/immsv/immd/immd_evt.c +++ b/osaf/services/saf/immsv/immd/immd_evt.c @@ -251,7 +251,7 @@ uint32_t immd_evt_proc_fevs_req(IMMD_CB /* Populate Send the FEVS Event to IMMND */ memset(send_evt, 0, sizeof(IMMSV_EVT)); send_evt.type = IMMSV_EVT_TYPE_IMMND; -send_evt.info.immnd.type = (evt-type == IMMD_EVT_ND2D_FEVS_REQ_2)? +send_evt.info.immnd.type = ((evt-type == IMMD_EVT_ND2D_FEVS_REQ_2)||(evt-type == 0))? IMMND_EVT_D2ND_GLOB_FEVS_REQ_2: IMMND_EVT_D2ND_GLOB_FEVS_REQ; if ((evt-type == 0) (fevs_req-sender_count 0)) { @@ -266,8 +266,8 @@ uint32_t immd_evt_proc_fevs_req(IMMD_CB send_evt.info.immnd.info.fevsReq.msg.size = fevs_req-msg.size; /*Borrow the buffer from the input message instead of copying */ send_evt.info.immnd.info.fevsReq.msg.buf = fevs_req-msg.buf; -send_evt.info.immnd.info.fevsReq.isObjSync = (evt-type == IMMD_EVT_ND2D_FEVS_REQ_2)? -(fevs_req-isObjSync):0x0; +send_evt.info.immnd.info.fevsReq.isObjSync = ((evt-type == IMMD_EVT_ND2D_FEVS_REQ_2) || +(evt-type == 0 ))? (fevs_req-isObjSync):0x0; TRACE_5(immd_evt_proc_fevs_req send_count:%llu size:%u, send_evt.info.immnd.info.fevsReq.sender_count, send_evt.info.immnd.info.fevsReq.msg.size); @@ -278,11 +278,27 @@ uint32_t immd_evt_proc_fevs_req(IMMD_CB } else if(!cb-is_loading) { memset(mbcp_msg, 0, sizeof(IMMD_MBCSV_MSG)); mbcp_msg.type = IMMD_A2S_MSG_FEVS; + +/* FEVS_REQ_2 messages are object sync messages. since this is mbcsv checkpointing + to standby, at the time of sync checkpointing complete fevs event is not required. + Checkpointing the header is sufficient to have the standby SC in sync with the fevs count.*/ +if(evt-type == IMMD_EVT_ND2D_FEVS_REQ_2){ +send_evt.info.immnd.info.fevsReq.msg.size = 0; +send_evt.info.immnd.info.fevsReq.msg.buf = NULL; +} + mbcp_msg.info.fevsReq = send_evt.info.immnd.info.fevsReq; /*Checkpoint the message to standby director. Syncronous call=wait for ack */ proc_rc = immd_mbcsv_sync_update(cb, mbcp_msg); + + /* After checkpointing to standby assign buffer back to fevsReq */ +if(evt-type == IMMD_EVT_ND2D_FEVS_REQ_2){ +send_evt.info.immnd.info.fevsReq.msg.size = fevs_req-msg.size; +send_evt.info.immnd.info.fevsReq.msg.buf = fevs_req-msg.buf; +}
[devel] [PATCH 1 of 1] amfd: validate su existance in sirankedsu object create [#164]
osaf/services/saf/amf/amfd/sirankedsu.cc | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) Amf is allowing to create sirankedsu object even if su mentioned in that object doesn't exist. Ideally Amf should throw error for such cases. For creation of association object, both the associated objects should exists diff --git a/osaf/services/saf/amf/amfd/sirankedsu.cc b/osaf/services/saf/amf/amfd/sirankedsu.cc --- a/osaf/services/saf/amf/amfd/sirankedsu.cc +++ b/osaf/services/saf/amf/amfd/sirankedsu.cc @@ -244,6 +244,7 @@ static int is_config_valid(const SaNameT SaNameT si_name; uint32_t rank = 0; AVD_SUS_PER_SI_RANK_INDX indx; + AVD_SU *avd_su = NULL; memset(su_name, 0, sizeof(SaNameT)); memset(si_name, 0, sizeof(SaNameT)); @@ -266,6 +267,22 @@ static int is_config_valid(const SaNameT } } + /* Find the su name. */ + avd_su = su_db-find(Amf::to_string(su_name)); + if (avd_su == NULL) { + /* SU does not exist in current model, check CCB */ + if (opdata == NULL) { + report_ccb_validation_error(opdata, '%s' does not exist in model, su_name.value); + return 0; + } + + if (ccbutil_getCcbOpDataByDN(opdata-ccbId, su_name) == NULL) { + report_ccb_validation_error(opdata, '%s' does not exist in existing model or in CCB, + su_name.value); + return 0; + } + } + if (immutil_getAttr(const_castSaImmAttrNameT(saAmfRank), attributes, 0, rank) != SA_AIS_OK) { report_ccb_validation_error(opdata, saAmfRank not found for %s, dn-value); return 0; -- Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] AMFND: Comp receives QUIESCED csi when it has not received ACTIVE csi [#1386]
Hi, My comment inline Thanks, Minh On 7/2/2015 10:40 AM, Gary Lee wrote: Hi Minh One minor comment below. Thanks Gary On 19/06/15 13:42, Minh Hon Chau wrote: osaf/services/saf/amf/amfnd/comp.cc | 83 +--- osaf/services/saf/amf/amfnd/include/avnd_comp.h | 9 ++ osaf/services/saf/amf/amfnd/sidb.cc | 2 +- osaf/services/saf/amf/amfnd/susm.cc | 24 ++- 4 files changed, 90 insertions(+), 28 deletions(-) If su-si active assignment is on-going, some csi(s) may get assigned but other csi(s) could be still in unassigned state. At this point, assigning component issues saAmfErrorReport(COMPONENT_FAILOVER), AMFND receives QUIESCED assignment from AMFD. The unassigned yet component also receives the quiesced csi callback that should not happen Adding new flag suspending_assignment, which indicates the unassigned csi(s) will not involve in QUIESCED/QUIESCING assignment loop. Once su-si QUIESCED/QUIESCING assignment is done, this flag reset to false. Patch also breaks down long *if* statements in all_csis_at_rank_assigned() into separated if-else in order to easy reading diff --git a/osaf/services/saf/amf/amfnd/comp.cc b/osaf/services/saf/amf/amfnd/comp.cc --- a/osaf/services/saf/amf/amfnd/comp.cc +++ b/osaf/services/saf/amf/amfnd/comp.cc @@ -1000,11 +1000,20 @@ uint32_t avnd_comp_csi_assign(AVND_CB *c if (NCSCC_RC_SUCCESS != rc) goto done; } else { -/* active/standby can be directly assigned */ -rc = avnd_comp_cbk_send(cb, comp, AVSV_AMF_CSI_SET, 0, 0); -if (NCSCC_RC_SUCCESS != rc) -goto done; -mark_csi = true; +if (curr_csi-curr_assign_state == AVND_COMP_CSI_ASSIGN_STATE_UNASSIGNED +curr_csi-prv_assign_state == AVND_COMP_CSI_ASSIGN_STATE_UNASSIGNED) { +// just generate csi-oper done for unassigned csi +curr_csi-suspending_assignment = true; +rc = avnd_comp_csi_assign_done(cb, comp, 0); +if (NCSCC_RC_SUCCESS != rc) +goto done; +} else { +/* active/standby can be directly assigned */ +rc = avnd_comp_cbk_send(cb, comp, AVSV_AMF_CSI_SET, 0, 0); +if (NCSCC_RC_SUCCESS != rc) +goto done; +mark_csi = true; +} } } else { /* assign the csi as the comp is aware of atleast one csi */ @@ -1222,7 +1231,16 @@ uint32_t avnd_comp_csi_remove(AVND_CB *c curr_csi; curr_csi = m_AVND_CSI_REC_FROM_COMP_DLL_NODE_GET(m_NCS_DBLIST_FIND_NEXT(curr_csi-comp_dll_node))) { -if ((m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNED(curr_csi)) + +// silently removing csi, don't issue callback +if (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_UNASSIGNED(curr_csi)) { + m_AVND_COMP_CSI_CURR_ASSIGN_STATE_SET(curr_csi, + AVND_COMP_CSI_ASSIGN_STATE_REMOVING); +m_AVND_SEND_CKPT_UPDT_ASYNC_UPDT(cb, curr_csi, + AVND_CKPT_COMP_CSI_CURR_ASSIGN_STATE); +rc = avnd_comp_csi_remove_done(cb, comp, csi); +goto done; +} else if ((m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNED(curr_csi)) || (m_AVND_COMP_CSI_PRV_ASSIGN_STATE_IS_ASSIGNED(curr_csi)) || (m_AVND_COMP_CSI_CURR_ASSIGN_STATE_IS_ASSIGNING(curr_csi))) { if (!csi_of_same_si_in_removing_state(curr_csi-comp,curr_csi-si)) @@ -1385,34 +1403,50 @@ uint32_t avnd_comp_csi_reassign(AVND_CB static bool all_csis_at_rank_assigned(struct avnd_su_si_rec *si, uint32_t rank) { AVND_COMP_CSI_REC *csi; +bool all_assigned = true; TRACE_ENTER2('%s'rank=%u, si-name.value, rank); for (csi = (AVND_COMP_CSI_REC*)m_NCS_DBLIST_FIND_FIRST(si-csi_list); -csi != NULL; +csi != NULL all_assigned; csi = (AVND_COMP_CSI_REC*)m_NCS_DBLIST_FIND_NEXT(csi-si_dll_node)) { if ((csi-rank == rank) (csi-curr_assign_state != AVND_COMP_CSI_ASSIGN_STATE_ASSIGNED)) { -/* Ignore the case of failed component/unregistered comp. */ -if (!m_AVND_SU_IS_RESTART(csi-comp-su) (m_AVND_COMP_IS_FAILED(csi-comp) || - (m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(csi-comp) - ((!m_AVND_COMP_IS_REG(csi-comp) - !m_AVND_COMP_PRES_STATE_IS_ORPHANED (csi-comp)) || - (!m_AVND_COMP_PRES_STATE_IS_INSTANTIATED (csi-comp) -