Ack, minor comment inline (reviewed only) /HansF > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: den 9 september 2014 11:40 > To: Hans Feldt; [email protected] > Cc: [email protected] > Subject: [PATCH 1 of 1] amfd: respond node level admin op at sufailover > during node unlock [#1044] > > osaf/services/saf/amf/amfd/sgproc.cc | 16 ++++++++++++++-- > 1 files changed, 14 insertions(+), 2 deletions(-) > > > When node unlock is performed on Node and it leads > to sufailover, AMFD is not responding a pending admin op. > > During node unlock operation, AMFD remembers no. of fresh assignments > it has created by maintaining a counter. Whenever it gets a success response > for an assignment from AMFND it decrements the counter by 1. Thus when AMFD > gets response for all the assignments this counter will become 0 and AMFD will > respond to IMM for UNLOCK operation. In the reported issue fault during node > unlock leads to su-failover. While processing su-failover event AMFD > decrements the counter only once irrespective of the number of fresh > assignments it has created. Since counter never becomes 0, AMFD does not > respond for the admin operation. > > This patch ensures if sufailover gets escalated during node unlock, > AMF will respond to IMM for the completion of admin operation. > > diff --git a/osaf/services/saf/amf/amfd/sgproc.cc > b/osaf/services/saf/amf/amfd/sgproc.cc > --- a/osaf/services/saf/amf/amfd/sgproc.cc > +++ b/osaf/services/saf/amf/amfd/sgproc.cc > @@ -301,12 +301,24 @@ static uint32_t sg_su_failover_func(AVD_ > initiation of node level operation on the list of SUs. So if > this SU has > list of SUSIs, AMF would have sent assignment as a part of > node level operation. > Now SUSIs in this SU are going to be deleted so we can > decrement the counter in node. > + In case of Node unlock this counter is incremented per susi. > So decrement > + should also be done per susi. > */ > - su->su_on_node->su_cnt_admin_oper--; > + > + SaAisErrorT res = SA_AIS_OK; > + if (su->su_on_node->saAmfNodeAdminState == > SA_AMF_ADMIN_UNLOCKED) { > + for (AVD_SU_SI_REL *susi = su->list_of_susi; susi; susi > = susi->su_next) { > + if (susi->fsm == AVD_SU_SI_STATE_ASGN) > + su->su_on_node->su_cnt_admin_oper--; > + } > + res = SA_AIS_ERR_TIMEOUT; > + } > + else [Hans] else should be on same line as else
> + su->su_on_node->su_cnt_admin_oper--; > > /* If node level operation is finished on all the SUs, reply to > imm.*/ > if (su->su_on_node->su_cnt_admin_oper == 0) > - node_complete_admin_op(su->su_on_node, SA_AIS_OK); > + node_complete_admin_op(su->su_on_node, res); > } > > /*If the AvD is in AVD_APP_STATE then reassign all the SUSI assignments > for this SU */ ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
