Sorry but I have to ask what "apply callback" is being discussed here. Do you mean the apply callback from the immsv ? For OIs/Apppliers ?
The immsv guarantees that the CCB is applied at the *processor* where the apply callback is received for that ccb-id. The immsv dous not guarantee that if you send a message over any message service from a process at the processor where it received an apply *to* a process at another processor, that the ccb has been applied in the immsv at the other processor. If you want that guarantee, the process at the other processor should attach as an applier. Alternatively the sending process could send the message to the receiver using an admin-operation. The admin-operation invoke also goes over FEVS and will guarantee that it is in FEVS sync at the receiver. This means that the immsv must have received the apply at that other processor. Of it could also have received a subsequent CCB possibly overwriting the particular ccb-id of interest. Thus if you really want to be sure that a process reads/receives updates in the exact And complete sequence as they are applied, then that process needs to attach as an applier for the data it is interested in monitoring. /AndersBj -----Original Message----- From: [email protected] [mailto:[email protected]] Sent: den 3 februari 2014 11:15 To: Hans Feldt; Hans Nordebäck; [email protected] Cc: [email protected] Subject: [devel] [PATCH 1 of 1] amfd: create comp if not found during decoding [#761] osaf/services/saf/amf/amfd/ckpt_dec.cc | 5 +---- osaf/services/saf/amf/amfd/comp.cc | 21 +++++++++++++++++++++ osaf/services/saf/amf/amfd/include/comp.h | 1 + 3 files changed, 23 insertions(+), 4 deletions(-) Some times, because of timing issues, apply callback is reaching delayed at standby controller. It happened during component oper state checkpoiting. Since apply callback is not received at standby controller, component is not found in data base and counter comp_updt is mismatched during warn sync and standby amfd asserts. Fix for this is to create comp when not found in data base and wait for apply callback. When apply callback comes later, the other parameters like su are updated. diff --git a/osaf/services/saf/amf/amfd/ckpt_dec.cc b/osaf/services/saf/amf/amfd/ckpt_dec.cc --- a/osaf/services/saf/amf/amfd/ckpt_dec.cc +++ b/osaf/services/saf/amf/amfd/ckpt_dec.cc @@ -2419,10 +2419,7 @@ static uint32_t dec_comp_oper_state(AVD_ return status; } - if (NULL == (comp_struct = avd_comp_get(&comp_ptr->comp_info.name))) { - LOG_ER("%s: comp not found, %s", __FUNCTION__, comp_ptr->comp_info.name.value); - return NCSCC_RC_FAILURE; - } + comp_struct = avd_comp_get_or_create(&comp_ptr->comp_info.name); /* Update the fields received in this checkpoint message */ comp_struct->saAmfCompOperState = comp_ptr->saAmfCompOperState; diff --git a/osaf/services/saf/amf/amfd/comp.cc b/osaf/services/saf/amf/amfd/comp.cc --- a/osaf/services/saf/amf/amfd/comp.cc +++ b/osaf/services/saf/amf/amfd/comp.cc @@ -1570,6 +1570,27 @@ static void comp_ccb_apply_cb(CcbUtilOpe TRACE_LEAVE(); } +/** + * Return an Comp object if it exist, otherwise create it and + * return a reference to the new object. + * @param dn + * + * @return AVD_COMP* + */ +AVD_COMP *avd_comp_get_or_create(const SaNameT *dn) { + AVD_COMP *comp = avd_comp_get(dn); + + if (!comp) { + TRACE("'%s' does not exist, creating it", dn->value); + comp = avd_comp_new(dn); + osafassert(comp != NULL); + avd_comp_db_add(comp); + } + + return comp; +} + void avd_comp_constructor(void) { NCS_PATRICIA_PARAMS patricia_params; diff --git a/osaf/services/saf/amf/amfd/include/comp.h b/osaf/services/saf/amf/amfd/include/comp.h --- a/osaf/services/saf/amf/amfd/include/comp.h +++ b/osaf/services/saf/amf/amfd/include/comp.h @@ -234,5 +234,6 @@ extern AVD_COMPCS_TYPE *avd_compcstype_g extern AVD_COMPCS_TYPE *avd_compcstype_getnext(const SaNameT *dn); extern AVD_COMPCS_TYPE * avd_compcstype_find_match(const SaNameT *csi, const AVD_COMP *comp); extern void avd_compcstype_constructor(void); +extern AVD_COMP *avd_comp_get_or_create(const SaNameT *dn); #endif ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
