Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-17 Thread minh chau
Ack from me (code review only)

Thanks,
Minh

On 17/08/16 16:39, Nagendra Kumar wrote:
> Hi Minh,
>   Please change cb to avd_cb and then test. Sorry for the typo.
>
> Thanks
> -Nagu
>
>> -Original Message-
>> From: minh chau [mailto:minh.c...@dektech.com.au]
>> Sent: 17 August 2016 08:20
>> To: Nagendra Kumar; hans.nordeb...@ericsson.com; Praveen Malviya;
>> gary@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if
>> peer amfd is absent [#1850]
>>
>> Hi Nagu,
>>
>> I got this.
>>
>> CXX  osafamfd-sg_2n_fsm.o
>> CXX  osafamfd-sg_nored_fsm.o
>> sg_2n_fsm.cc: In member function 'virtual SaAisErrorT
>> SG_2N::si_swap(AVD_SI*, SaInvocationT)':
>> sg_2n_fsm.cc:775:6: error: 'cb' was not declared in this scope
>>   ((cb->node_id_avd_other != 0) && (cb->other_avd_adest != 0))) {
>> ^
>> Makefile:1176: recipe for target 'osafamfd-sg_2n_fsm.o' failed
>> make[7]: *** [osafamfd-sg_2n_fsm.o] Error 1
>>
>> Thanks,
>> Minh
>>
>> On 16/08/16 19:32, Nagendra Kumar wrote:
>>> Please review it by this weekend.
>>>
>>> Thanks
>>> -Nagu
>>>
>>>> -----Original Message-----
>>>> From: Nagendra Kumar
>>>> Sent: 02 August 2016 17:34
>>>> To: hans.nordeb...@ericsson.com; Praveen Malviya;
>>>> minh.c...@dektech.com.au; gary@dektech.com.au
>>>> Cc: opensaf-devel@lists.sourceforge.net
>>>> Subject: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of
>>>> sync if peer amfd is absent [#1850]
>>>>
>>>>osaf/services/saf/amf/amfd/main.cc  |  2 +-
>>>>osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
>>>>osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
>>>>3 files changed, 4 insertions(+), 9 deletions(-)
>>>>
>>>>
>>>> If standby amfd is not available then stby_sync_state should be in
>>>> out of sync state.
>>>> Else, Amfd should be in out of sync state.
>>>> This is to avoid issues like 1841
>>>>
>>>> diff --git a/osaf/services/saf/amf/amfd/main.cc
>>>> b/osaf/services/saf/amf/amfd/main.cc
>>>> --- a/osaf/services/saf/amf/amfd/main.cc
>>>> +++ b/osaf/services/saf/amf/amfd/main.cc
>>>> @@ -542,7 +542,7 @@ static uint32_t initialize(void)
>>>>cb->fully_initialized = false;
>>>>cb->swap_switch = false;
>>>>cb->active_services_exist = true;
>>>> -  cb->stby_sync_state = AVD_STBY_IN_SYNC;
>>>> +  cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
>>>>cb->sync_required = true;
>>>>
>>>>cb->heartbeat_tmr.is_active = false; diff --git
>>>> a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>>> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>>> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>>> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>>> @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
>>>>goto done;
>>>>}
>>>>
>>>> -  if (si->sg_of_si->sg_ncs_spec) {
>>>> +  if ((si->sg_of_si->sg_ncs_spec) &&
>>>> +  ((cb->node_id_avd_other != 0) && (cb-
>>>>> other_avd_adest != 0))) {
>>>>if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
>>>>LOG_ER("%s SWAP failed - Cold sync in 
>>>> progress", si-
>>>>> name.value);
>>>>rc = SA_AIS_ERR_TRY_AGAIN;
>>>> 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
>>>> @@ -1997,14 +1997,8 @@ void
>> avd_node_down_mw_susi_failover(AVD_
>>>>if ((i_su->sg_of_su->sg_redundancy_model ==
>>>> SA_AMF_2N_REDUNDANCY_MODEL) &&
>>>>(i_su->sg_of_su->sg_fsm_state ==
>>>> AVD_SG_FSM_STABLE))
>>>>(void) avd_clm_track_start();
>>>> -  /* If Std ctlr went down in m

Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-16 Thread Nagendra Kumar
Thanks Minh. That's correct, it was typo.

-Nagu

> -Original Message-
> From: minh chau [mailto:minh.c...@dektech.com.au]
> Sent: 17 August 2016 11:59
> To: Nagendra Kumar; hans.nordeb...@ericsson.com; Praveen Malviya;
> gary@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if
> peer amfd is absent [#1850]
> 
> Hi Nagu,
> 
> I think I can just replace "cb" by "avd_cb", and testing the patch. Then you
> can correct it later.
> 
> Thanks,
> Minh
> 
> On 17/08/16 12:50, minh chau wrote:
> > Hi Nagu,
> >
> > I got this.
> >
> >   CXX  osafamfd-sg_2n_fsm.o
> >   CXX  osafamfd-sg_nored_fsm.o
> > sg_2n_fsm.cc: In member function 'virtual SaAisErrorT
> > SG_2N::si_swap(AVD_SI*, SaInvocationT)':
> > sg_2n_fsm.cc:775:6: error: 'cb' was not declared in this scope
> > ((cb->node_id_avd_other != 0) && (cb->other_avd_adest != 0))) {
> >   ^
> > Makefile:1176: recipe for target 'osafamfd-sg_2n_fsm.o' failed
> > make[7]: *** [osafamfd-sg_2n_fsm.o] Error 1
> >
> > Thanks,
> > Minh
> >
> > On 16/08/16 19:32, Nagendra Kumar wrote:
> >> Please review it by this weekend.
> >>
> >> Thanks
> >> -Nagu
> >>
> >>> -Original Message-----
> >>> From: Nagendra Kumar
> >>> Sent: 02 August 2016 17:34
> >>> To: hans.nordeb...@ericsson.com; Praveen Malviya;
> >>> minh.c...@dektech.com.au; gary@dektech.com.au
> >>> Cc: opensaf-devel@lists.sourceforge.net
> >>> Subject: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of
> >>> sync if peer amfd is absent [#1850]
> >>>
> >>>   osaf/services/saf/amf/amfd/main.cc  |  2 +-
> >>>   osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
> >>>   osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
> >>>   3 files changed, 4 insertions(+), 9 deletions(-)
> >>>
> >>>
> >>> If standby amfd is not available then stby_sync_state should be in
> >>> out of sync state.
> >>> Else, Amfd should be in out of sync state.
> >>> This is to avoid issues like 1841
> >>>
> >>> diff --git a/osaf/services/saf/amf/amfd/main.cc
> >>> b/osaf/services/saf/amf/amfd/main.cc
> >>> --- a/osaf/services/saf/amf/amfd/main.cc
> >>> +++ b/osaf/services/saf/amf/amfd/main.cc
> >>> @@ -542,7 +542,7 @@ static uint32_t initialize(void)
> >>>   cb->fully_initialized = false;
> >>>   cb->swap_switch = false;
> >>>   cb->active_services_exist = true;
> >>> -cb->stby_sync_state = AVD_STBY_IN_SYNC;
> >>> +cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
> >>>   cb->sync_required = true;
> >>>
> >>>   cb->heartbeat_tmr.is_active = false; diff --git
> >>> a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >>> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >>> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >>> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >>> @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
> >>>   goto done;
> >>>   }
> >>>
> >>> -if (si->sg_of_si->sg_ncs_spec) {
> >>> +if ((si->sg_of_si->sg_ncs_spec) &&
> >>> +((cb->node_id_avd_other != 0) && (cb-
> >>>> other_avd_adest != 0))) {
> >>>   if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
> >>>   LOG_ER("%s SWAP failed - Cold sync in progress", si-
> >>>> name.value);
> >>>   rc = SA_AIS_ERR_TRY_AGAIN; 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
> >>> @@ -1997,14 +1997,8 @@ void
> avd_node_down_mw_susi_failover(AVD_
> >>>   if ((i_su->sg_of_su->sg_redundancy_model ==
> >>> SA_AMF_2N_REDUNDANCY_MODEL) &&
> >>>   (i_su->sg_of_su->sg_fsm_state ==
> >>> AVD_SG_FSM_STABLE))
> >>>   (void) avd_clm_track_start();
> >>> -/* If Std ctlr went down in middle of Cold sync, then we need
> >>> -   to reset the sync state to IN_SYNC. */
> >>> -if ((i_su->sg_of_su->sg_redundancy_model ==
> >>> SA_AMF_2N_REDUNDANCY_MODEL) &&
> >>> -(cb->stby_sync_state ==
> >>> AVD_STBY_OUT_OF_SYNC)) {
> >>> -TRACE("Marking sync_state as in_sync");
> >>> -cb->stby_sync_state = AVD_STBY_IN_SYNC;
> >>> -}
> >>>   /* Free all the SU SI assignments*/
> >>> +
> >>>   i_su->delete_all_susis();
> >>>
> >>>   }/* for (const auto& i_su : avnd->list_of_su) */
> >>>
> >>> 
> >>> --
> >>>
> >>> ___
> >>> Opensaf-devel mailing list
> >>> Opensaf-devel@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
> >
> 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-16 Thread Nagendra Kumar
Hi Minh,
Please change cb to avd_cb and then test. Sorry for the typo.

Thanks
-Nagu

> -Original Message-
> From: minh chau [mailto:minh.c...@dektech.com.au]
> Sent: 17 August 2016 08:20
> To: Nagendra Kumar; hans.nordeb...@ericsson.com; Praveen Malviya;
> gary@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net 
> Subject: Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if
> peer amfd is absent [#1850]
> 
> Hi Nagu,
> 
> I got this.
> 
>CXX  osafamfd-sg_2n_fsm.o
>CXX  osafamfd-sg_nored_fsm.o
> sg_2n_fsm.cc: In member function 'virtual SaAisErrorT
> SG_2N::si_swap(AVD_SI*, SaInvocationT)':
> sg_2n_fsm.cc:775:6: error: 'cb' was not declared in this scope
>  ((cb->node_id_avd_other != 0) && (cb->other_avd_adest != 0))) {
>^
> Makefile:1176: recipe for target 'osafamfd-sg_2n_fsm.o' failed
> make[7]: *** [osafamfd-sg_2n_fsm.o] Error 1
> 
> Thanks,
> Minh
> 
> On 16/08/16 19:32, Nagendra Kumar wrote:
> > Please review it by this weekend.
> >
> > Thanks
> > -Nagu
> >
> >> -Original Message-
> >> From: Nagendra Kumar
> >> Sent: 02 August 2016 17:34
> >> To: hans.nordeb...@ericsson.com; Praveen Malviya;
> >> minh.c...@dektech.com.au; gary@dektech.com.au
> >> Cc: opensaf-devel@lists.sourceforge.net
> >> Subject: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of
> >> sync if peer amfd is absent [#1850]
> >>
> >>   osaf/services/saf/amf/amfd/main.cc  |  2 +-
> >>   osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
> >>   osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
> >>   3 files changed, 4 insertions(+), 9 deletions(-)
> >>
> >>
> >> If standby amfd is not available then stby_sync_state should be in
> >> out of sync state.
> >> Else, Amfd should be in out of sync state.
> >> This is to avoid issues like 1841
> >>
> >> diff --git a/osaf/services/saf/amf/amfd/main.cc
> >> b/osaf/services/saf/amf/amfd/main.cc
> >> --- a/osaf/services/saf/amf/amfd/main.cc
> >> +++ b/osaf/services/saf/amf/amfd/main.cc
> >> @@ -542,7 +542,7 @@ static uint32_t initialize(void)
> >>cb->fully_initialized = false;
> >>cb->swap_switch = false;
> >>cb->active_services_exist = true;
> >> -  cb->stby_sync_state = AVD_STBY_IN_SYNC;
> >> +  cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
> >>cb->sync_required = true;
> >>
> >>cb->heartbeat_tmr.is_active = false; diff --git
> >> a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> >> @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
> >>goto done;
> >>}
> >>
> >> -  if (si->sg_of_si->sg_ncs_spec) {
> >> +  if ((si->sg_of_si->sg_ncs_spec) &&
> >> +  ((cb->node_id_avd_other != 0) && (cb-
> >>> other_avd_adest != 0))) {
> >>if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
> >>LOG_ER("%s SWAP failed - Cold sync in progress", si-
> >>> name.value);
> >>rc = SA_AIS_ERR_TRY_AGAIN;
> >> 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
> >> @@ -1997,14 +1997,8 @@ void
> avd_node_down_mw_susi_failover(AVD_
> >>if ((i_su->sg_of_su->sg_redundancy_model ==
> >> SA_AMF_2N_REDUNDANCY_MODEL) &&
> >>(i_su->sg_of_su->sg_fsm_state ==
> >> AVD_SG_FSM_STABLE))
> >>(void) avd_clm_track_start();
> >> -  /* If Std ctlr went down in middle of Cold sync, then we need
> >> - to reset the sync state to IN_SYNC. */
> >> -  if ((i_su->sg_of_su->sg_redundancy_model ==
> >> SA_AMF_2N_REDUNDANCY_MODEL) &&
> >> -  (cb->stby_sync_state ==
> >> AVD_STBY_OUT_OF_SYNC)) {
> >> -  TRACE("Marking sync_state as in_sync");
> >> -  cb->stby_sync_state = AVD_STBY_IN_SYNC;
> >> -  }
> >>/* Free all the SU SI assignments*/
> >> +
> >>i_su->delete_all_susis();
> >>
> >>}   /* for (const auto& i_su : avnd->list_of_su) */
> >>
> >> -
> >> - ___
> >> Opensaf-devel mailing list
> >> Opensaf-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
> 

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-16 Thread minh chau
Hi Nagu,

I think I can just replace "cb" by "avd_cb", and testing the patch. Then 
you can correct it later.

Thanks,
Minh

On 17/08/16 12:50, minh chau wrote:
> Hi Nagu,
>
> I got this.
>
>   CXX  osafamfd-sg_2n_fsm.o
>   CXX  osafamfd-sg_nored_fsm.o
> sg_2n_fsm.cc: In member function ‘virtual SaAisErrorT 
> SG_2N::si_swap(AVD_SI*, SaInvocationT)’:
> sg_2n_fsm.cc:775:6: error: ‘cb’ was not declared in this scope
> ((cb->node_id_avd_other != 0) && (cb->other_avd_adest != 0))) {
>   ^
> Makefile:1176: recipe for target 'osafamfd-sg_2n_fsm.o' failed
> make[7]: *** [osafamfd-sg_2n_fsm.o] Error 1
>
> Thanks,
> Minh
>
> On 16/08/16 19:32, Nagendra Kumar wrote:
>> Please review it by this weekend.
>>
>> Thanks
>> -Nagu
>>
>>> -Original Message-
>>> From: Nagendra Kumar
>>> Sent: 02 August 2016 17:34
>>> To: hans.nordeb...@ericsson.com; Praveen Malviya;
>>> minh.c...@dektech.com.au; gary@dektech.com.au
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of 
>>> sync if
>>> peer amfd is absent [#1850]
>>>
>>>   osaf/services/saf/amf/amfd/main.cc  |  2 +-
>>>   osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
>>>   osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
>>>   3 files changed, 4 insertions(+), 9 deletions(-)
>>>
>>>
>>> If standby amfd is not available then stby_sync_state should be in 
>>> out of sync
>>> state.
>>> Else, Amfd should be in out of sync state.
>>> This is to avoid issues like 1841
>>>
>>> diff --git a/osaf/services/saf/amf/amfd/main.cc
>>> b/osaf/services/saf/amf/amfd/main.cc
>>> --- a/osaf/services/saf/amf/amfd/main.cc
>>> +++ b/osaf/services/saf/amf/amfd/main.cc
>>> @@ -542,7 +542,7 @@ static uint32_t initialize(void)
>>>   cb->fully_initialized = false;
>>>   cb->swap_switch = false;
>>>   cb->active_services_exist = true;
>>> -cb->stby_sync_state = AVD_STBY_IN_SYNC;
>>> +cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
>>>   cb->sync_required = true;
>>>
>>>   cb->heartbeat_tmr.is_active = false;
>>> diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>>> @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
>>>   goto done;
>>>   }
>>>
>>> -if (si->sg_of_si->sg_ncs_spec) {
>>> +if ((si->sg_of_si->sg_ncs_spec) &&
>>> +((cb->node_id_avd_other != 0) && (cb-
>>>> other_avd_adest != 0))) {
>>>   if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
>>>   LOG_ER("%s SWAP failed - Cold sync in progress", si-
>>>> name.value);
>>>   rc = SA_AIS_ERR_TRY_AGAIN;
>>> 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
>>> @@ -1997,14 +1997,8 @@ void avd_node_down_mw_susi_failover(AVD_
>>>   if ((i_su->sg_of_su->sg_redundancy_model ==
>>> SA_AMF_2N_REDUNDANCY_MODEL) &&
>>>   (i_su->sg_of_su->sg_fsm_state ==
>>> AVD_SG_FSM_STABLE))
>>>   (void) avd_clm_track_start();
>>> -/* If Std ctlr went down in middle of Cold sync, then we need
>>> -   to reset the sync state to IN_SYNC. */
>>> -if ((i_su->sg_of_su->sg_redundancy_model ==
>>> SA_AMF_2N_REDUNDANCY_MODEL) &&
>>> -(cb->stby_sync_state ==
>>> AVD_STBY_OUT_OF_SYNC)) {
>>> -TRACE("Marking sync_state as in_sync");
>>> -cb->stby_sync_state = AVD_STBY_IN_SYNC;
>>> -}
>>>   /* Free all the SU SI assignments*/
>>> +
>>>   i_su->delete_all_susis();
>>>
>>>   }/* for (const auto& i_su : avnd->list_of_su) */
>>>
>>> --
>>>  
>>>
>>> ___
>>> Opensaf-devel mailing list
>>> Opensaf-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-16 Thread minh chau
Hi Nagu,

I got this.

   CXX  osafamfd-sg_2n_fsm.o
   CXX  osafamfd-sg_nored_fsm.o
sg_2n_fsm.cc: In member function ‘virtual SaAisErrorT 
SG_2N::si_swap(AVD_SI*, SaInvocationT)’:
sg_2n_fsm.cc:775:6: error: ‘cb’ was not declared in this scope
 ((cb->node_id_avd_other != 0) && (cb->other_avd_adest != 0))) {
   ^
Makefile:1176: recipe for target 'osafamfd-sg_2n_fsm.o' failed
make[7]: *** [osafamfd-sg_2n_fsm.o] Error 1

Thanks,
Minh

On 16/08/16 19:32, Nagendra Kumar wrote:
> Please review it by this weekend.
>
> Thanks
> -Nagu
>
>> -Original Message-
>> From: Nagendra Kumar
>> Sent: 02 August 2016 17:34
>> To: hans.nordeb...@ericsson.com; Praveen Malviya;
>> minh.c...@dektech.com.au; gary@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if
>> peer amfd is absent [#1850]
>>
>>   osaf/services/saf/amf/amfd/main.cc  |  2 +-
>>   osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
>>   osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
>>   3 files changed, 4 insertions(+), 9 deletions(-)
>>
>>
>> If standby amfd is not available then stby_sync_state should be in out of 
>> sync
>> state.
>> Else, Amfd should be in out of sync state.
>> This is to avoid issues like 1841
>>
>> diff --git a/osaf/services/saf/amf/amfd/main.cc
>> b/osaf/services/saf/amf/amfd/main.cc
>> --- a/osaf/services/saf/amf/amfd/main.cc
>> +++ b/osaf/services/saf/amf/amfd/main.cc
>> @@ -542,7 +542,7 @@ static uint32_t initialize(void)
>>  cb->fully_initialized = false;
>>  cb->swap_switch = false;
>>  cb->active_services_exist = true;
>> -cb->stby_sync_state = AVD_STBY_IN_SYNC;
>> +cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
>>  cb->sync_required = true;
>>
>>  cb->heartbeat_tmr.is_active = false;
>> diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
>> @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
>>  goto done;
>>  }
>>
>> -if (si->sg_of_si->sg_ncs_spec) {
>> +if ((si->sg_of_si->sg_ncs_spec) &&
>> +((cb->node_id_avd_other != 0) && (cb-
>>> other_avd_adest != 0))) {
>>  if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
>>  LOG_ER("%s SWAP failed - Cold sync in progress", si-
>>> name.value);
>>  rc = SA_AIS_ERR_TRY_AGAIN;
>> 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
>> @@ -1997,14 +1997,8 @@ void avd_node_down_mw_susi_failover(AVD_
>>  if ((i_su->sg_of_su->sg_redundancy_model ==
>> SA_AMF_2N_REDUNDANCY_MODEL) &&
>>  (i_su->sg_of_su->sg_fsm_state ==
>> AVD_SG_FSM_STABLE))
>>  (void) avd_clm_track_start();
>> -/* If Std ctlr went down in middle of Cold sync, then we need
>> -   to reset the sync state to IN_SYNC. */
>> -if ((i_su->sg_of_su->sg_redundancy_model ==
>> SA_AMF_2N_REDUNDANCY_MODEL) &&
>> -(cb->stby_sync_state ==
>> AVD_STBY_OUT_OF_SYNC)) {
>> -TRACE("Marking sync_state as in_sync");
>> -cb->stby_sync_state = AVD_STBY_IN_SYNC;
>> -}
>>  /* Free all the SU SI assignments*/
>> +
>>  i_su->delete_all_susis();
>>
>>  }   /* for (const auto& i_su : avnd->list_of_su) */
>>
>> --
>> ___
>> Opensaf-devel mailing list
>> Opensaf-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-16 Thread Nagendra Kumar
Please review it by this weekend.

Thanks
-Nagu

> -Original Message-
> From: Nagendra Kumar
> Sent: 02 August 2016 17:34
> To: hans.nordeb...@ericsson.com; Praveen Malviya;
> minh.c...@dektech.com.au; gary@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if
> peer amfd is absent [#1850]
> 
>  osaf/services/saf/amf/amfd/main.cc  |  2 +-
>  osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
>  osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
>  3 files changed, 4 insertions(+), 9 deletions(-)
> 
> 
> If standby amfd is not available then stby_sync_state should be in out of sync
> state.
> Else, Amfd should be in out of sync state.
> This is to avoid issues like 1841
> 
> diff --git a/osaf/services/saf/amf/amfd/main.cc
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -542,7 +542,7 @@ static uint32_t initialize(void)
>   cb->fully_initialized = false;
>   cb->swap_switch = false;
>   cb->active_services_exist = true;
> - cb->stby_sync_state = AVD_STBY_IN_SYNC;
> + cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
>   cb->sync_required = true;
> 
>   cb->heartbeat_tmr.is_active = false;
> diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
> @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
>   goto done;
>   }
> 
> - if (si->sg_of_si->sg_ncs_spec) {
> + if ((si->sg_of_si->sg_ncs_spec) &&
> + ((cb->node_id_avd_other != 0) && (cb-
> >other_avd_adest != 0))) {
>   if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
>   LOG_ER("%s SWAP failed - Cold sync in progress", si-
> >name.value);
>   rc = SA_AIS_ERR_TRY_AGAIN;
> 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
> @@ -1997,14 +1997,8 @@ void avd_node_down_mw_susi_failover(AVD_
>   if ((i_su->sg_of_su->sg_redundancy_model ==
> SA_AMF_2N_REDUNDANCY_MODEL) &&
>   (i_su->sg_of_su->sg_fsm_state ==
> AVD_SG_FSM_STABLE))
>   (void) avd_clm_track_start();
> - /* If Std ctlr went down in middle of Cold sync, then we need
> -to reset the sync state to IN_SYNC. */
> - if ((i_su->sg_of_su->sg_redundancy_model ==
> SA_AMF_2N_REDUNDANCY_MODEL) &&
> - (cb->stby_sync_state ==
> AVD_STBY_OUT_OF_SYNC)) {
> - TRACE("Marking sync_state as in_sync");
> - cb->stby_sync_state = AVD_STBY_IN_SYNC;
> - }
>   /* Free all the SU SI assignments*/
> +
>   i_su->delete_all_susis();
> 
>   }   /* for (const auto& i_su : avnd->list_of_su) */
> 
> --
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]

2016-08-02 Thread nagendra . k
 osaf/services/saf/amf/amfd/main.cc  |  2 +-
 osaf/services/saf/amf/amfd/sg_2n_fsm.cc |  3 ++-
 osaf/services/saf/amf/amfd/sgproc.cc|  8 +---
 3 files changed, 4 insertions(+), 9 deletions(-)


If standby amfd is not available then stby_sync_state
should be in out of sync state.
Else, Amfd should be in out of sync state.
This is to avoid issues like 1841

diff --git a/osaf/services/saf/amf/amfd/main.cc 
b/osaf/services/saf/amf/amfd/main.cc
--- a/osaf/services/saf/amf/amfd/main.cc
+++ b/osaf/services/saf/amf/amfd/main.cc
@@ -542,7 +542,7 @@ static uint32_t initialize(void)
cb->fully_initialized = false;
cb->swap_switch = false;
cb->active_services_exist = true;
-   cb->stby_sync_state = AVD_STBY_IN_SYNC;
+   cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC;
cb->sync_required = true;

cb->heartbeat_tmr.is_active = false;
diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc
@@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S
goto done;
}
 
-   if (si->sg_of_si->sg_ncs_spec) {
+   if ((si->sg_of_si->sg_ncs_spec) && 
+   ((cb->node_id_avd_other != 0) && (cb->other_avd_adest 
!= 0))) {
if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) {
LOG_ER("%s SWAP failed - Cold sync in progress", 
si->name.value);
rc = SA_AIS_ERR_TRY_AGAIN;
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
@@ -1997,14 +1997,8 @@ void avd_node_down_mw_susi_failover(AVD_
if ((i_su->sg_of_su->sg_redundancy_model == 
SA_AMF_2N_REDUNDANCY_MODEL) &&
(i_su->sg_of_su->sg_fsm_state == 
AVD_SG_FSM_STABLE))
(void) avd_clm_track_start();
-   /* If Std ctlr went down in middle of Cold sync, then we need
-  to reset the sync state to IN_SYNC. */
-   if ((i_su->sg_of_su->sg_redundancy_model == 
SA_AMF_2N_REDUNDANCY_MODEL) &&
-   (cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC)) {
-   TRACE("Marking sync_state as in_sync");
-   cb->stby_sync_state = AVD_STBY_IN_SYNC;
-   }
/* Free all the SU SI assignments*/ 
+
i_su->delete_all_susis();
 
}   /* for (const auto& i_su : avnd->list_of_su) */

--
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel