Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,

On 2/22/2017 12:19 PM, Vu Minh Nguyen wrote:
> [Vu] I has sent you 02 patches. There is code change in osaflogd code that
> fix the coredump you have observed.
> The other one is test code that fix the logtest coredump.

Ok I will re-test , and update you .

-AVM

On 2/22/2017 12:19 PM, Vu Minh Nguyen wrote:
> Hi Mahehs,
>
> See my reply inline, [Vu].
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Wednesday, February 22, 2017 1:36 PM
>> To: Vu Minh Nguyen ;
>> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
>> destinations of log records [#2258] V4
>>
>> Hi Vu,
>>
>>
>> On 2/22/2017 11:52 AM, Vu Minh Nguyen wrote:
>>> Hi Mahesh,
>>>
>>> Have a code fault in uml test, and other one in checkpoint.
>> [AVM] This is Normal Suse 11 VM ( not  UML).
>>> I have just updated the code. Please re-apply for #3 and #4 patches.
>> [AVM] is these new patch has function changes or only test code changes ?
> [Vu] I has sent you 02 patches. There is code change in osaflogd code that
> fix the coredump you have observed.
> The other one is test code that fix the logtest coredump.
>>> Note that, test case #14 of suite 17 should be run on active node,
>> otherwise
>>> getting failed.
>> [AVM]  Segmentation fault of  /usr/bin/logtest Not a big issue ,
>>we need to debug why  osaflogd core dumped and it is critical
> [Vu] I found the problem. You can try with the new one to see if the
> coredump is still there or not.
>>> I will put condition check to that test case later.
>>
>> -AVM
>>
>>
>>> Regards, Vu
>>>
 -Original Message-
 From: A V Mahesh [mailto:mahesh.va...@oracle.com]
 Sent: Wednesday, February 22, 2017 12:16 PM
 To: Vu Minh Nguyen ;
 lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
 destinations of log records [#2258] V4

 Hi Vu,

 Thanks ,

 While testing  /usr/bin/logtest ,  SC-2 standby osaflogd core dumped
> and
 /usr/bin/logtest on SC-1 Active
 got Segmentation fault , am I missing any other patch (  i am using
 devel published patch only )

 Following patches i am using :

 1) #2293 (sent by Anders Widel, but not yet pushed)
   2) #2258 (v2, sent by Lennart, but not yet pushed yet)
   3) #2258 (v4, sent by Vu, but not yet pushed yet)


>> ==
 


 Core was generated by `/usr/lib64/opensaf/osaflogd'.
 Program terminated with signal 11, Segmentation fault.
 #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
 src/log/logd/lgs_mbcsv.cc:2195
 2195src/log/logd/lgs_mbcsv.cc: No such file or directory.
in src/log/logd/lgs_mbcsv.cc
 (gdb) bt
 #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
 src/log/logd/lgs_mbcsv.cc:2195
 #1  0x7f12c3e22960 in ckpt_decode_log_struct(lgs_cb*,
 ncs_mbcsv_cb_arg*, void*, void*, unsigned int (*)(edu_hdl_tag*,
 edu_tkn_tag*, void*, unsigned int*, edu_buf_env_tag*, EDP_OP_TYPE,
 EDU_ERR*)) () at src/log/logd/lgs_mbcsv.cc:950
 #2  0x7f12c3e240dc in ckpt_decode_async_update(lgs_cb*,
 ncs_mbcsv_cb_arg*) () at src/log/logd/lgs_mbcsv.cc:1086
 #3  0x7f12c3e26941 in mbcsv_callback(ncs_mbcsv_cb_arg*) () at
 src/log/logd/lgs_mbcsv.cc:880
 #4  0x7f12c2f25596 in ncs_mbscv_rcv_decode () from
 /usr/lib/../lib64/libopensaf_core.so.0
 #5  0x7f12c2f25766 in ncs_mbcsv_rcv_async_update () from
 /usr/lib/../lib64/libopensaf_core.so.0
 #6  0x7f12c2f2c370 in mbcsv_process_events () from
 /usr/lib/../lib64/libopensaf_core.so.0
 #7  0x7f12c2f2c4db in mbcsv_hdl_dispatch_all () from
 /usr/lib/../lib64/libopensaf_core.so.0
 #8  0x7f12c2f26ce2 in mbcsv_process_dispatch_request () at
 src/mbc/mbcsv_api.c:423
 #9  0x7f12c3e2396e in lgs_mbcsv_dispatch(unsigned int) () at
 src/log/logd/lgs_mbcsv.cc:327
 #10 0x7f12c3e009f2 in main () at src/log/logd/lgs_main.cc:583
 (gdb)


>> ==
 

 Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Invalid error reported
 implementer 'safLogService', Ccb 161 will be aborted
 Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 aborted in
>> COMPLETED
 processing (validation)
 Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 ABORTED
>> (immcfg_SC-
 1_5394)
 Add values Fail

 Program received signal SIGSEGV, Segmentation fault.
 0x5556929a in read_and_compare.isra.7 () at
 

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread Vu Minh Nguyen
Hi Mahehs,

See my reply inline, [Vu].

Regards, Vu

> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Wednesday, February 22, 2017 1:36 PM
> To: Vu Minh Nguyen ;
> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
> destinations of log records [#2258] V4
> 
> Hi Vu,
> 
> 
> On 2/22/2017 11:52 AM, Vu Minh Nguyen wrote:
> > Hi Mahesh,
> >
> > Have a code fault in uml test, and other one in checkpoint.
> [AVM] This is Normal Suse 11 VM ( not  UML).
> > I have just updated the code. Please re-apply for #3 and #4 patches.
> [AVM] is these new patch has function changes or only test code changes ?
[Vu] I has sent you 02 patches. There is code change in osaflogd code that
fix the coredump you have observed.
The other one is test code that fix the logtest coredump.
> >
> > Note that, test case #14 of suite 17 should be run on active node,
> otherwise
> > getting failed.
> [AVM]  Segmentation fault of  /usr/bin/logtest Not a big issue ,
>   we need to debug why  osaflogd core dumped and it is critical
[Vu] I found the problem. You can try with the new one to see if the
coredump is still there or not.
> > I will put condition check to that test case later.
> 
> 
> -AVM
> 
> 
> >
> > Regards, Vu
> >
> >> -Original Message-
> >> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> >> Sent: Wednesday, February 22, 2017 12:16 PM
> >> To: Vu Minh Nguyen ;
> >> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
> >> Cc: opensaf-devel@lists.sourceforge.net
> >> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
> >> destinations of log records [#2258] V4
> >>
> >> Hi Vu,
> >>
> >> Thanks ,
> >>
> >> While testing  /usr/bin/logtest ,  SC-2 standby osaflogd core dumped
and
> >> /usr/bin/logtest on SC-1 Active
> >> got Segmentation fault , am I missing any other patch (  i am using
> >> devel published patch only )
> >>
> >> Following patches i am using :
> >>
> >>1) #2293 (sent by Anders Widel, but not yet pushed)
> >>  2) #2258 (v2, sent by Lennart, but not yet pushed yet)
> >>  3) #2258 (v4, sent by Vu, but not yet pushed yet)
> >>
> >>
> ==
> >> 
> >>
> >>
> >> Core was generated by `/usr/lib64/opensaf/osaflogd'.
> >> Program terminated with signal 11, Segmentation fault.
> >> #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
> >> src/log/logd/lgs_mbcsv.cc:2195
> >> 2195src/log/logd/lgs_mbcsv.cc: No such file or directory.
> >>   in src/log/logd/lgs_mbcsv.cc
> >> (gdb) bt
> >> #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
> >> src/log/logd/lgs_mbcsv.cc:2195
> >> #1  0x7f12c3e22960 in ckpt_decode_log_struct(lgs_cb*,
> >> ncs_mbcsv_cb_arg*, void*, void*, unsigned int (*)(edu_hdl_tag*,
> >> edu_tkn_tag*, void*, unsigned int*, edu_buf_env_tag*, EDP_OP_TYPE,
> >> EDU_ERR*)) () at src/log/logd/lgs_mbcsv.cc:950
> >> #2  0x7f12c3e240dc in ckpt_decode_async_update(lgs_cb*,
> >> ncs_mbcsv_cb_arg*) () at src/log/logd/lgs_mbcsv.cc:1086
> >> #3  0x7f12c3e26941 in mbcsv_callback(ncs_mbcsv_cb_arg*) () at
> >> src/log/logd/lgs_mbcsv.cc:880
> >> #4  0x7f12c2f25596 in ncs_mbscv_rcv_decode () from
> >> /usr/lib/../lib64/libopensaf_core.so.0
> >> #5  0x7f12c2f25766 in ncs_mbcsv_rcv_async_update () from
> >> /usr/lib/../lib64/libopensaf_core.so.0
> >> #6  0x7f12c2f2c370 in mbcsv_process_events () from
> >> /usr/lib/../lib64/libopensaf_core.so.0
> >> #7  0x7f12c2f2c4db in mbcsv_hdl_dispatch_all () from
> >> /usr/lib/../lib64/libopensaf_core.so.0
> >> #8  0x7f12c2f26ce2 in mbcsv_process_dispatch_request () at
> >> src/mbc/mbcsv_api.c:423
> >> #9  0x7f12c3e2396e in lgs_mbcsv_dispatch(unsigned int) () at
> >> src/log/logd/lgs_mbcsv.cc:327
> >> #10 0x7f12c3e009f2 in main () at src/log/logd/lgs_main.cc:583
> >> (gdb)
> >>
> >>
> ==
> >> 
> >>
> >> Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Invalid error reported
> >> implementer 'safLogService', Ccb 161 will be aborted
> >> Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 aborted in
> COMPLETED
> >> processing (validation)
> >> Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 ABORTED
> (immcfg_SC-
> >> 1_5394)
> >> Add values Fail
> >>
> >> Program received signal SIGSEGV, Segmentation fault.
> >> 0x5556929a in read_and_compare.isra.7 () at
> >> src/log/apitest/tet_LogOiOps.c:1891
> >> 1891src/log/apitest/tet_LogOiOps.c: No such file or directory.
> >>   in src/log/apitest/tet_LogOiOps.c
> >> (gdb) Feb 22 10:37:07 SC-1 sshd[5298]: Accepted keyboard-
> interactive/pam
> >> for root from 10.176.178.22 port 51945 ssh2
> >> bt
> >> #0  0x5556929a in read_and_compare.isra.7 () at
> 

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,

One more point, this is always reproducible ,
I was running /usr/bin/logtest on active node only .

Let us investigate why osaflogd core dumped



SC-1:~ # /etc/init.d/opensafd status
safSISU=safSu=SC-1\,safSg=NoRed\,safApp=OpenSAF,safSi=NoRed1,safApp=OpenSAF
 saAmfSISUHAState=ACTIVE(1)
safSISU=safSu=SC-1\,safSg=2N\,safApp=OpenSAF,safSi=SC-2N,safApp=OpenSAF
 saAmfSISUHAState=ACTIVE(1)
safSISU=safSu=PL-3\,safSg=NoRed\,safApp=OpenSAF,safSi=NoRed2,safApp=OpenSAF
 saAmfSISUHAState=ACTIVE(1)
safSISU=safSu=PL-4\,safSg=NoRed\,safApp=OpenSAF,safSi=NoRed3,safApp=OpenSAF
 saAmfSISUHAState=ACTIVE(1)
safSISU=safSu=SC-2\,safSg=NoRed\,safApp=OpenSAF,safSi=NoRed4,safApp=OpenSAF
 saAmfSISUHAState=ACTIVE(1)
safSISU=safSu=SC-2\,safSg=2N\,safApp=OpenSAF,safSi=SC-2N,safApp=OpenSAF
 saAmfSISUHAState=STANDBY(2)
SC-1:~ #
SC-1:~ #
SC-1:~ # gdb /usr/bin/logtest
GNU gdb (GDB) SUSE (7.3-0.6.1)


Program received signal SIGSEGV, Segmentation fault.
0x5556929a in read_and_compare.isra.7 () at 
src/log/apitest/tet_LogOiOps.c:1891
1891src/log/apitest/tet_LogOiOps.c: No such file or directory.
 in src/log/apitest/tet_LogOiOps.c
(gdb)


Feb 22 12:14:03 SC-2 osafamfnd[4200]: NO 
'safComp=LOG,safSu=SC-2,safSg=2N,safApp=OpenSAF' faulted due to 
'avaDown' : Recovery is 'nodeFailfast'
Feb 22 12:14:03 SC-2 osafamfnd[4200]: ER 
safComp=LOG,safSu=SC-2,safSg=2N,safApp=OpenSAF Faulted due to:avaDown 
Recovery is:nodeFailfast
Feb 22 12:14:03 SC-2 osafamfnd[4200]: Rebooting OpenSAF NodeId = 131599 
EE Name = , Reason: Component faulted: recovery is node failfast, 
OwnNodeId = 131599, SupervisionTime = 60
Feb 22 12:14:04 SC-2 opensaf_reboot: Rebooting local node; timeout=60



On 2/22/2017 12:05 PM, A V Mahesh wrote:
> Hi Vu,
>
>
> On 2/22/2017 11:52 AM, Vu Minh Nguyen wrote:
>> Hi Mahesh,
>>
>> Have a code fault in uml test, and other one in checkpoint.
> [AVM] This is Normal Suse 11 VM ( not  UML).
>> I have just updated the code. Please re-apply for #3 and #4 patches.
> [AVM] is these new patch has function changes or only test code changes ?
>> Note that, test case #14 of suite 17 should be run on active node, otherwise
>> getting failed.
> [AVM]  Segmentation fault of  /usr/bin/logtest Not a big issue ,
>we need to debug why  osaflogd core dumped and it is critical
>> I will put condition check to that test case later.
>
> -AVM
>
>
>> Regards, Vu
>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Wednesday, February 22, 2017 12:16 PM
>>> To: Vu Minh Nguyen ;
>>> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
>>> destinations of log records [#2258] V4
>>>
>>> Hi Vu,
>>>
>>> Thanks ,
>>>
>>> While testing  /usr/bin/logtest ,  SC-2 standby osaflogd core dumped and
>>> /usr/bin/logtest on SC-1 Active
>>> got Segmentation fault , am I missing any other patch (  i am using
>>> devel published patch only )
>>>
>>> Following patches i am using :
>>>
>>> 1) #2293 (sent by Anders Widel, but not yet pushed)
>>>   2) #2258 (v2, sent by Lennart, but not yet pushed yet)
>>>   3) #2258 (v4, sent by Vu, but not yet pushed yet)
>>>
>>> ==
>>> 
>>>
>>>
>>> Core was generated by `/usr/lib64/opensaf/osaflogd'.
>>> Program terminated with signal 11, Segmentation fault.
>>> #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
>>> src/log/logd/lgs_mbcsv.cc:2195
>>> 2195src/log/logd/lgs_mbcsv.cc: No such file or directory.
>>>in src/log/logd/lgs_mbcsv.cc
>>> (gdb) bt
>>> #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
>>> src/log/logd/lgs_mbcsv.cc:2195
>>> #1  0x7f12c3e22960 in ckpt_decode_log_struct(lgs_cb*,
>>> ncs_mbcsv_cb_arg*, void*, void*, unsigned int (*)(edu_hdl_tag*,
>>> edu_tkn_tag*, void*, unsigned int*, edu_buf_env_tag*, EDP_OP_TYPE,
>>> EDU_ERR*)) () at src/log/logd/lgs_mbcsv.cc:950
>>> #2  0x7f12c3e240dc in ckpt_decode_async_update(lgs_cb*,
>>> ncs_mbcsv_cb_arg*) () at src/log/logd/lgs_mbcsv.cc:1086
>>> #3  0x7f12c3e26941 in mbcsv_callback(ncs_mbcsv_cb_arg*) () at
>>> src/log/logd/lgs_mbcsv.cc:880
>>> #4  0x7f12c2f25596 in ncs_mbscv_rcv_decode () from
>>> /usr/lib/../lib64/libopensaf_core.so.0
>>> #5  0x7f12c2f25766 in ncs_mbcsv_rcv_async_update () from
>>> /usr/lib/../lib64/libopensaf_core.so.0
>>> #6  0x7f12c2f2c370 in mbcsv_process_events () from
>>> /usr/lib/../lib64/libopensaf_core.so.0
>>> #7  0x7f12c2f2c4db in mbcsv_hdl_dispatch_all () from
>>> /usr/lib/../lib64/libopensaf_core.so.0
>>> #8  0x7f12c2f26ce2 in mbcsv_process_dispatch_request () 

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,


On 2/22/2017 11:52 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> Have a code fault in uml test, and other one in checkpoint.
[AVM] This is Normal Suse 11 VM ( not  UML).
> I have just updated the code. Please re-apply for #3 and #4 patches.
[AVM] is these new patch has function changes or only test code changes ?
>
> Note that, test case #14 of suite 17 should be run on active node, otherwise
> getting failed.
[AVM]  Segmentation fault of  /usr/bin/logtest Not a big issue ,
  we need to debug why  osaflogd core dumped and it is critical
> I will put condition check to that test case later.


-AVM


>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Wednesday, February 22, 2017 12:16 PM
>> To: Vu Minh Nguyen ;
>> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
>> destinations of log records [#2258] V4
>>
>> Hi Vu,
>>
>> Thanks ,
>>
>> While testing  /usr/bin/logtest ,  SC-2 standby osaflogd core dumped and
>> /usr/bin/logtest on SC-1 Active
>> got Segmentation fault , am I missing any other patch (  i am using
>> devel published patch only )
>>
>> Following patches i am using :
>>
>>1) #2293 (sent by Anders Widel, but not yet pushed)
>>  2) #2258 (v2, sent by Lennart, but not yet pushed yet)
>>  3) #2258 (v4, sent by Vu, but not yet pushed yet)
>>
>> ==
>> 
>>
>>
>> Core was generated by `/usr/lib64/opensaf/osaflogd'.
>> Program terminated with signal 11, Segmentation fault.
>> #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
>> src/log/logd/lgs_mbcsv.cc:2195
>> 2195src/log/logd/lgs_mbcsv.cc: No such file or directory.
>>   in src/log/logd/lgs_mbcsv.cc
>> (gdb) bt
>> #0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at
>> src/log/logd/lgs_mbcsv.cc:2195
>> #1  0x7f12c3e22960 in ckpt_decode_log_struct(lgs_cb*,
>> ncs_mbcsv_cb_arg*, void*, void*, unsigned int (*)(edu_hdl_tag*,
>> edu_tkn_tag*, void*, unsigned int*, edu_buf_env_tag*, EDP_OP_TYPE,
>> EDU_ERR*)) () at src/log/logd/lgs_mbcsv.cc:950
>> #2  0x7f12c3e240dc in ckpt_decode_async_update(lgs_cb*,
>> ncs_mbcsv_cb_arg*) () at src/log/logd/lgs_mbcsv.cc:1086
>> #3  0x7f12c3e26941 in mbcsv_callback(ncs_mbcsv_cb_arg*) () at
>> src/log/logd/lgs_mbcsv.cc:880
>> #4  0x7f12c2f25596 in ncs_mbscv_rcv_decode () from
>> /usr/lib/../lib64/libopensaf_core.so.0
>> #5  0x7f12c2f25766 in ncs_mbcsv_rcv_async_update () from
>> /usr/lib/../lib64/libopensaf_core.so.0
>> #6  0x7f12c2f2c370 in mbcsv_process_events () from
>> /usr/lib/../lib64/libopensaf_core.so.0
>> #7  0x7f12c2f2c4db in mbcsv_hdl_dispatch_all () from
>> /usr/lib/../lib64/libopensaf_core.so.0
>> #8  0x7f12c2f26ce2 in mbcsv_process_dispatch_request () at
>> src/mbc/mbcsv_api.c:423
>> #9  0x7f12c3e2396e in lgs_mbcsv_dispatch(unsigned int) () at
>> src/log/logd/lgs_mbcsv.cc:327
>> #10 0x7f12c3e009f2 in main () at src/log/logd/lgs_main.cc:583
>> (gdb)
>>
>> ==
>> 
>>
>> Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Invalid error reported
>> implementer 'safLogService', Ccb 161 will be aborted
>> Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 aborted in COMPLETED
>> processing (validation)
>> Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 ABORTED (immcfg_SC-
>> 1_5394)
>> Add values Fail
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x5556929a in read_and_compare.isra.7 () at
>> src/log/apitest/tet_LogOiOps.c:1891
>> 1891src/log/apitest/tet_LogOiOps.c: No such file or directory.
>>   in src/log/apitest/tet_LogOiOps.c
>> (gdb) Feb 22 10:37:07 SC-1 sshd[5298]: Accepted keyboard-interactive/pam
>> for root from 10.176.178.22 port 51945 ssh2
>> bt
>> #0  0x5556929a in read_and_compare.isra.7 () at
>> src/log/apitest/tet_LogOiOps.c:1891
>> #1  0x55569bbb in
>> check_logRecordDestinationConfigurationEmpty
>> () at src/log/apitest/tet_LogOiOps.c:2179
>> #2  0x55573495 in run_test_case ()
>> #3  0x55573934 in test_run ()
>> #4  0xc7cd in main () at src/log/apitest/logtest.c:569
>> (gdb)
>>
>> ==
>> 
>>
>> -AVM
>>
>> On 2/22/2017 9:48 AM, Vu Minh Nguyen wrote:
>>> Hi Mahesh,
>>>
>>> I send them in attachment instead, and name them in the order.
>>> I just pull the latest code, and apply them without getting any hunk
> error.
>>> Please try with them, and let me know if you see any problem.
>>>
>>> Regards, Vu
>>>
 -Original Message-
 From: A V Mahesh [mailto:mahesh.va...@oracle.com]
 Sent: Wednesday, February 22, 2017 11:09 AM
 To: Vu Minh Nguyen 

Re: [devel] [PATCH 1 of 1] dtm: Use .1 file name extension for MDS log backup file [#2241]

2017-02-21 Thread A V Mahesh

ACK not tested

-AVM


On 2/21/2017 10:49 PM, Anders Widell wrote:
>   src/dtm/transport/log_writer.cc |  2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> Use a ".1" file name extension for the MDS log backup file. This aligns with 
> the
> naming convention used for log rotation of other log files under /var/log, and
> opens up the possibility for a future enhancement where we can support more 
> than
> one single backup file.
>
> diff --git a/src/dtm/transport/log_writer.cc b/src/dtm/transport/log_writer.cc
> --- a/src/dtm/transport/log_writer.cc
> +++ b/src/dtm/transport/log_writer.cc
> @@ -28,7 +28,7 @@
>   LogWriter::LogWriter()
>   : mds_log_file_{base::GetEnv("pkglogdir", PKGLOGDIR)
> + "/mds.log"},
> -  old_mds_log_file_{mds_log_file_ + ".old"},
> +  old_mds_log_file_{mds_log_file_ + ".1"},
> fd_{-1},
> current_file_size_{0},
> current_buffer_size_{0},


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,

Thanks ,

While testing  /usr/bin/logtest ,  SC-2 standby osaflogd core dumped and 
/usr/bin/logtest on SC-1 Active
got Segmentation fault , am I missing any other patch (  i am using 
devel published patch only )

Following patches i am using :

  1) #2293 (sent by Anders Widel, but not yet pushed)
2) #2258 (v2, sent by Lennart, but not yet pushed yet)
3) #2258 (v4, sent by Vu, but not yet pushed yet)

==
 


Core was generated by `/usr/lib64/opensaf/osaflogd'.
Program terminated with signal 11, Segmentation fault.
#0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at 
src/log/logd/lgs_mbcsv.cc:2195
2195src/log/logd/lgs_mbcsv.cc: No such file or directory.
 in src/log/logd/lgs_mbcsv.cc
(gdb) bt
#0  ckpt_proc_cfg_stream(lgs_cb*, void*) () at 
src/log/logd/lgs_mbcsv.cc:2195
#1  0x7f12c3e22960 in ckpt_decode_log_struct(lgs_cb*, 
ncs_mbcsv_cb_arg*, void*, void*, unsigned int (*)(edu_hdl_tag*, 
edu_tkn_tag*, void*, unsigned int*, edu_buf_env_tag*, EDP_OP_TYPE, 
EDU_ERR*)) () at src/log/logd/lgs_mbcsv.cc:950
#2  0x7f12c3e240dc in ckpt_decode_async_update(lgs_cb*, 
ncs_mbcsv_cb_arg*) () at src/log/logd/lgs_mbcsv.cc:1086
#3  0x7f12c3e26941 in mbcsv_callback(ncs_mbcsv_cb_arg*) () at 
src/log/logd/lgs_mbcsv.cc:880
#4  0x7f12c2f25596 in ncs_mbscv_rcv_decode () from 
/usr/lib/../lib64/libopensaf_core.so.0
#5  0x7f12c2f25766 in ncs_mbcsv_rcv_async_update () from 
/usr/lib/../lib64/libopensaf_core.so.0
#6  0x7f12c2f2c370 in mbcsv_process_events () from 
/usr/lib/../lib64/libopensaf_core.so.0
#7  0x7f12c2f2c4db in mbcsv_hdl_dispatch_all () from 
/usr/lib/../lib64/libopensaf_core.so.0
#8  0x7f12c2f26ce2 in mbcsv_process_dispatch_request () at 
src/mbc/mbcsv_api.c:423
#9  0x7f12c3e2396e in lgs_mbcsv_dispatch(unsigned int) () at 
src/log/logd/lgs_mbcsv.cc:327
#10 0x7f12c3e009f2 in main () at src/log/logd/lgs_main.cc:583
(gdb)

==

Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Invalid error reported 
implementer 'safLogService', Ccb 161 will be aborted
Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 aborted in COMPLETED 
processing (validation)
Feb 22 10:37:06 SC-1 osafimmnd[4020]: NO Ccb 161 ABORTED (immcfg_SC-1_5394)
Add values Fail

Program received signal SIGSEGV, Segmentation fault.
0x5556929a in read_and_compare.isra.7 () at 
src/log/apitest/tet_LogOiOps.c:1891
1891src/log/apitest/tet_LogOiOps.c: No such file or directory.
 in src/log/apitest/tet_LogOiOps.c
(gdb) Feb 22 10:37:07 SC-1 sshd[5298]: Accepted keyboard-interactive/pam 
for root from 10.176.178.22 port 51945 ssh2
bt
#0  0x5556929a in read_and_compare.isra.7 () at 
src/log/apitest/tet_LogOiOps.c:1891
#1  0x55569bbb in check_logRecordDestinationConfigurationEmpty 
() at src/log/apitest/tet_LogOiOps.c:2179
#2  0x55573495 in run_test_case ()
#3  0x55573934 in test_run ()
#4  0xc7cd in main () at src/log/apitest/logtest.c:569
(gdb)

==

-AVM

On 2/22/2017 9:48 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> I send them in attachment instead, and name them in the order.
> I just pull the latest code, and apply them without getting any hunk error.
>
> Please try with them, and let me know if you see any problem.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Wednesday, February 22, 2017 11:09 AM
>> To: Vu Minh Nguyen ;
>> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
>> destinations of log records [#2258] V4
>>
>> Hi Vu,
>>
>> I did follow that still i get Hunk #2 FAILED even on today's staging
>>
>> ==
>> ==
>>
>> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2293
>> patching file src/base/Makefile.am
>> Hunk #1 succeeded at 33 (offset 1 line).
>> Hunk #3 succeeded at 183 (offset 1 line).
>> patching file src/base/file_descriptor.cc
>> patching file src/base/file_descriptor.h
>> patching file src/base/tests/unix_socket_test.cc
>> patching file src/base/unix_client_socket.cc
>> patching file src/base/unix_server_socket.cc
>> patching file src/base/unix_socket.cc
>> patching file src/base/unix_socket.h
>>
>> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-1
>> patching file src/log/Makefile.am
>> Hunk #1 succeeded at 71 (offset -1 lines).
>> patching file src/log/config/logsv_classes.xml
>> Hunk #1 FAILED at 147.
>> 1 out of 1 hunk FAILED -- saving rejects to file
>> src/log/config/logsv_classes.xml.rej
>> patching file 

Re: [devel] [PATCH 1 of 1] AMFND: Ensure su operational message synchronizes with component failover sequence [#2233]

2017-02-21 Thread praveen malviya
Hi Minh,

Please see response with [Praveen]

Thanks
Praveen

On 22-Feb-17 5:39 AM, minh chau wrote:
> Hi Praveen,
>
> Please find my response with [Minh2]
>
> Thanks,
> Minh
>
> On 21/02/17 16:45, praveen malviya wrote:
>> Hi Minh,
>>
>> Please find my response inline with [Praveen].
>>
>> Thanks,
>> Praveen
>>
>> On 20-Feb-17 6:58 AM, minh chau wrote:
>>> Hi Praveen,
>>>
>>> Thanks for your V2 patch, I have tested V2 in scenario of ticket #2233
>>> and #1902, it also can fix the problem.
>>> Here we have 2 solutions:
>>> - The one I sent for review is letting the failed component to be
>>> instantiated, I think it is current behavior. But one change is that
>>> amfnd will not report su operational message to amfd until amfnd
>>> finishes removing the assignment of (faulty) su which contains the
>>> failed component
>>> - The V2 patch postpones the instantiation of failed component. amfnd
>>> will instantiate the failed component (via avnd_err_su_repair) after
>>> amfnd finishes removing the assignment of faulty su.
>>>
>>> So basically the difference is the time that the failed component should
>>> be instantiated.
>>>
>>> Still in item 3.11.1.3.2:
>>> "In a 2N or N+M redundancy model, SI2 also needs to be switched over;
>>> other-wise, the number of active service units would be higher than what
>>> is allowed by the redundancy model. However, in an Nway redundancy
>>> model, SI2 could be left assigned to SU1 (if the saAmfSUFailover
>>> configuration attribute of the ser-vice unit is set to SA_FALSE), and a
>>> repair of C2 should be attempted by reinstantiating it. If the attempt
>>> to instantiate C2 fails, the service unit becomes disabled, and SI2 must
>>> be switched-over; however, if the attempt to instantiate C2 is
>>> successful, SI2 shall remain assigned to SU1, and based on other
>>> configuration parameters and N-way redundancy model semantics, even SI1
>>> might get reassigned to SU1."
>>>
>>> My comment on V2:
>>>
>>> The configuration in #2233 is different from the example in
>>> specification, but it sounds to me the attempt to instantiate failed
>>> component should be done as soon as possible.
>>> The check in V2 patch means the failed component won't be instantiated
>>> if its SU still has any assignment. It should be true to 2N and N+M, but
>>> it's not for other SG. (As the example in specification, S2 does not
>>> have any CSI assigned to failed component C2).
>> [Praveen]As of now we have documented in the PR doc (conformance table
>> section 3.11.1.3 Recovery) that if a component faults with
>> comp-failover recovery then AMFD switch-overs the whole SU for N-Way,
>> N-Way Active and N+M models also. This is just to highlight about
>> other red models. But this documentation is not clear for an
>> unassigned comp.
>> But from the beginning, comp-failover is working this way only.
>> At-least from clean up perspective we have fixed the problem of
>> parallelism in the past in the ticket #474.
>>
>> One more thing I have noted, proxy-proxied implementation is based on
>> B.01.01. As per B.01.01, proxy will register himself and its proxied
>> as soon as it gets instantiated. In a configuration containing both
>> proxy and proxied comp, if the proxy does not get any CSI and it
>> faults with comp-failover recovery then in instantiation phase it may
>> again register its proxy. I think proxy in other SU should register
>> its proxied. I guess, from deployment perspective such a configuration
>> in which a user configures proxy without any CSI may not exists and
>> only possibility is an application modeling a legacy code in NoRed
>> model. However, in the later version of spec B.01.02, proxied was
>> supposed to mention the name of proxy CSI and thus proxy should
>> register only when its get proxy CSI.
>>
>> One more point to be noted comp-failover can also be done as a part of
>> escalation also. If a component is instantiated before the completion
>> of comp-failover recovery and if faults again then it may escalate to
>> node-failover before completion of comp-failover recovery.
>>
>> Since in spec there is no specific discussion for comp-failover
>> recovery for an unassigned comp, I will encourage other maintainers
>> also to provide inputs.
> [Minh2] Yes this was my worry too, that I could break something that has
> been working for long time in this area. If you look at component
> failover in successful case, the su operational message is always
> reported to amfd at the time amfnd completes removing assignment of su
> that hosts failed component. But there is no mechanism for now to
> guarantee that message always is sent in such order. So I only intended
> to bring the su operational message to be sent at the spot as it is
> currently working in successful case, and try not to touch everything
> else. I think the patch also aligns with AMFD's code which is seeing the
> su of failed component as an out-of-service su.
> Could you please tell me if any problem with my 

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,

Sorry I did missed  Lennart #2258 (v2) , now it is fine

-AVM


On 2/22/2017 9:39 AM, A V Mahesh wrote:
> Hi Vu,
>
> I did follow that still i get Hunk #2 FAILED even on today's staging
>
> 
>  
>
>
> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2293
> patching file src/base/Makefile.am
> Hunk #1 succeeded at 33 (offset 1 line).
> Hunk #3 succeeded at 183 (offset 1 line).
> patching file src/base/file_descriptor.cc
> patching file src/base/file_descriptor.h
> patching file src/base/tests/unix_socket_test.cc
> patching file src/base/unix_client_socket.cc
> patching file src/base/unix_server_socket.cc
> patching file src/base/unix_socket.cc
> patching file src/base/unix_socket.h
>
> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-1
> patching file src/log/Makefile.am
> Hunk #1 succeeded at 71 (offset -1 lines).
> patching file src/log/config/logsv_classes.xml
> Hunk #1 FAILED at 147.
> 1 out of 1 hunk FAILED -- saving rejects to file 
> src/log/config/logsv_classes.xml.rej
> patching file src/log/logd/lgs_config.cc
> Hunk #1 succeeded at 35 (offset -5 lines).
> Hunk #2 FAILED at 705.
> Hunk #3 FAILED at 971.
> 2 out of 3 hunks FAILED -- saving rejects to file 
> src/log/logd/lgs_config.cc.rej
> patching file src/log/logd/lgs_config.h
> Hunk #1 FAILED at 304.
> 1 out of 1 hunk FAILED -- saving rejects to file 
> src/log/logd/lgs_config.h.rej
> patching file src/log/logd/lgs_dest.cc
> patching file src/log/logd/lgs_dest.h
> patching file src/log/logd/lgs_evt.cc
> patching file src/log/logd/lgs_imm.cc
> Hunk #1 FAILED at 45.
> Hunk #2 succeeded at 235 (offset -1 lines).
> Hunk #3 FAILED at 877.
> Hunk #4 succeeded at 1273 (offset -20 lines).
> Hunk #5 succeeded at 1404 (offset -1 lines).
> Hunk #6 succeeded at 1449 (offset -20 lines).
> Hunk #7 succeeded at 2032 (offset -1 lines).
> Hunk #8 FAILED at 2181.
> Hunk #9 succeeded at 2271 (offset -54 lines).
> Hunk #10 succeeded at 2387 (offset -1 lines).
> Hunk #11 succeeded at 2377 (offset -54 lines).
> Hunk #12 succeeded at 2478 (offset -1 lines).
> Hunk #13 succeeded at 2684 (offset -54 lines).
> Hunk #14 succeeded at 2821 (offset -1 lines).
> 3 out of 14 hunks FAILED -- saving rejects to file 
> src/log/logd/lgs_imm.cc.rej
> patching file src/log/logd/lgs_main.cc
> patching file src/log/logd/lgs_mbcsv.cc
> patching file src/log/logd/lgs_mbcsv.h
> patching file src/log/logd/lgs_mbcsv_v5.cc
> Hunk #3 succeeded at 133 (offset -1 lines).
> patching file src/log/logd/lgs_mbcsv_v7.cc
> patching file src/log/logd/lgs_mbcsv_v7.h
> patching file src/log/logd/lgs_stream.cc
> patching file src/log/logd/lgs_stream.h
> patching file src/log/logd/lgs_util.cc
> patching file src/log/logd/lgs_util.h
>
> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-2
> patching file src/log/Makefile.am
> Hunk #1 succeeded at 180 (offset -3 lines).
> patching file src/log/apitest/tet_LogOiOps.c
> Hunk #1 FAILED at 1923.
> Hunk #2 FAILED at 1979.
> Hunk #3 FAILED at 2067.
> Hunk #4 FAILED at 2094.
> 4 out of 4 hunks FAILED -- saving rejects to file 
> src/log/apitest/tet_LogOiOps.c.rej
> patching file src/log/apitest/tet_cfg_destination.c
>
> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-3
> patching file src/log/Makefile
> patching file src/log/Makefile.am
> Hunk #1 succeeded at 80 (offset -1 lines).
> Hunk #2 succeeded at 217 (offset -2 lines).
> patching file src/log/tests/Makefile
> patching file src/log/tests/lgs_dest_test.cc
> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# vi 
> src/log/apitest/tet_LogOiOps.c.rej
> [root@dhcp-hyd-scp-5fl-10-176-177-96 staging]#
>
> ==
>  
>
>
> -AVM
>
> On 2/21/2017 3:53 PM, Vu Minh Nguyen wrote:
>> Hi Mahesh,
>>
>> As I has mentioned in below:
To run the test, this patch has dependent on following patches:
1) #2293 (sent by Anders Widel, but not yet pushed)
2) #2258 (v2, sent by Lennart, but not yet pushed yet)
>> So, you need to apply #2293 first, then #2258 which sent by Lennart
>> yesterday, then mine.
>>
>> Regards, Vu
>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Tuesday, February 21, 2017 5:10 PM
>>> To: Vu Minh Nguyen ;
>>> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
>>> destinations of log records [#2258] V4
>>>
>>> Hi Vu,
>>>
>>> Is this applies on top of   log #2146  - V4  , I see  both #tickets  
>>> has
>>> version changes ?
>>>
>>> in which order i need to apply  ( #2146 & #2258 )or (#2258 & 
>>> #2146).
>>>
>>> =
>>>
>>> patching file src/log/Makefile.am
>>> Hunk #1 FAILED at 72.
>>> Hunk #2 FAILED at 120.
>>> 2 out of 2 

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,

I did follow that still i get Hunk #2 FAILED even on today's staging



[root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2293
patching file src/base/Makefile.am
Hunk #1 succeeded at 33 (offset 1 line).
Hunk #3 succeeded at 183 (offset 1 line).
patching file src/base/file_descriptor.cc
patching file src/base/file_descriptor.h
patching file src/base/tests/unix_socket_test.cc
patching file src/base/unix_client_socket.cc
patching file src/base/unix_server_socket.cc
patching file src/base/unix_socket.cc
patching file src/base/unix_socket.h

[root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-1
patching file src/log/Makefile.am
Hunk #1 succeeded at 71 (offset -1 lines).
patching file src/log/config/logsv_classes.xml
Hunk #1 FAILED at 147.
1 out of 1 hunk FAILED -- saving rejects to file 
src/log/config/logsv_classes.xml.rej
patching file src/log/logd/lgs_config.cc
Hunk #1 succeeded at 35 (offset -5 lines).
Hunk #2 FAILED at 705.
Hunk #3 FAILED at 971.
2 out of 3 hunks FAILED -- saving rejects to file 
src/log/logd/lgs_config.cc.rej
patching file src/log/logd/lgs_config.h
Hunk #1 FAILED at 304.
1 out of 1 hunk FAILED -- saving rejects to file 
src/log/logd/lgs_config.h.rej
patching file src/log/logd/lgs_dest.cc
patching file src/log/logd/lgs_dest.h
patching file src/log/logd/lgs_evt.cc
patching file src/log/logd/lgs_imm.cc
Hunk #1 FAILED at 45.
Hunk #2 succeeded at 235 (offset -1 lines).
Hunk #3 FAILED at 877.
Hunk #4 succeeded at 1273 (offset -20 lines).
Hunk #5 succeeded at 1404 (offset -1 lines).
Hunk #6 succeeded at 1449 (offset -20 lines).
Hunk #7 succeeded at 2032 (offset -1 lines).
Hunk #8 FAILED at 2181.
Hunk #9 succeeded at 2271 (offset -54 lines).
Hunk #10 succeeded at 2387 (offset -1 lines).
Hunk #11 succeeded at 2377 (offset -54 lines).
Hunk #12 succeeded at 2478 (offset -1 lines).
Hunk #13 succeeded at 2684 (offset -54 lines).
Hunk #14 succeeded at 2821 (offset -1 lines).
3 out of 14 hunks FAILED -- saving rejects to file 
src/log/logd/lgs_imm.cc.rej
patching file src/log/logd/lgs_main.cc
patching file src/log/logd/lgs_mbcsv.cc
patching file src/log/logd/lgs_mbcsv.h
patching file src/log/logd/lgs_mbcsv_v5.cc
Hunk #3 succeeded at 133 (offset -1 lines).
patching file src/log/logd/lgs_mbcsv_v7.cc
patching file src/log/logd/lgs_mbcsv_v7.h
patching file src/log/logd/lgs_stream.cc
patching file src/log/logd/lgs_stream.h
patching file src/log/logd/lgs_util.cc
patching file src/log/logd/lgs_util.h

[root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-2
patching file src/log/Makefile.am
Hunk #1 succeeded at 180 (offset -3 lines).
patching file src/log/apitest/tet_LogOiOps.c
Hunk #1 FAILED at 1923.
Hunk #2 FAILED at 1979.
Hunk #3 FAILED at 2067.
Hunk #4 FAILED at 2094.
4 out of 4 hunks FAILED -- saving rejects to file 
src/log/apitest/tet_LogOiOps.c.rej
patching file src/log/apitest/tet_cfg_destination.c

[root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# patch -p1 <2258-3
patching file src/log/Makefile
patching file src/log/Makefile.am
Hunk #1 succeeded at 80 (offset -1 lines).
Hunk #2 succeeded at 217 (offset -2 lines).
patching file src/log/tests/Makefile
patching file src/log/tests/lgs_dest_test.cc
[root@dhcp-hyd-scp-5fl-10-176-177-96 staging]# vi 
src/log/apitest/tet_LogOiOps.c.rej
[root@dhcp-hyd-scp-5fl-10-176-177-96 staging]#

==

-AVM

On 2/21/2017 3:53 PM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> As I has mentioned in below:
>>>To run the test, this patch has dependent on following patches:
>>>1) #2293 (sent by Anders Widel, but not yet pushed)
>>>2) #2258 (v2, sent by Lennart, but not yet pushed yet)
> So, you need to apply #2293 first, then #2258 which sent by Lennart
> yesterday, then mine.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, February 21, 2017 5:10 PM
>> To: Vu Minh Nguyen ;
>> lennart.l...@ericsson.com; canh.v.tru...@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 0 of 3] Review Request for log: add alternative
>> destinations of log records [#2258] V4
>>
>> Hi Vu,
>>
>> Is this applies on top of   log #2146  - V4  , I see  both #tickets  has
>> version changes ?
>>
>> in which order i need to apply  ( #2146 & #2258 )or (#2258 & #2146).
>>
>> =
>>
>> patching file src/log/Makefile.am
>> Hunk #1 FAILED at 72.
>> Hunk #2 FAILED at 120.
>> 2 out of 2 hunks FAILED -- saving rejects to file src/log/Makefile.am.rej
>> patching file src/log/config/logsv_classes.xml
>> Hunk #1 FAILED at 147.
>> 1 out of 1 hunk FAILED -- saving rejects to file
>> src/log/config/logsv_classes.xml.rej
>> patching file src/log/logd/lgs_config.cc
>> Hunk #1 succeeded at 35 (offset -5 lines).
>> Hunk #2 FAILED at 705.
>> 

[devel] [PATCH 0 of 1] Review Request for osaf: fix saflog to handle long log record [#2313]

2017-02-21 Thread Nguyen TK Luu
Summary: osaf: fix saflog to handle long log record [#2313]
Review request for Trac Ticket(s): #2313
Peer Reviewer(s): Lennart Lund, Mahesh Valla, Vu M Nguyen
Pull request to: Vu M Nguyen
Affected branch(es): all
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
saflog is a utility function provided for other OpenSAF services
to write log records to the system log stream.

Before this ticket, saflog limited the log record size to only 255
chars, which made it not possible to write log records containing
long dns (> 255 chars).

This ticket increases the log record size limit to 65,535 chars
(SA_LOG_MAX_RECORD_SIZE) to allow logging long log records that
may contain long dns.

changeset 5a45816a6858f098ec6ba10fcc365585fa69b6fb
Author: Nguyen TK Luu 
Date:   Wed, 22 Feb 2017 10:30:59 +0700

osaf: fix saflog to handle long log record [#2313]

saflog is a utility function provided for other OpenSAF services to 
write
log records to the system log stream.

Before this ticket, saflog limited the log record size to only 255 
chars,
which made it not possible to write log records containing long dns (> 
255
chars).

This ticket increases the log record size limit to 65,535 chars
(SA_LOG_MAX_RECORD_SIZE) to allow logging long log records that may 
contain
long dns.


Complete diffstat:
--
 src/osaf/saflog/saflog.c |  10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)


Testing Commands:
-
Use amf_demo with 2N model containing long dns.
Do some admin ops on the SU/Comp of amf_demo.

Testing, Expected Results:
--
Created long-dn objects and changed states of SU/Comp
after admin ops are logged to saLogSystem_xxx file.

Conditions of Submission:
-
Ack from reviewers or after 2 weeks


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



[devel] [PATCH 1 of 1] osaf: fix saflog to handle long log record [#2313]

2017-02-21 Thread Nguyen TK Luu
 src/osaf/saflog/saflog.c |  10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)


saflog is a utility function provided for other OpenSAF services
to write log records to the system log stream.

Before this ticket, saflog limited the log record size to only 255
chars, which made it not possible to write log records containing
long dns (> 255 chars).

This ticket increases the log record size limit to 65,535 chars
(SA_LOG_MAX_RECORD_SIZE) to allow logging long log records that
may contain long dns.

diff --git a/src/osaf/saflog/saflog.c b/src/osaf/saflog/saflog.c
--- a/src/osaf/saflog/saflog.c
+++ b/src/osaf/saflog/saflog.c
@@ -1,6 +1,7 @@
 /*  -*- OpenSAF  -*-
  *
  * (C) Copyright 2010 The OpenSAF Foundation
+ * (C) Copyright 2017 Ericsson AB. All Rights Reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -58,12 +59,19 @@ void saflog(int priority, const SaNameT 
SaLogRecordT logRecord;
SaLogBufferT logBuffer;
va_list ap;
-   char str[256];
+   char str[SA_LOG_MAX_RECORD_SIZE + 1];
+   /* SA_LOG_MAX_RECORD_SIZE = 65535
+* This will allow logging of record containing long dns */
 
va_start(ap, format);
logBuffer.logBufSize = vsnprintf(str, sizeof(str), format, ap);
va_end(ap);
 
+   if (logBuffer.logBufSize > SA_LOG_MAX_RECORD_SIZE) {
+   syslog(LOG_INFO, "saflog write FAILED: log record size > %u max 
limit", SA_LOG_MAX_RECORD_SIZE);
+   return;
+   }
+
if (!initialized) {
SaVersionT logVersion = { 'A', 2, 1 };
SaNameT stream_name;

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread Vu Minh Nguyen
Ack

Regards, Vu

> -Original Message-
> From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au]
> Sent: Thursday, February 16, 2017 1:49 PM
> To: lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au;
> mahesh.va...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 0 of 3] Review Request for log: implement
> SaLogFilterSetCallbackT and version handling V4 [#2146]
> 
> Summary: log: implement SaLogFilterSetCallbackT and version handling V4
> [#2146]
> Review request for Trac Ticket(s): #2146
> Peer Reviewer(s): Lennart, Vu, Mahesh
> Pull request to: Vu
> Affected branch(es): default
> Development branch: default
> 
> 
> Impacted area   Impact y/n
> 
>  Docsn
>  Build systemn
>  RPM/packaging   n
>  Configuration files n
>  Startup scripts n
>  SAF servicesn
>  OpenSAF servicesy
>  Core libraries  n
>  Samples n
>  Tests   n
>  Other   n
> 
> 
> Comments (indicate scope for each "y" above):
> -
>  <>
> 
> changeset 05726400fc1a27cf50255b70bb7f952156cbe68f
> Author:   Canh Van Truong 
> Date: Mon, 21 Nov 2016 17:19:56 +0700
> 
>   log: implement SaLogFilterSetCallbackT [#2146]
> 
>   Implement SaLogFilterSetCallbackT which is mentioned at section
> 3.6.5
>   SaLogFilterSetCallbackT @ AIS LOG document.
> 
>   LGS:
>- Whenever severity filter is changed for app and systerm
streams,
> lgs will
>   find which clients that associate with the stream. Then lgs sends
> message
>   callback to clients.
>- Encoding callback message for severity filter callback
> 
>   LGA:
>- Decoding callback message for severity callback from lgs and
> send the
>   message to the client which setting filter callback.
>- Dispatching severity filter callback
> 
>   - Encrease version of log service to A.02.03
> 
> changeset 8d41edf85334f1b14d858e2ad2f705aecf6b9a68
> Author:   Canh Van Truong 
> Date: Tue, 17 Jan 2017 14:24:33 +0700
> 
>   log: Add minor version checking in log server [#2146]
> 
>   Checking minor version and return version error if major/minor
> version is
>   higher than supported major/minor
> 
>   Add client_version to log_client_t and checkpoint struct in lgs
> 
>   Increase checkpoint version and checkpoint client_ver to stand by
> 
>   Only send filter callback to client that initialized with minor
version >
> 3
> 
> changeset ff130149eb45136a50563878431a92b52e024997
> Author:   Canh Van Truong 
> Date: Tue, 17 Jan 2017 15:42:40 +0700
> 
>   log: fix checking version in log agent [#2146]
> 
>   Fix checking version in log agent
> 
>   The agent report highest supported version except getting
> ERR_VERSION from
>   server. if agent get ERR_VERSION, it will set supported version to
> A.02.03
> 
> 
> Added Files:
> 
>  src/log/logd/lgs_mbcsv_v6.cc
>  src/log/logd/lgs_mbcsv_v6.h
> 
> 
> Complete diffstat:
> --
>  src/log/Makefile.am   |3 +
>  src/log/agent/lga.h   |4 +
>  src/log/agent/lga_api.c   |   58 +++--
>  src/log/agent/lga_mds.c   |   71
++
>  src/log/agent/lga_util.c  |   64 +++-
>  src/log/apitest/logtest.c |3 +-
>  src/log/apitest/logtestfr.c   |3 +-
>  src/log/apitest/saflogtest.c  |3 +-
>  src/log/apitest/tet_LogOiOps.c|   72
++
>  src/log/apitest/tet_log_longDN.c  |3 +-
>  src/log/apitest/tet_saLogFilterSetCallbackT.c |  418
> ++
> ++
> -
>  src/log/apitest/tet_saLogInitialize.c |   24 +++
>  src/log/apitest/tet_saLogStreamOpen_2.c   |3 +-
>  src/log/common/lgsv_defs.h|7 +-
>  src/log/common/lgsv_msg.h |8 ++
>  src/log/logd/lgs_cb.h |2 +
>  src/log/logd/lgs_evt.cc   |   93
++---
>  src/log/logd/lgs_imm.cc   |8 ++
>  src/log/logd/lgs_mbcsv.cc |  181
> 
>  src/log/logd/lgs_mbcsv.h  |9 ++-
>  src/log/logd/lgs_mbcsv_v6.cc  |  169
> +
>  src/log/logd/lgs_mbcsv_v6.h   |   56 +
>  src/log/logd/lgs_mds.cc   |   58 

Re: [devel] [PATCH 1 of 1] AMFND: Ensure su operational message synchronizes with component failover sequence [#2233]

2017-02-21 Thread minh chau
Hi Praveen,

Please find my response with [Minh2]

Thanks,
Minh

On 21/02/17 16:45, praveen malviya wrote:
> Hi Minh,
>
> Please find my response inline with [Praveen].
>
> Thanks,
> Praveen
>
> On 20-Feb-17 6:58 AM, minh chau wrote:
>> Hi Praveen,
>>
>> Thanks for your V2 patch, I have tested V2 in scenario of ticket #2233
>> and #1902, it also can fix the problem.
>> Here we have 2 solutions:
>> - The one I sent for review is letting the failed component to be
>> instantiated, I think it is current behavior. But one change is that
>> amfnd will not report su operational message to amfd until amfnd
>> finishes removing the assignment of (faulty) su which contains the
>> failed component
>> - The V2 patch postpones the instantiation of failed component. amfnd
>> will instantiate the failed component (via avnd_err_su_repair) after
>> amfnd finishes removing the assignment of faulty su.
>>
>> So basically the difference is the time that the failed component should
>> be instantiated.
>>
>> Still in item 3.11.1.3.2:
>> "In a 2N or N+M redundancy model, SI2 also needs to be switched over;
>> other-wise, the number of active service units would be higher than what
>> is allowed by the redundancy model. However, in an Nway redundancy
>> model, SI2 could be left assigned to SU1 (if the saAmfSUFailover
>> configuration attribute of the ser-vice unit is set to SA_FALSE), and a
>> repair of C2 should be attempted by reinstantiating it. If the attempt
>> to instantiate C2 fails, the service unit becomes disabled, and SI2 must
>> be switched-over; however, if the attempt to instantiate C2 is
>> successful, SI2 shall remain assigned to SU1, and based on other
>> configuration parameters and N-way redundancy model semantics, even SI1
>> might get reassigned to SU1."
>>
>> My comment on V2:
>>
>> The configuration in #2233 is different from the example in
>> specification, but it sounds to me the attempt to instantiate failed
>> component should be done as soon as possible.
>> The check in V2 patch means the failed component won't be instantiated
>> if its SU still has any assignment. It should be true to 2N and N+M, but
>> it's not for other SG. (As the example in specification, S2 does not
>> have any CSI assigned to failed component C2).
> [Praveen]As of now we have documented in the PR doc (conformance table 
> section 3.11.1.3 Recovery) that if a component faults with 
> comp-failover recovery then AMFD switch-overs the whole SU for N-Way, 
> N-Way Active and N+M models also. This is just to highlight about 
> other red models. But this documentation is not clear for an 
> unassigned comp.
> But from the beginning, comp-failover is working this way only. 
> At-least from clean up perspective we have fixed the problem of 
> parallelism in the past in the ticket #474.
>
> One more thing I have noted, proxy-proxied implementation is based on 
> B.01.01. As per B.01.01, proxy will register himself and its proxied 
> as soon as it gets instantiated. In a configuration containing both 
> proxy and proxied comp, if the proxy does not get any CSI and it 
> faults with comp-failover recovery then in instantiation phase it may 
> again register its proxy. I think proxy in other SU should register 
> its proxied. I guess, from deployment perspective such a configuration 
> in which a user configures proxy without any CSI may not exists and 
> only possibility is an application modeling a legacy code in NoRed 
> model. However, in the later version of spec B.01.02, proxied was 
> supposed to mention the name of proxy CSI and thus proxy should 
> register only when its get proxy CSI.
>
> One more point to be noted comp-failover can also be done as a part of 
> escalation also. If a component is instantiated before the completion 
> of comp-failover recovery and if faults again then it may escalate to 
> node-failover before completion of comp-failover recovery.
>
> Since in spec there is no specific discussion for comp-failover 
> recovery for an unassigned comp, I will encourage other maintainers 
> also to provide inputs.
[Minh2] Yes this was my worry too, that I could break something that has 
been working for long time in this area. If you look at component 
failover in successful case, the su operational message is always 
reported to amfd at the time amfnd completes removing assignment of su 
that hosts failed component. But there is no mechanism for now to 
guarantee that message always is sent in such order. So I only intended 
to bring the su operational message to be sent at the spot as it is 
currently working in successful case, and try not to touch everything 
else. I think the patch also aligns with AMFD's code which is seeing the 
su of failed component as an out-of-service su.
Could you please tell me if any problem with my intention? If you agree 
then we could look into the patch if some code could be improved. Amfnd 
has a queue there that probably can buffer the su operational message 
until removing 

[devel] [PATCH 1 of 1] dtm: Use .1 file name extension for MDS log backup file [#2241]

2017-02-21 Thread Anders Widell
 src/dtm/transport/log_writer.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Use a ".1" file name extension for the MDS log backup file. This aligns with the
naming convention used for log rotation of other log files under /var/log, and
opens up the possibility for a future enhancement where we can support more than
one single backup file.

diff --git a/src/dtm/transport/log_writer.cc b/src/dtm/transport/log_writer.cc
--- a/src/dtm/transport/log_writer.cc
+++ b/src/dtm/transport/log_writer.cc
@@ -28,7 +28,7 @@
 LogWriter::LogWriter()
 : mds_log_file_{base::GetEnv("pkglogdir", PKGLOGDIR)
   + "/mds.log"},
-  old_mds_log_file_{mds_log_file_ + ".old"},
+  old_mds_log_file_{mds_log_file_ + ".1"},
   fd_{-1},
   current_file_size_{0},
   current_buffer_size_{0},

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for dtm: Use .1 file name extension for MDS log backup file [#2241]

2017-02-21 Thread Anders Widell
Summary: dtm: Use .1 file name extension for MDS log backup file [#2241]
Review request for Trac Ticket(s): 2241
Peer Reviewer(s): Mahesh
Pull request to: 
Affected branch(es): default(5.2)
Development branch: default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset 158929811821d6a87ac34cf6909f986a69e279c3
Author: Anders Widell 
Date:   Tue, 21 Feb 2017 18:15:59 +0100

dtm: Use .1 file name extension for MDS log backup file [#2241]

Use a ".1" file name extension for the MDS log backup file. This aligns 
with
the naming convention used for log rotation of other log files under
/var/log, and opens up the possibility for a future enhancement where 
we can
support more than one single backup file.


Complete diffstat:
--
 src/dtm/transport/log_writer.cc |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Testing Commands:
-

Exercise MDS so that it generates so many MDS log messages that the MDS log
file gets rotated.


Testing, Expected Results:
--

MDS log file backup should have the extension ".1"


Conditions of Submission:
-

Ack from reviwer(s)


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 3] log: add alternative destinations of log records [#2258]

2017-02-21 Thread Lennart Lund
Hi Vu

Ack with commants
See comments below [Lennart]

Thanks
Lennart

> -Original Message-
> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> Sent: den 21 februari 2017 10:34
> To: Lennart Lund ; mahesh.va...@oracle.com;
> Canh Van Truong 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 3] log: add alternative destinations of log records
> [#2258]
> 
>  src/log/Makefile.am  |8 +-
>  src/log/config/logsv_classes.xml |7 +-
>  src/log/logd/lgs_config.cc   |  169 -
>  src/log/logd/lgs_config.h|3 +-
>  src/log/logd/lgs_dest.cc |  707
> +++
>  src/log/logd/lgs_dest.h  |  576 +++
>  src/log/logd/lgs_evt.cc  |   33 +
>  src/log/logd/lgs_imm.cc  |  202 +-
>  src/log/logd/lgs_main.cc |8 +
>  src/log/logd/lgs_mbcsv.cc|  103 +-
>  src/log/logd/lgs_mbcsv.h |6 +-
>  src/log/logd/lgs_mbcsv_v5.cc |   10 +
>  src/log/logd/lgs_mbcsv_v7.cc |  177 +
>  src/log/logd/lgs_mbcsv_v7.h  |   67 +++
>  src/log/logd/lgs_stream.cc   |   60 +++-
>  src/log/logd/lgs_stream.h|   16 +
>  src/log/logd/lgs_util.cc |   63 +++
>  src/log/logd/lgs_util.h  |   11 +-
>  18 files changed, 2154 insertions(+), 72 deletions(-)
> 
> 
> Here are major info, detailed info will be added to PR doc soon.
> 1) Add attribute "saLogRecordDestination" to log stream.
> 2) Add Local socket destintion handler
> 3) Integrate into first increment made by Lennart
> 
> diff --git a/src/log/Makefile.am b/src/log/Makefile.am
> --- a/src/log/Makefile.am
> +++ b/src/log/Makefile.am
> @@ -72,9 +72,11 @@ noinst_HEADERS += \
>   src/log/logd/lgs_mbcsv_v2.h \
>   src/log/logd/lgs_mbcsv_v3.h \
>   src/log/logd/lgs_mbcsv_v5.h \
> + src/log/logd/lgs_mbcsv_v7.h \
>   src/log/logd/lgs_recov.h \
>   src/log/logd/lgs_stream.h \
> - src/log/logd/lgs_util.h
> + src/log/logd/lgs_util.h \
> + src/log/logd/lgs_dest.h
> 
>  bin_PROGRAMS += bin/saflogger
>  osaf_execbin_PROGRAMS += bin/osaflogd
> @@ -118,10 +120,12 @@ bin_osaflogd_SOURCES = \
>   src/log/logd/lgs_mbcsv_v2.cc \
>   src/log/logd/lgs_mbcsv_v3.cc \
>   src/log/logd/lgs_mbcsv_v5.cc \
> + src/log/logd/lgs_mbcsv_v7.cc \
>   src/log/logd/lgs_mds.cc \
>   src/log/logd/lgs_recov.cc \
>   src/log/logd/lgs_stream.cc \
> - src/log/logd/lgs_util.cc
> + src/log/logd/lgs_util.cc \
> + src/log/logd/lgs_dest.cc
> 
>  bin_osaflogd_LDADD = \
>   lib/libosaf_common.la \
> diff --git a/src/log/config/logsv_classes.xml
> b/src/log/config/logsv_classes.xml
> --- a/src/log/config/logsv_classes.xml
> +++ b/src/log/config/logsv_classes.xml
> @@ -147,12 +147,13 @@
>   SA_CONFIG
>   SA_WRITABLE
>   
> - 
> + 
>   saLogRecordDestination
> - SA_UINT32_T
> + SA_STRING_T
>   SA_CONFIG
>   SA_WRITABLE
> -SA_MULTI_VALUE
> + SA_MULTI_VALUE
> + SA_NO_DUPLICATES
>   
>   
>   saLogStreamCreationTimestamp
> diff --git a/src/log/logd/lgs_config.cc b/src/log/logd/lgs_config.cc
> --- a/src/log/logd/lgs_config.cc
> +++ b/src/log/logd/lgs_config.cc
> @@ -40,6 +40,7 @@
>  #include "osaf/immutil/immutil.h"
>  #include "log/logd/lgs_file.h"
>  #include "log/logd/lgs.h"
> +#include "log/logd/lgs_util.h"
[Lennart] This include should be removed, not needed
> 
>  static SaVersionT immVersion = { 'A', 2, 11 };
> 
> @@ -709,33 +710,162 @@ static int lgs_cfg_verify_log_filesys_co
>return rc;
>  }
> 
> +//>
> +// Utility functions to validate destination configuration format
> +//<
> +// Typedef for shorten declaration
> +// This type could be used to hold set of strings with formats
> +// 1) {"name;type;value", etc.}
> +// 2) {"name", "type", "value"}
> +// 3) etc.
> +using VectorString = std::vector;
> +//>
> +// Define the "token" possition in destination configuration.
> +// kName : use this index to get "name" token
> +// kType : use this index to get "type" token
> +// kValue: use this index to get "value" token
> +// kSize : this is the maximum size of the dest configuration vector.
> +//<
> +enum { kName = 0, kType, kValue, kSize };
> +// Tokens seperator
> +const char kSemicolon[] = ";";
> +
> +
> +// The format of destination must be one of followings:
> +// 1) "name;type;"
> +// 2) "name;type;value"
> +// So, in destination configuration, must have 02 semiconlons
> +// no more, no less.
> +//
> +bool is_right_destination_fmt(const VectorString& vdest) {
> +  int nl_cnt = 0;
> +  // Check each single destination
> +  for (const auto& it : vdest) {
> +nl_cnt = 

Re: [devel] [PATCH 1 of 1] base: Add a collision-resistant hash function [#2266]

2017-02-21 Thread Anders Widell
Hi!

See replies marked AndersW>.

regards,
Anders Widell

On 02/21/2017 01:31 PM, Zoran Milinkovic wrote:
> Hi Anders,
>
> I have few comments to the patch
>
> The hash function will not work on big endian systems.
> Do we support only little endian systems or OpenSAF code should work on both 
> endian systems ?

AndersW> Why do you think it will not work on big endian systems? I 
haven't actually tested it on such a system yet (will have to dig up an 
old SPARC or PowerPC or use qemu), so you could be right. :-) Please 
explain the problem you found in the code.

>
> Base64 has only encoding function.
> If something is going to be pushed to base directory, then I think is better 
> to have full implementation, so that it can be used by other OpenSAF code, 
> and not only for LOG.

AndersW> The Base64 encoding function is a private API which is not 
exposed outside the compilation unit. If we need a base64 encoding 
function we can of course make it generic and expose an API for it.

>
> If the hash is for general purposes, then it should not be encoded by base64 
> at the end. Array of bytes should be returned from the hash. If it's needed, 
> base64 can be done later on the returned array of bytes.


AndersW> Yes I agree that it could be useful to get the raw hash value. 
LOG will not need it, but it could be used in other contexts.

>
> BR,
> Zoran
>
> -Original Message-
> From: Anders Widell [mailto:anders.wid...@ericsson.com]
> Sent: den 21 februari 2017 11:45
> To: ramesh.bet...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [devel] [PATCH 1 of 1] base: Add a collision-resistant hash function 
> [#2266]
>
>   src/base/Makefile.am|   16 +-
>   src/base/hash.cc|  239 
> 
>   src/base/hash.h |   32 +
>   src/base/tests/hash_test.cc |  109 
>   4 files changed, 390 insertions(+), 6 deletions(-)
>
>
> Add a function that returns a 32 character string which is generated by
> computing the SHA-512/192 hash of the message parameter, and encoding the 
> result
> using Base64 with a URL and filename safe alphabet. For more information about
> these algorithms, refer to the corresponding standards. SHA-512/192 is defined
> in FIPS 180-4. Base64 is defined in RFC 4648.
>
> diff --git a/src/base/Makefile.am b/src/base/Makefile.am
> --- a/src/base/Makefile.am
> +++ b/src/base/Makefile.am
> @@ -35,6 +35,7 @@ lib_libopensaf_core_la_SOURCES += \
>   src/base/daemon.c \
>   src/base/file_notify.cc \
>   src/base/getenv.cc \
> + src/base/hash.cc \
>   src/base/hj_dec.c \
>   src/base/hj_edp.c \
>   src/base/hj_edu.c \
> @@ -79,6 +80,7 @@ noinst_HEADERS += \
>   src/base/daemon.h \
>   src/base/file_notify.h \
>   src/base/getenv.h \
> + src/base/hash.h \
>   src/base/log_message.h \
>   src/base/logtrace.h \
>   src/base/macros.h \
> @@ -176,16 +178,18 @@ bin_libbase_test_CPPFLAGS = \
>   
>   bin_libbase_test_LDFLAGS = \
>   $(AM_LDFLAGS) \
> - src/base/lib_libopensaf_core_la-unix_socket.lo \
> - src/base/lib_libopensaf_core_la-unix_server_socket.lo \
> + src/base/lib_libopensaf_core_la-file_notify.lo \
>   src/base/lib_libopensaf_core_la-getenv.lo \
> + src/base/lib_libopensaf_core_la-hash.lo \
>   src/base/lib_libopensaf_core_la-log_message.lo \
>   src/base/lib_libopensaf_core_la-process.lo \
> - src/base/lib_libopensaf_core_la-file_notify.lo
> + src/base/lib_libopensaf_core_la-unix_server_socket.lo \
> + src/base/lib_libopensaf_core_la-unix_socket.lo
>   
>   bin_libbase_test_SOURCES = \
> - src/base/tests/unix_socket_test.cc \
> + src/base/tests/file_notify_test.cc \
>   src/base/tests/getenv_test.cc \
> + src/base/tests/hash_test.cc \
>   src/base/tests/log_message_test.cc \
>   src/base/tests/mock_logtrace.cc \
>   src/base/tests/mock_osaf_abort.cc \
> @@ -193,8 +197,8 @@ bin_libbase_test_SOURCES = \
>   src/base/tests/time_add_test.cc \
>   src/base/tests/time_compare_test.cc \
>   src/base/tests/time_convert_test.cc \
> - src/base/tests/file_notify_test.cc \
> - src/base/tests/time_subtract_test.cc
> + src/base/tests/time_subtract_test.cc \
> + src/base/tests/unix_socket_test.cc
>   
>   bin_libbase_test_LDADD = \
>   $(GTEST_DIR)/lib/libgtest.la \
> diff --git a/src/base/hash.cc b/src/base/hash.cc
> new file mode 100644
> --- /dev/null
> +++ b/src/base/hash.cc
> @@ -0,0 +1,239 @@
> +/*  -*- OpenSAF  -*-
> + *
> + * Copyright Ericsson AB 2017 - All Rights Reserved.
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
> + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
> + * under the GNU Lesser General Public License Version 2.1, February 1999.
> + * The complete license can be accessed from 

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread Lennart Lund
Hi Vu

See my comment below [Lennart]
I will continue reviewing part 1

Thanks
Lennart

> -Original Message-
> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> Sent: den 21 februari 2017 10:34
> To: Lennart Lund ; mahesh.va...@oracle.com;
> Canh Van Truong 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 0 of 3] Review Request for log: add alternative destinations
> of log records [#2258] V4
> 
> Summary: log: add alternative destinations of log records [#2258]
> Review request for Trac Ticket(s): #2258
> Peer Reviewer(s): Lennart, Canh, Mahesh
> Pull request to: <>
> Affected branch(es): Default
> Development branch: Default
> 
> 
> Impacted area   Impact y/n
> 
>  Docsn
>  Build systemn
>  RPM/packaging   n
>  Configuration files n
>  Startup scripts n
>  SAF servicesn
>  OpenSAF servicesy
>  Core libraries  n
>  Samples n
>  Tests   y
>  Other   n
> 
> 
> Comments (indicate scope for each "y" above):
> -
>  To run the test, this patch has dependent on following patches:
>  1) #2293 (sent by Anders Widel, but not yet pushed)
>  2) #2258 (v2, sent by Lennart, but not yet pushed yet)
[Lennart] You are also dependent on #2266 base: Add a hash function. This is 
important since it defines a known hash algorithm that shal be used with MSGID 
> 32 characters
> 
> changeset d74aaf3025c99cade3165a15831124548f4d85bd
> Author:   Vu Minh Nguyen 
> Date: Wed, 15 Feb 2017 14:36:00 +0700
> 
>   log: add alternative destinations of log records [#2258]
> 
>   Here are major info, detailed info will be added to PR doc soon. 1)
> Add
>   attribute "saLogRecordDestination" to log stream. 2) Add Local socket
>   destintion handler 3) Integrate into first increment made by Lennart
> 
> changeset 4bae27a478c235df3058f43c92d3a5483233b01d
> Author:   Vu Minh Nguyen 
> Date: Wed, 15 Feb 2017 15:07:09 +0700
> 
>   log: add UML test case to verify alternative destination [#2258]
> 
>   Major changes: 1) Modify Lennart's test cases because enhancing
> destination
>   configuration validation rules. 2) Add test suite #17 to verify
> alternative
>   destination
> 
> changeset bc375725fed22bb4f8cb3ae3df5f96fb9d281efb
> Author:   Vu Minh Nguyen 
> Date: Thu, 16 Feb 2017 17:22:13 +0700
> 
>   log: add unit tests to verify interfaces provided by destination
> handler
>   [#2258]
> 
>   Unit tests to verify major interfaces: 1) CfgDestination() 2)
>   WriteToDestination()
> 
> 
> Added Files:
> 
>  src/log/apitest/tet_cfg_destination.c
>  src/log/logd/lgs_dest.cc
>  src/log/logd/lgs_dest.h
>  src/log/logd/lgs_mbcsv_v7.cc
>  src/log/logd/lgs_mbcsv_v7.h
>  src/log/tests/lgs_dest_test.cc
>  src/log/tests/Makefile
> 
> 
> Complete diffstat:
> --
>  src/log/Makefile  |4 +
>  src/log/Makefile.am   |   31 +-
>  src/log/apitest/tet_LogOiOps.c|8 +-
>  src/log/apitest/tet_cfg_destination.c |  483
> ++
> ++
>  src/log/config/logsv_classes.xml  |7 +-
>  src/log/logd/lgs_config.cc|  169 +-
> --
>  src/log/logd/lgs_config.h |3 +-
>  src/log/logd/lgs_dest.cc  |  707
> ++
> ++
> +
>  src/log/logd/lgs_dest.h   |  576
> ++
> 
>  src/log/logd/lgs_evt.cc   |   33 ++
>  src/log/logd/lgs_imm.cc   |  202
> +--
>  src/log/logd/lgs_main.cc  |8 +
>  src/log/logd/lgs_mbcsv.cc |  103 ++-
>  src/log/logd/lgs_mbcsv.h  |6 +-
>  src/log/logd/lgs_mbcsv_v5.cc  |   10 +
>  src/log/logd/lgs_mbcsv_v7.cc  |  177
> +++
>  src/log/logd/lgs_mbcsv_v7.h   |   67 +
>  src/log/logd/lgs_stream.cc|   60 +++-
>  src/log/logd/lgs_stream.h |   16 +++
>  src/log/logd/lgs_util.cc  |   63 
>  src/log/logd/lgs_util.h   |   11 +-
>  src/log/tests/Makefile|   20 +++
>  src/log/tests/lgs_dest_test.cc|  209
> +
>  23 files changed, 2896 insertions(+), 77 deletions(-)
> 
> 
> Testing Commands:
> -

Re: [devel] [PATCH 1 of 1] base: Add a collision-resistant hash function [#2266]

2017-02-21 Thread Zoran Milinkovic
Hi Anders,

I have few comments to the patch

The hash function will not work on big endian systems.
Do we support only little endian systems or OpenSAF code should work on both 
endian systems ?

Base64 has only encoding function.
If something is going to be pushed to base directory, then I think is better to 
have full implementation, so that it can be used by other OpenSAF code, and not 
only for LOG.

If the hash is for general purposes, then it should not be encoded by base64 at 
the end. Array of bytes should be returned from the hash. If it's needed, 
base64 can be done later on the returned array of bytes.

BR,
Zoran

-Original Message-
From: Anders Widell [mailto:anders.wid...@ericsson.com] 
Sent: den 21 februari 2017 11:45
To: ramesh.bet...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1 of 1] base: Add a collision-resistant hash function 
[#2266]

 src/base/Makefile.am|   16 +-
 src/base/hash.cc|  239 
 src/base/hash.h |   32 +
 src/base/tests/hash_test.cc |  109 
 4 files changed, 390 insertions(+), 6 deletions(-)


Add a function that returns a 32 character string which is generated by
computing the SHA-512/192 hash of the message parameter, and encoding the result
using Base64 with a URL and filename safe alphabet. For more information about
these algorithms, refer to the corresponding standards. SHA-512/192 is defined
in FIPS 180-4. Base64 is defined in RFC 4648.

diff --git a/src/base/Makefile.am b/src/base/Makefile.am
--- a/src/base/Makefile.am
+++ b/src/base/Makefile.am
@@ -35,6 +35,7 @@ lib_libopensaf_core_la_SOURCES += \
src/base/daemon.c \
src/base/file_notify.cc \
src/base/getenv.cc \
+   src/base/hash.cc \
src/base/hj_dec.c \
src/base/hj_edp.c \
src/base/hj_edu.c \
@@ -79,6 +80,7 @@ noinst_HEADERS += \
src/base/daemon.h \
src/base/file_notify.h \
src/base/getenv.h \
+   src/base/hash.h \
src/base/log_message.h \
src/base/logtrace.h \
src/base/macros.h \
@@ -176,16 +178,18 @@ bin_libbase_test_CPPFLAGS = \
 
 bin_libbase_test_LDFLAGS = \
$(AM_LDFLAGS) \
-   src/base/lib_libopensaf_core_la-unix_socket.lo \
-   src/base/lib_libopensaf_core_la-unix_server_socket.lo \
+   src/base/lib_libopensaf_core_la-file_notify.lo \
src/base/lib_libopensaf_core_la-getenv.lo \
+   src/base/lib_libopensaf_core_la-hash.lo \
src/base/lib_libopensaf_core_la-log_message.lo \
src/base/lib_libopensaf_core_la-process.lo \
-   src/base/lib_libopensaf_core_la-file_notify.lo
+   src/base/lib_libopensaf_core_la-unix_server_socket.lo \
+   src/base/lib_libopensaf_core_la-unix_socket.lo
 
 bin_libbase_test_SOURCES = \
-   src/base/tests/unix_socket_test.cc \
+   src/base/tests/file_notify_test.cc \
src/base/tests/getenv_test.cc \
+   src/base/tests/hash_test.cc \
src/base/tests/log_message_test.cc \
src/base/tests/mock_logtrace.cc \
src/base/tests/mock_osaf_abort.cc \
@@ -193,8 +197,8 @@ bin_libbase_test_SOURCES = \
src/base/tests/time_add_test.cc \
src/base/tests/time_compare_test.cc \
src/base/tests/time_convert_test.cc \
-   src/base/tests/file_notify_test.cc \
-   src/base/tests/time_subtract_test.cc
+   src/base/tests/time_subtract_test.cc \
+   src/base/tests/unix_socket_test.cc
 
 bin_libbase_test_LDADD = \
$(GTEST_DIR)/lib/libgtest.la \
diff --git a/src/base/hash.cc b/src/base/hash.cc
new file mode 100644
--- /dev/null
+++ b/src/base/hash.cc
@@ -0,0 +1,239 @@
+/*  -*- OpenSAF  -*-
+ *
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ */
+
+#include "base/hash.h"
+#include 
+#include 
+#include 
+
+namespace base {
+
+namespace {
+
+constexpr uint64_t K[] = {
+  UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd),
+  UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc),
+  UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019),
+  UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118),
+  UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe),
+  UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2),
+  UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1),
+  UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694),
+  UINT64_C(0xe49b69c19ef14ad2), 

Re: [devel] [PATCH 1 of 1] amfd: fix default value of saAmfSIPrefActiveAssignments [1190]

2017-02-21 Thread praveen malviya
Hi All,

Please provide your feedback on #1190 (V2), #2252 and #2259.


Thanks,
Praveen





On 20-Feb-17 11:58 AM, praveen malviya wrote:
> Hi Gary,
>
> I think value '0' can be used for saAmfSIPrefActiveAssignments to
> indicate AMFD to use default value as saAmfSGNumPrefAssignedSUs. In all
> other cases current behavior will continue and default value will remain
> 1. In this way there will not be any backward incompatibility issue for
> an old application.
> Since user will be setting saAmfSIPrefActiveAssignments=0 for default
> value saAmfSGNumPrefAssignedSUs , IMMND will also remember it and the
> change will survive cluster reset in a PBE enabled system.
>
> Attached is the patch (1190_v2.patch) on this idea.
>
> Thanks,
> Praveen
>
>
>
> On 01-Feb-17 2:59 PM, praveen malviya wrote:
>>
>>
>> On 01-Feb-17 2:30 PM, Gary Lee wrote:
>>> Hi Praveen
>>>
>>> What if the user reboots the cluster, after modifying
>>> saAmfSIPrefActiveAssignments?
>>>
>> I guess you are talking about the case that a user modifies to 1 in 5.2
>> release and cluster reboots. But I think cluster reboots are done mainly
>> for the cases of upgrades which are not frequently done. For upgrades,
>> CCB modification can be part of campaign itself.
>>
>> What I am getting is all the cases cannot be handled here in AMFD
>> because of schema issue. User will have to take some pain depending upon
>> the use case. Also I guess N-way active red model will not be used for
>> keeping SI assigned to one SU.
>>
>> What do you think?
>>
>> Thanks,
>> Praveen
>>> Thanks
>>>
>>> -Original Message-
>>> From: praveen malviya 
>>> Organization: Oracle Corporation
>>> Date: Wednesday, 1 February 2017 at 5:31 pm
>>> To: gary , ,
>>> , 
>>> Cc: 
>>> Subject: Re: [PATCH 1 of 1] amfd: fix default value of
>>> saAmfSIPrefActiveAssignments [1190]
>>>
>>>
>>>
>>> On 01-Feb-17 11:20 AM, Gary Lee wrote:
>>> > Hi Praveen
>>> >
>>> > Ack – I think we should make it clear in the PR doc that the
>>> default will be 1 if they leave out ‘saAmfSIPrefActiveAssignments‘
>>> when creating the SI. If they want it to default to
>>> saAmfSGNumPrefAssignedSUs, they must create the SI with
>>> ‘saAmfSIPrefActiveAssignments’ set to blank.
>>> >
>>> This ticket is to honour saAmfSGNumPrefAssignedSUs from now
>>> on-wards in
>>> both the cases when it was not configured while creating the SI
>>> or when
>>> it is set to blank.
>>>
>>> I think, I will have to document in this way:
>>> 1) If saAmfSIPrefActiveAssignments is not configured while
>>> creating an
>>> SI, then AMF will use saAmfSGNumPrefAssignedSUs as default value.
>>> 2) If SI is already configured then saAmfSIPrefActiveAssignments
>>> can be
>>> adjusted to default value saAmfSGNumPrefAssignedSUs by setting
>>> saAmfSIPrefActiveAssignments to blanck via CCB operation.
>>>
>>> In 1)  immlist will still show value as 1, but AMF will adhere to
>>> saAmfSGNumPrefAssignedSUs. This cannot be corrected because imm.xml
>>> contains a default based on old schema definition:
>>>   
>>>  saAmfSIPrefActiveAssignments
>>>  SA_UINT32_T
>>>  SA_CONFIG
>>>  SA_WRITABLE
>>>  1
>>>  
>>> So when AMFD reads it from IMM, it does not know whether user has
>>> configured it to 1 or it is IMM that is giving 1 as default value to
>>> AMFD. With this enhancement, on seeing 1 AMFD will consider that
>>> use has
>>> not configured it and will adhere to default value
>>> saAmfSGNumPrefAssignedSUs.
>>> A old user can still make everything consistent for its old
>>> application
>>> my the provision of making saAmfSIPrefActiveAssignments to 1
>>> using CCB
>>> Modify operation. If user performs this CCB change then in function
>>> pref_active_assignments() flag
>>> saAmfSIPrefActiveAssignments_configured
>>> will take care of user's choice.
>>>
>>>
>>> Thanks,
>>> Praveen
>>> > Thanks
>>> > Gary
>>> >
>>> > On 1/2/17, 4:08 pm, "praveen malviya"
>>>  wrote:
>>> >
>>> >
>>> > On 01-Feb-17 9:45 AM, Gary Lee wrote:
>>> > > Hi Praveen
>>> > >
>>> > > saAmfSIPrefActiveAssignments defaults to 1 in the schema.
>>> I guess  saAmfSGNumPrefAssignedSUs only becomes default, if the user
>>> deliberately sets saAmfSIPrefActiveAssignments to “”?
>>> > >
>>> >
>>> > In section 3.6.5, default value of
>>> saAmfSIPrefActiveAssignments is
>>> > mentioned as saAmfSGNumPrefAssignedSUs and same is
>>> mentioned in
>>> > SAI-IM-XMI-A.04.02.errata.xml.
>>> >
>>> > Yes, a user can make 

Re: [devel] [PATCH 2 of 3] log: Add minor version checking in log server [#2146]

2017-02-21 Thread Lennart Lund
Hi Canh

Ack with comment see [Lennart]
I will not review part 1 (implementation of filter callback) again since I 
acked that part in the previous review

Thanks
Lennart

> -Original Message-
> From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au]
> Sent: den 16 februari 2017 07:49
> To: Lennart Lund ; Vu Minh Nguyen
> ; mahesh.va...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 2 of 3] log: Add minor version checking in log server [#2146]
> 
>  src/log/Makefile.am  |3 +
>  src/log/common/lgsv_defs.h   |4 +
>  src/log/common/lgsv_msg.h|2 +-
>  src/log/logd/lgs_cb.h|2 +
>  src/log/logd/lgs_evt.cc  |   93 -
>  src/log/logd/lgs_mbcsv.cc|  181 ++
> 
>  src/log/logd/lgs_mbcsv.h |9 +-
>  src/log/logd/lgs_mbcsv_v6.cc |  169
> 
>  src/log/logd/lgs_mbcsv_v6.h  |   56 +
>  src/log/logd/lgs_util.cc |   27 -
>  10 files changed, 462 insertions(+), 84 deletions(-)
> 
> 
> Checking minor version and return version error if major/minor version is
> higher than
> supported major/minor
> 
> Add client_version to log_client_t and checkpoint struct  in lgs
> 
> Increase checkpoint version and checkpoint client_ver to stand by
> 
> Only send filter callback to client that initialized with minor version > 3
> 
> diff --git a/src/log/Makefile.am b/src/log/Makefile.am
> --- a/src/log/Makefile.am
> +++ b/src/log/Makefile.am
> @@ -1,6 +1,7 @@
>  #  -*- OpenSAF  -*-
>  #
>  # (C) Copyright 2016 The OpenSAF Foundation
> +# Copyright Ericsson AB 2016, 2017 - All Rights Reserved.
>  #
>  # This program is distributed in the hope that it will be useful, but
>  # WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> @@ -71,6 +72,7 @@ noinst_HEADERS += \
>   src/log/logd/lgs_mbcsv_v2.h \
>   src/log/logd/lgs_mbcsv_v3.h \
>   src/log/logd/lgs_mbcsv_v5.h \
> + src/log/logd/lgs_mbcsv_v6.h \
>   src/log/logd/lgs_recov.h \
>   src/log/logd/lgs_stream.h \
>   src/log/logd/lgs_util.h
> @@ -117,6 +119,7 @@ bin_osaflogd_SOURCES = \
>   src/log/logd/lgs_mbcsv_v2.cc \
>   src/log/logd/lgs_mbcsv_v3.cc \
>   src/log/logd/lgs_mbcsv_v5.cc \
> + src/log/logd/lgs_mbcsv_v6.cc \
>   src/log/logd/lgs_mds.cc \
>   src/log/logd/lgs_recov.cc \
>   src/log/logd/lgs_stream.cc \
> diff --git a/src/log/common/lgsv_defs.h b/src/log/common/lgsv_defs.h
> --- a/src/log/common/lgsv_defs.h
> +++ b/src/log/common/lgsv_defs.h
> @@ -27,6 +27,10 @@
>  #define LOG_MAJOR_VERSION_0 2
>  #define LOG_MINOR_VERSION_0 1
> 
> +#define LOG_RELEASE_CODE_1 'A'
> +#define LOG_MAJOR_VERSION_1 2
> +#define LOG_MINOR_VERSION_1 3
> +
>  // Waiting time in library for sync send, unit 10ms
>  #define LGS_WAIT_TIME 1000
> 
> diff --git a/src/log/common/lgsv_msg.h b/src/log/common/lgsv_msg.h
> --- a/src/log/common/lgsv_msg.h
> +++ b/src/log/common/lgsv_msg.h
> @@ -130,7 +130,7 @@ typedef struct logsv_loga_clm_status_par
>  } logsv_lga_clm_status_cbk_t;
> 
>  typedef struct {
> -SaLogSeverityFlagsT log_severity;
> +  SaLogSeverityFlagsT log_severity;
>  } lgsv_severity_filter_callback_t;
> 
>  /* wrapper structure for all the callbacks */
> diff --git a/src/log/logd/lgs_cb.h b/src/log/logd/lgs_cb.h
> --- a/src/log/logd/lgs_cb.h
> +++ b/src/log/logd/lgs_cb.h
> @@ -1,6 +1,7 @@
>  /*  -*- OpenSAF  -*-
>   *
>   * (C) Copyright 2008 The OpenSAF Foundation
> + * Copyright Ericsson AB 2008, 2017 - All Rights Reserved.
>   *
>   * This program is distributed in the hope that it will be useful, but
>   * WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> @@ -59,6 +60,7 @@ typedef struct {
>NCS_PATRICIA_NODE pat_node;
>uint32_t client_id;
>uint32_t client_id_net;
> +  SaVersionT client_ver;
>MDS_DEST mds_dest;
>lgs_stream_list_t *stream_list_root;
>  } log_client_t;
> diff --git a/src/log/logd/lgs_evt.cc b/src/log/logd/lgs_evt.cc
> --- a/src/log/logd/lgs_evt.cc
> +++ b/src/log/logd/lgs_evt.cc
> @@ -1,6 +1,7 @@
>  /*  -*- OpenSAF  -*-
>   *
>   * (C) Copyright 2008 The OpenSAF Foundation
> + * Copyright Ericsson AB 2008, 2017 - All Rights Reserved.
>   *
>   * This program is distributed in the hope that it will be useful, but
>   * WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> @@ -23,16 +24,12 @@
> 
>  #include "lgs_mbcsv_v1.h"
>  #include "lgs_mbcsv_v2.h"
> +#include "lgs_mbcsv_v6.h"
>  #include "lgs_recov.h"
>  #include "lgs_imm_gcfg.h"
>  #include "base/osaf_extended_name.h"
>  #include "lgs_clm.h"
> 
> -/* Macro to validate the version */
> -#define m_LOG_VER_IS_VALID(ver) \
> -  ( (ver->releaseCode == LOG_RELEASE_CODE) &&   \
> -(ver->majorVersion == LOG_MAJOR_VERSION || ver->minorVersion ==
> 

[devel] [PATCH 0 of 1] Review Request for amfd: support si-swap admin op for NplusM model [#2259]

2017-02-21 Thread praveen . malviya
Summary:amfd: support si-swap admin op for NplusM model [#2259]
Review request for Trac Ticket(s): #2259 
Peer Reviewer(s): AMF devs 
Pull request to: <>
Affected branch(es): ALL 
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-

changeset 5fa5af5649bc85f45c9ba4e21b105002085a12e4
Author: Praveen Malviya 
Date:   Tue, 21 Feb 2017 16:21:19 +0530

amfd: support si-swap admin op for NplusM model [#2259]

This version works for the case when all SIs which are active in the
designated SU (where SI to be swaped is active) have their standbys on 
same
SU including the designated SI.

TODO: consider the case when active SIs of designated SU have their 
standbys
on different SUs.


Complete diffstat:
--
 src/amf/amfd/sg.cc |   12 ++-
 src/amf/amfd/sg.h  |4 ++
 src/amf/amfd/sg_npm_fsm.cc |  145 
++
 src/amf/amfd/su.cc |   11 ++
 src/amf/amfd/su.h  |2 +
 5 files changed, 144 insertions(+), 30 deletions(-)


Testing Commands:
-
Tested in configuration attached in the ticket (test_conf.xml):
1)si-swap of without fault.

faults when si-swap is going on during HA state transition:
2)compfailover related su (timeout in callback):
-quiesced: PASS 
-active: PAssed.
-standby: sg unstable (This needs tobe fixed).
3)compfailover non-related su (comp was killed):
-active faults: PASSED
-standby faults: PASSED
-quieced faults : PASSED

4)sufailover in non related SU (kill comp):
-quiesced: PASS
-active:  PASS
-standby: PASS
5)sufailover in related su (kill comp):
-quiesced: PASS
-active:  PASSED. 
-standby: PASSED

Testing, Expected Results:
--
In case 2) minor fix is needed when standby comp faults with
comp-failover recovery in realign state. This could be a problem of FSM.
Need to check if some ticket already exists

All other cases passed.

Conditions of Submission:
-
Ack from reviewers.

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the 

[devel] [PATCH 1 of 1] amfd: support si-swap admin op for NplusM model [#2259]

2017-02-21 Thread praveen . malviya
 src/amf/amfd/sg.cc |   12 +++-
 src/amf/amfd/sg.h  |4 +
 src/amf/amfd/sg_npm_fsm.cc |  145 -
 src/amf/amfd/su.cc |   11 +++
 src/amf/amfd/su.h  |2 +
 5 files changed, 144 insertions(+), 30 deletions(-)


This version works for the case when all SIs which are active in the
designated SU (where SI to be swaped is active) have their standbys on same SU
including the designated SI.

TODO: consider the case when active SIs of designated SU have their standbys on 
different SUs.

diff --git a/src/amf/amfd/sg.cc b/src/amf/amfd/sg.cc
--- a/src/amf/amfd/sg.cc
+++ b/src/amf/amfd/sg.cc
@@ -2,6 +2,7 @@
  *
  * (C) Copyright 2008 The OpenSAF Foundation
  * (C) Copyright 2017 Ericsson AB - All Rights Reserved.
+ * Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -2274,4 +2275,13 @@ bool AVD_SG::any_assignment_assigned() {
return pending;
 }
 
-
+/*
+ * @brief  Checks if si_equal_distribution is configured for the SG.
+ * @return true/false. 
+*/
+bool AVD_SG::is_equal() const {
+  return(((sg_redundancy_model == SA_AMF_NPM_REDUNDANCY_MODEL) ||
+ (sg_redundancy_model == SA_AMF_N_WAY_REDUNDANCY_MODEL) ||
+ (sg_redundancy_model == SA_AMF_N_WAY_ACTIVE_REDUNDANCY_MODEL)) &&
+ (equal_ranked_su == true) && (saAmfSGAutoAdjust == SA_TRUE));
+}
diff --git a/src/amf/amfd/sg.h b/src/amf/amfd/sg.h
--- a/src/amf/amfd/sg.h
+++ b/src/amf/amfd/sg.h
@@ -2,6 +2,7 @@
  *
  * (C) Copyright 2008 The OpenSAF Foundation
  * (C) Copyright 2017 Ericsson AB - All Rights Reserved.
+ * Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -429,6 +430,8 @@ public:
//Runtime calculates value of saAmfSGNumCurrNonInstantiatedSpareSUs;
uint32_t curr_non_instantiated_spare_sus() const;
bool is_middleware() const {return sg_ncs_spec ? true : false;}
+   //Checks if si_equal_distribution is configured for the SG.
+   bool is_equal() const;
 
 private:
// disallow copy and assign, TODO(hafe) add common macro for this
@@ -514,6 +517,7 @@ public:
struct avd_su_si_rel_tag *susi, AVSV_SUSI_ACT act, 
SaAmfHAStateT state);
 void node_fail_si_oper(AVD_CL_CB *cb, AVD_SU *su);
void ng_admin(AVD_SU *su, AVD_AMF_NG *ng);
+   SaAisErrorT si_swap(AVD_SI *si, SaInvocationT invocation);
 
 private:
 uint32_t su_fault_su_oper(AVD_CL_CB *cb, AVD_SU *su);
diff --git a/src/amf/amfd/sg_npm_fsm.cc b/src/amf/amfd/sg_npm_fsm.cc
--- a/src/amf/amfd/sg_npm_fsm.cc
+++ b/src/amf/amfd/sg_npm_fsm.cc
@@ -1,6 +1,7 @@
 /*  -*- OpenSAF  -*-
  *
  * (C) Copyright 2008 The OpenSAF Foundation
+ * Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -170,7 +171,10 @@ static uint32_t avd_sg_npm_su_chk_snd(AV
}
}
 
+   /*Do not send delete for a susi of s_su if other sisu of same si is in 
q_su.
+ In this case s_su can become active for this SI.*/
for (i_susi = s_su->list_of_susi; i_susi != AVD_SU_SI_REL_NULL; i_susi 
= i_susi->su_next) {
+   
if ((i_susi->si->list_of_sisu != i_susi) && 
(i_susi->si->list_of_sisu->su == q_su))
continue;
 
@@ -964,34 +968,6 @@ uint32_t SG_NPM::si_assign(AVD_CL_CB *cb
return NCSCC_RC_SUCCESS;
 }
 
-/*
- * Function: avd_sg_npm_siswitch_func
- *
- * Purpose:  This function is called when a operator does a SI switch on
- * a SI that belongs to N+M redundancy model SG. 
- * This will trigger a role change action as described in the SG FSM design.
- *
- * Input: cb - the AVD control block
- *si - The pointer to the SI that needs to be switched.
- *
- *
- * Returns: NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE.
- *
- * NOTES: This is a N+M redundancy model specific function. The initial 
- * functionality of N+M SI switch is same as 2N switch so it just calls that
- * function.
- *
- * 
- **/
-
-uint32_t avd_sg_npm_siswitch_func(AVD_CL_CB *cb, AVD_SI *si)
-{
-   TRACE_ENTER2("%u", si->sg_of_si->sg_fsm_state);
-   osafassert(0);
-// return avd_sg_2n_siswitch_func(cb, si);
-   return 0;
-}
-
  /*
  * Function: su_fault_su_oper
  *
@@ -1847,6 +1823,7 @@ uint32_t SG_NPM::susi_sucss_sg_reln(AVD_

Re: [devel] [PATCH 0 of 1] Review Request for imm: Cleanup orphaned implementers and admowners when headless [#2309]

2017-02-21 Thread Neelakanta Reddy
Hi Hung,

got it.

Reviewed the patch.
Ack.

Thanks,
Neel.

On 2017/02/21 01:01 PM, Hung Nguyen wrote:
> Hi Neel,
>
> The problem is,
> in immnd_proc_discard_other_nodes(), it fails to use 
> immnd_client_node_getnext() to get the client_node associated to the OI that 
> being discarded.
> The reason is the client_node has already been removed from 
> cb->client_info_db when the client was killed.
>
> I had imm traces attched to the ticket, you can look at the traces.
>
> Feb 15 10:57:20.674683 osafimmnd [1127:src/imm/immnd/ImmModel.cc:13713] NO 
> Implementer locally disconnected. Marking it as doomed 6 <29, 2030f> (xhunngu)
> Feb 15 10:57:20.674763 osafimmnd [1127:src/imm/immnd/ImmModel.cc:13737] << 
> discardImplementer
> Feb 15 10:57:20.674790 osafimmnd [1127:src/imm/immnd/immnd_proc.c:0242] T5 
> Discard connection id:1d0002030f succeeded
> Feb 15 10:57:20.674873 osafimmnd [1127:src/imm/immnd/immnd_proc.c:0245] << 
> immnd_proc_imma_discard_connection
> Feb 15 10:57:20.674892 osafimmnd [1127:src/imm/immnd/immnd_proc.c:0275] T5 
> Removing client id:1d0002030f sv_id:27
> Feb 15 10:57:20.674912 osafimmnd [1127:src/imm/immnd/immnd_proc.c:0292] T5 
> Removed 1 IMMA clients
> Feb 15 10:57:20.674951 osafimmnd [1127:src/imm/common/immsv_evt.c:5421] T8 
> Received: IMMND_EVT_MDS_INFO (1) from 0
>
>
>   if (immnd_proc_imma_discard_connection(cb, cl_node, 
> false)) {
>   TRACE_5("Removing client id:%llx sv_id:%u", 
> cl_node->imm_app_hdl, cl_node->sv_id);
>   immnd_client_node_del(cb, cl_node);
>   memset(cl_node, '\0', 
> sizeof(IMMND_IMM_CLIENT_NODE));
>
> BR,
> Hung Nguyen - DEK Technologies
>
> 
> From: Neelakanta reddyreddy.neelaka...@oracle.com
> Sent: Monday, February 20, 2017 6:15PM
> To: Hung Nguyen, Zoran Milinkovic
>  hung.d.ngu...@dektech.com.au,zoran.milinko...@ericsson.com
> Cc: Opensaf-devel
>  opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 0 of 1] Review Request for imm: Cleanup orphaned 
> implementers and admowners when headless [#2309]
>
>
> Hi Hung,
>
> The local implementers will be discarded in 
> "immnd_proc_discard_other_nodes"  while discarding clients.
> The implementers from the other node will be discarded in 
> immModel_isolateThisNode.
>
> If the IMMD broadcast misses also this should be covered in either of 
> the above.
>
> /Neel.
>
> On 2017/02/17 01:35 PM, Hung Nguyen wrote:
>> Summary: imm: Cleanup orphaned implementers and admowners when 
>> headless [#2309]
>> Review request for Trac Ticket(s): 2309
>> Peer Reviewer(s): Zoran, Neel
>> Pull request to:
>> Affected branch(es): 5.0, 5.1, 5.2
>> Development branch: 5.2
>>
>> 
>> Impacted area   Impact y/n
>> 
>>   Docsn
>>   Build systemn
>>   RPM/packaging   n
>>   Configuration files n
>>   Startup scripts n
>>   SAF servicesy
>>   OpenSAF servicesn
>>   Core libraries  n
>>   Samples n
>>   Tests   n
>>   Other   n
>>
>>
>> Comments (indicate scope for each "y" above):
>> -
>>
>>
>> changeset d79e3d47468b927dd5b06f2efa869a63380fe3c4
>> Author:Hung Nguyen 
>> Date:Fri, 17 Feb 2017 15:03:49 +0700
>>
>> imm: Cleanup orphaned implementers and admowners when headless 
>> [#2309]
>>
>> If a client is down right before headless, chances are the 
>> implementers and
>> admowners will be orphaned because IMMD fails to broadcast global 
>> discard
>> messages. This patch cleans those orphaned implementers and 
>> admowners up.
>>
>>
>> Complete diffstat:
>> --
>>   src/imm/immnd/ImmModel.cc |  31 ++-
>>   1 files changed, 18 insertions(+), 13 deletions(-)
>>
>>
>> Testing Commands:
>> -
>> Kill client right before headless.
>>
>>
>> Testing, Expected Results:
>> --
>> No orphaned implementers or admowners.
>>
>>
>> Conditions of Submission:
>> -
>> Ack from reviewers.
>>
>>
>> Arch  Built StartedLinux distro
>> ---
>> mipsn  n
>> mips64  n  n
>> x86 n  n
>> x86_64  n  n
>> powerpc n  n
>> powerpc64   n  n
>>
>>
>> Reviewer Checklist:
>> ---
>> [Submitters: make sure that your review doesn't trigger any checkmarks!]
>>
>>
>> Your checkin has not passed review because (see checked entries):
>>
>> ___ Your RR template is generally incomplete; it has too many blank 
>> entries
>>  that need proper data filled in.
>>
>> ___ You have failed to nominate the proper persons for review and push.
>>
>> ___ 

Re: [devel] [PATCH 1 of 1] lgs: Add new multivalue attributes to configuration handler [#2258]

2017-02-21 Thread Vu Minh Nguyen
Hi Lennart,

Ack with few comments. [Vu]

Regards, Vu

> -Original Message-
> From: Lennart Lund [mailto:lennart.l...@ericsson.com]
> Sent: Monday, February 20, 2017 10:18 PM
> To: mahesh.va...@oracle.com; vu.m.ngu...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] lgs: Add new multivalue attributes to
configuration
> handler [#2258]
> 
>  src/log/Makefile.am  |5 +-
>  src/log/apitest/imm_tstutil.c|  126 +++
>  src/log/apitest/imm_tstutil.h|   61 +++
>  src/log/apitest/logtest.h|2 +-
>  src/log/apitest/saflogtest.c |   29 -
>  src/log/apitest/tet_LogOiOps.c   |  408 
>  src/log/apitest/tet_Log_recov.c  |7 +-
>  src/log/apitest/tet_log_runtime_cfgobj.c |9 +-
>  src/log/config/logsv_classes.xml |   27 +
>  src/log/logd/lgs.h   |2 +-
>  src/log/logd/lgs_config.cc   |  507
--
>  src/log/logd/lgs_config.h|  252 ++-
>  src/log/logd/lgs_evt.cc  |2 +-
>  src/log/logd/lgs_file.cc |2 +-
>  src/log/logd/lgs_imm.cc  |   69 +++-
>  src/log/logd/lgs_mbcsv.cc|2 +-
>  src/log/logd/lgs_mbcsv_v5.cc |2 +
>  17 files changed, 1344 insertions(+), 168 deletions(-)
> 
> 
> Add new attributes to the configuration object and configuration info
object
> The new attributes are multi value so multi value support is also added
> 
> NOTE: UML test fixed and new test cases added
> 
> diff --git a/src/log/Makefile.am b/src/log/Makefile.am
> --- a/src/log/Makefile.am
> +++ b/src/log/Makefile.am
> @@ -1,6 +1,7 @@
>  #  -*- OpenSAF  -*-
>  #
>  # (C) Copyright 2016 The OpenSAF Foundation
> +# Copyright Ericsson AB [2016, 2017] - All Rights Reserved
>  #
>  # This program is distributed in the hope that it will be useful, but
>  # WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> @@ -147,7 +148,8 @@ bin_PROGRAMS += bin/logtest bin/saflogte
> 
>  noinst_HEADERS += \
>   src/log/apitest/logtest.h \
> - src/log/apitest/logutil.h
> + src/log/apitest/logutil.h \
> + src/log/apitest/imm_tstutil.h
> 
>  bin_logtest_CFLAGS = $(AM_CFLAGS) -Wformat=1
> 
> @@ -158,6 +160,7 @@ bin_logtest_CPPFLAGS = \
>  bin_logtest_SOURCES = \
>   src/log/apitest/logtest.c \
>   src/log/apitest/logutil.c \
> + src/log/apitest/imm_tstutil.c \
>   src/log/apitest/tet_saLogInitialize.c \
>   src/log/apitest/tet_saLogSelectionObjectGet.c \
>   src/log/apitest/tet_saLogDispatch.c \
> diff --git a/src/log/apitest/imm_tstutil.c b/src/log/apitest/imm_tstutil.c
> new file mode 100644
> --- /dev/null
> +++ b/src/log/apitest/imm_tstutil.c
> @@ -0,0 +1,126 @@
> +/*  -*- OpenSAF  -*-
> + *
> + * Copyright Ericsson AB [2017] - All Rights Reserved
> + *
> + * This program is distributed in the hope that it will be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> + * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are
> licensed
> + * under the GNU Lesser General Public License Version 2.1, February
1999.
> + * The complete license can be accessed from the following location:
> + * http://opensource.org/licenses/lgpl-license.php
> + * See the Copying file included with the OpenSAF distribution for full
> + * licensing terms.
> + *
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "imm/saf/saImm.h"
> +#include "imm/saf/saImmOm.h"
> +#include "osaf/immutil/immutil.h"
> +#include "base/saf_error.h"
> +#include "base/osaf_extended_name.h"
> +
> +static SaVersionT immVersion = {'A', 2, 11};
> +
> +bool get_multivalue_type_string_from_imm(SaImmHandleT *omHandle,
> + SaConstStringT objectName,
> + char *attribute_name,
> + char ***multivalue_array) {
> + SaAisErrorT om_rc = SA_AIS_OK;
> + SaImmAccessorHandleT accessorHandle;
> + SaImmAttrValuesT_2 *attribute;
> + SaImmAttrValuesT_2 **attributes;
> + bool func_rc = true;
> +
> + //printf(">> get_multivalue_string_type_from_imm()\n");
> +
> + do {
> + /* Make sure this is a NULL pointer if no values are found
*/
> + *multivalue_array = NULL;
> +
> + om_rc = immutil_saImmOmInitialize(omHandle, NULL,
> );
> + if (om_rc != SA_AIS_OK) {
> + printf("immutil_saImmOmInitialize Fail '%s'\n",
> + saf_error(om_rc));
> + func_rc = false;
> + break;
> + }
> +
> + //printf("\timmutil_saImmOmInitialize() Done\n");
> +
> + om_rc = immutil_saImmOmAccessorInitialize(*omHandle,
> + );
> + if (om_rc != SA_AIS_OK) 

[devel] [PATCH 1 of 1] base: Add a collision-resistant hash function [#2266]

2017-02-21 Thread Anders Widell
 src/base/Makefile.am|   16 +-
 src/base/hash.cc|  239 
 src/base/hash.h |   32 +
 src/base/tests/hash_test.cc |  109 
 4 files changed, 390 insertions(+), 6 deletions(-)


Add a function that returns a 32 character string which is generated by
computing the SHA-512/192 hash of the message parameter, and encoding the result
using Base64 with a URL and filename safe alphabet. For more information about
these algorithms, refer to the corresponding standards. SHA-512/192 is defined
in FIPS 180-4. Base64 is defined in RFC 4648.

diff --git a/src/base/Makefile.am b/src/base/Makefile.am
--- a/src/base/Makefile.am
+++ b/src/base/Makefile.am
@@ -35,6 +35,7 @@ lib_libopensaf_core_la_SOURCES += \
src/base/daemon.c \
src/base/file_notify.cc \
src/base/getenv.cc \
+   src/base/hash.cc \
src/base/hj_dec.c \
src/base/hj_edp.c \
src/base/hj_edu.c \
@@ -79,6 +80,7 @@ noinst_HEADERS += \
src/base/daemon.h \
src/base/file_notify.h \
src/base/getenv.h \
+   src/base/hash.h \
src/base/log_message.h \
src/base/logtrace.h \
src/base/macros.h \
@@ -176,16 +178,18 @@ bin_libbase_test_CPPFLAGS = \
 
 bin_libbase_test_LDFLAGS = \
$(AM_LDFLAGS) \
-   src/base/lib_libopensaf_core_la-unix_socket.lo \
-   src/base/lib_libopensaf_core_la-unix_server_socket.lo \
+   src/base/lib_libopensaf_core_la-file_notify.lo \
src/base/lib_libopensaf_core_la-getenv.lo \
+   src/base/lib_libopensaf_core_la-hash.lo \
src/base/lib_libopensaf_core_la-log_message.lo \
src/base/lib_libopensaf_core_la-process.lo \
-   src/base/lib_libopensaf_core_la-file_notify.lo
+   src/base/lib_libopensaf_core_la-unix_server_socket.lo \
+   src/base/lib_libopensaf_core_la-unix_socket.lo
 
 bin_libbase_test_SOURCES = \
-   src/base/tests/unix_socket_test.cc \
+   src/base/tests/file_notify_test.cc \
src/base/tests/getenv_test.cc \
+   src/base/tests/hash_test.cc \
src/base/tests/log_message_test.cc \
src/base/tests/mock_logtrace.cc \
src/base/tests/mock_osaf_abort.cc \
@@ -193,8 +197,8 @@ bin_libbase_test_SOURCES = \
src/base/tests/time_add_test.cc \
src/base/tests/time_compare_test.cc \
src/base/tests/time_convert_test.cc \
-   src/base/tests/file_notify_test.cc \
-   src/base/tests/time_subtract_test.cc
+   src/base/tests/time_subtract_test.cc \
+   src/base/tests/unix_socket_test.cc
 
 bin_libbase_test_LDADD = \
$(GTEST_DIR)/lib/libgtest.la \
diff --git a/src/base/hash.cc b/src/base/hash.cc
new file mode 100644
--- /dev/null
+++ b/src/base/hash.cc
@@ -0,0 +1,239 @@
+/*  -*- OpenSAF  -*-
+ *
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ */
+
+#include "base/hash.h"
+#include 
+#include 
+#include 
+
+namespace base {
+
+namespace {
+
+constexpr uint64_t K[] = {
+  UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd),
+  UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc),
+  UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019),
+  UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118),
+  UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe),
+  UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2),
+  UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1),
+  UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694),
+  UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3),
+  UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65),
+  UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483),
+  UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5),
+  UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210),
+  UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4),
+  UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725),
+  UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70),
+  UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926),
+  UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df),
+  UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8),
+  UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b),
+  UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001),
+  UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30),
+  UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910),
+  

Re: [devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread A V Mahesh
Hi Vu,

Is this applies on top of   log #2146  - V4  , I see  both #tickets  has 
version changes ?

in which order i need to apply  ( #2146 & #2258 )or (#2258 & #2146).

=

patching file src/log/Makefile.am
Hunk #1 FAILED at 72.
Hunk #2 FAILED at 120.
2 out of 2 hunks FAILED -- saving rejects to file src/log/Makefile.am.rej
patching file src/log/config/logsv_classes.xml
Hunk #1 FAILED at 147.
1 out of 1 hunk FAILED -- saving rejects to file 
src/log/config/logsv_classes.xml.rej
patching file src/log/logd/lgs_config.cc
Hunk #1 succeeded at 35 (offset -5 lines).
Hunk #2 FAILED at 705.
Hunk #3 FAILED at 971.
2 out of 3 hunks FAILED -- saving rejects to file 
src/log/logd/lgs_config.cc.rej
patching file src/log/logd/lgs_config.h
Hunk #1 FAILED at 304.
1 out of 1 hunk FAILED -- saving rejects to file 
src/log/logd/lgs_config.h.rej
patching file src/log/logd/lgs_dest.cc
patching file src/log/logd/lgs_dest.h
patching file src/log/logd/lgs_evt.cc
Hunk #1 FAILED at 1.
Hunk #2 succeeded at 30 with fuzz 2 (offset 2 lines).
Hunk #3 succeeded at 1282 (offset 45 lines).
Hunk #4 succeeded at 1300 (offset 2 lines).
1 out of 4 hunks FAILED -- saving rejects to file 
src/log/logd/lgs_evt.cc.rej

=

-AVM


On 2/21/2017 3:03 PM, Vu Minh Nguyen wrote:
> Summary: log: add alternative destinations of log records [#2258]
> Review request for Trac Ticket(s): #2258
> Peer Reviewer(s): Lennart, Canh, Mahesh
> Pull request to: <>
> Affected branch(es): Default
> Development branch: Default
>
> 
> Impacted area   Impact y/n
> 
>   Docsn
>   Build systemn
>   RPM/packaging   n
>   Configuration files n
>   Startup scripts n
>   SAF servicesn
>   OpenSAF servicesy
>   Core libraries  n
>   Samples n
>   Tests   y
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
>   To run the test, this patch has dependent on following patches:
>   1) #2293 (sent by Anders Widel, but not yet pushed)
>   2) #2258 (v2, sent by Lennart, but not yet pushed yet)
>
> changeset d74aaf3025c99cade3165a15831124548f4d85bd
> Author:   Vu Minh Nguyen 
> Date: Wed, 15 Feb 2017 14:36:00 +0700
>
>   log: add alternative destinations of log records [#2258]
>
>   Here are major info, detailed info will be added to PR doc soon. 1) Add
>   attribute "saLogRecordDestination" to log stream. 2) Add Local socket
>   destintion handler 3) Integrate into first increment made by Lennart
>
> changeset 4bae27a478c235df3058f43c92d3a5483233b01d
> Author:   Vu Minh Nguyen 
> Date: Wed, 15 Feb 2017 15:07:09 +0700
>
>   log: add UML test case to verify alternative destination [#2258]
>
>   Major changes: 1) Modify Lennart's test cases because enhancing 
> destination
>   configuration validation rules. 2) Add test suite #17 to verify 
> alternative
>   destination
>
> changeset bc375725fed22bb4f8cb3ae3df5f96fb9d281efb
> Author:   Vu Minh Nguyen 
> Date: Thu, 16 Feb 2017 17:22:13 +0700
>
>   log: add unit tests to verify interfaces provided by destination handler
>   [#2258]
>
>   Unit tests to verify major interfaces: 1) CfgDestination() 2)
>   WriteToDestination()
>
>
> Added Files:
> 
>   src/log/apitest/tet_cfg_destination.c
>   src/log/logd/lgs_dest.cc
>   src/log/logd/lgs_dest.h
>   src/log/logd/lgs_mbcsv_v7.cc
>   src/log/logd/lgs_mbcsv_v7.h
>   src/log/tests/lgs_dest_test.cc
>   src/log/tests/Makefile
>
>
> Complete diffstat:
> --
>   src/log/Makefile  |4 +
>   src/log/Makefile.am   |   31 +-
>   src/log/apitest/tet_LogOiOps.c|8 +-
>   src/log/apitest/tet_cfg_destination.c |  483 
> 
>   src/log/config/logsv_classes.xml  |7 +-
>   src/log/logd/lgs_config.cc|  169 
> +---
>   src/log/logd/lgs_config.h |3 +-
>   src/log/logd/lgs_dest.cc  |  707 
> +
>   src/log/logd/lgs_dest.h   |  576 
> ++
>   src/log/logd/lgs_evt.cc   |   33 ++
>   src/log/logd/lgs_imm.cc   |  202 
> +--
>   src/log/logd/lgs_main.cc  |8 +
>   src/log/logd/lgs_mbcsv.cc |  103 

Re: [devel] [PATCH 3 of 3] log: fix checking version in log agent [#2146]

2017-02-21 Thread Lennart Lund
Hi Canh

This patch Ack
Will continue reviewing patch 2

Thanks
Lennart

> -Original Message-
> From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au]
> Sent: den 16 februari 2017 07:49
> To: Lennart Lund ; Vu Minh Nguyen
> ; mahesh.va...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 3 of 3] log: fix checking version in log agent [#2146]
> 
>  src/log/agent/lga_api.c   |  58 
> ++
>  src/log/apitest/tet_saLogFilterSetCallbackT.c |  53
> 
>  src/log/apitest/tet_saLogInitialize.c |  24 +++
>  3 files changed, 126 insertions(+), 9 deletions(-)
> 
> 
> Fix checking version in log agent
> 
> The agent report highest supported version except getting ERR_VERSION
> from
> server. if agent get ERR_VERSION, it will set supported version to A.02.03
> 
> diff --git a/src/log/agent/lga_api.c b/src/log/agent/lga_api.c
> --- a/src/log/agent/lga_api.c
> +++ b/src/log/agent/lga_api.c
> @@ -1,6 +1,7 @@
>  /*  -*- OpenSAF  -*-
>   *
>   * (C) Copyright 2008 The OpenSAF Foundation
> + * Copyright Ericsson AB 2008, 2017 - All Rights Reserved.
>   *
>   * This program is distributed in the hope that it will be useful, but
>   * WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY
> @@ -73,6 +74,24 @@ static bool is_lgs_state(lgs_state_t sta
>   return rc;
>  }
> 
> +/**
> + * Check if the log version is valid
> + * @param version
> + * @param client_ver
> + *
> + * @return true if log version is valid
> + */
> +static bool is_log_version_valid(const SaVersionT *ver) {
> + bool rc = false;
> + if ((ver->releaseCode == LOG_RELEASE_CODE) &&
> + (ver->majorVersion <= LOG_MAJOR_VERSION) &&
> + (ver->majorVersion > 0) &&
> + (ver->minorVersion <= LOG_MINOR_VERSION)) {
> + rc = true;
> + }
> + return rc;
> +}
> +
>  static void populate_open_params(lgsv_stream_open_req_t *open_param,
>const char *logStreamName,
>lga_client_hdl_rec_t *hdl_rec,
> @@ -151,6 +170,7 @@ SaAisErrorT saLogInitialize(SaLogHandleT
>   int rc;
>   uint32_t client_id = 0;
>   bool is_locked = false;
> + SaVersionT client_ver;
> 
>   TRACE_ENTER();
> 
> @@ -161,11 +181,18 @@ SaAisErrorT saLogInitialize(SaLogHandleT
>   goto done;
>   }
> 
> - /* validate the version */
> - if ((version->releaseCode == LOG_RELEASE_CODE) && (version-
> >majorVersion <= LOG_MAJOR_VERSION)) {
> + /***
> +  * Validate the version
> +  * Store client version that will be sent to log server. In case minor
> +  * version has not set, it is set to 1
> +  * Update the [out] version to highest supported version in log agent
> +  */
> + if (is_log_version_valid(version)) {
> + client_ver = *version;
> + if (version->minorVersion < LOG_MINOR_VERSION_0)
> + client_ver.minorVersion = LOG_MINOR_VERSION_0;
>   version->majorVersion = LOG_MAJOR_VERSION;
> - if (version->minorVersion != LOG_MINOR_VERSION_0)
> - version->minorVersion = LOG_MINOR_VERSION;
> + version->minorVersion = LOG_MINOR_VERSION;
>   } else {
>   TRACE("version FAILED, required: %c.%u.%u, supported:
> %c.%u.%u\n",
> version->releaseCode, version->majorVersion, version-
> >minorVersion,
> @@ -230,7 +257,7 @@ SaAisErrorT saLogInitialize(SaLogHandleT
>   memset(_msg, 0, sizeof(lgsv_msg_t));
>   i_msg.type = LGSV_LGA_API_MSG;
>   i_msg.info.api_info.type = LGSV_INITIALIZE_REQ;
> - i_msg.info.api_info.param.init.version = *version;
> + i_msg.info.api_info.param.init.version = client_ver;
> 
>   /* Send a message to LGS to obtain a client_id/server ref id which is
> cluster
>* wide unique.
> @@ -242,10 +269,23 @@ SaAisErrorT saLogInitialize(SaLogHandleT
>   goto done;
>   }
> 
> -/** Make sure the LGS return status was SA_AIS_OK
> - **/
> + /*
> +  * Make sure the LGS return status was SA_AIS_OK
> +  * If the returned status was SA_AIS_ERR_VERSION, the [out]
> version is
> +  * updated to highest supported version in log server. But now the
> log
> +  * server has not returned the highest version in the response. Here
> is
> +  * temporary updating [out] version to A.02.03.
> +  * TODO: This may be fixed to update the highest version when log
> server
> +  * return the response with version.
> +  */
>   ais_rc = o_msg->info.api_resp_info.rc;
> - if (SA_AIS_OK != ais_rc) {
> + if (ais_rc == SA_AIS_ERR_VERSION) {
> + TRACE("%s LGS error response %s", __FUNCTION__,
> saf_error(ais_rc));
> + version->releaseCode = LOG_RELEASE_CODE_1;
> + version->majorVersion = 

Re: [devel] [PATCH 1 of 1] imm: Cleanup orphaned implementers and admowners when headless [#2309]

2017-02-21 Thread Zoran Milinkovic
Hi Hung,

Reviewed the patch.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 17 februari 2017 09:06
To: Zoran Milinkovic ; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm: Cleanup orphaned implementers and admowners when 
headless [#2309]

 src/imm/immnd/ImmModel.cc |  31 ++-
 1 files changed, 18 insertions(+), 13 deletions(-)


If a client is down right before headless, chances are the implementers and 
admowners will be orphaned because IMMD fails to broadcast global discard 
messages.
This patch cleans those orphaned implementers and admowners up.

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -19373,16 +19373,21 @@ ImmModel::isolateThisNode(unsigned int t
 IdVector cv, gv;
 ImplementerInfo* info = (*i);
 otherNode = info->mNodeId;
-if(otherNode == thisNode || otherNode == 0) {
-++i;
+if (otherNode == 0) {
+/* The implementer was already discarded */
+} else if (otherNode == thisNode) {
+LOG_WA("Local implementer %u <%u, %x> (%s) was not globally 
discarded, discarding it...",
+   info->mId, info->mConn, info->mNodeId, 
info->mImplementerName.c_str());
+ConnVector cv;
+this->discardImplementer(info->mId, true, cv, isAtCoord);
 } else {
 info = NULL;
 this->discardNode(otherNode, cv, gv, isAtCoord, true);
 LOG_NO("Impl Discarded node %x", otherNode);
-/* Discard ccbs. */
-
-i = sImplementerVector.begin(); /* restart iteration. */
-}
+}
+/* Discarding implementer doesn't remove the implementer from 
sImplementerVector,
+ * so we don't have to restart the iteration */
+++i;
 }
 
 i2 = sOwnerVector.begin();
@@ -19390,17 +19395,17 @@ ImmModel::isolateThisNode(unsigned int t
 IdVector cv, gv;
 AdminOwnerInfo* ainfo = (*i2);
 otherNode = ainfo->mNodeId;
-if(otherNode == thisNode || otherNode == 0) {
-/* ??? (otherNode == 0) is that really correct ??? */
-++i2;
+osafassert(otherNode);
+if (otherNode == thisNode) {
+LOG_WA("Local admin owner %u (%s) was not hard finalized, 
finalizing it...",
+   ainfo->mId, ainfo->mAdminOwnerName.c_str());
+this->adminOwnerDelete(ainfo->mId, true, false);
 } else {
 ainfo = NULL;
 this->discardNode(otherNode, cv, gv, isAtCoord, true);
 LOG_NO("Admo Discarded node %x", otherNode);
-/* Discard ccbs */
-
-i2 =  sOwnerVector.begin(); /* restart iteration. */
-}
+}
+i2 =  sOwnerVector.begin(); /* restart iteration. */
 }
 
 /* Verify that all noncritical CCBs are aborted.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread A V Mahesh
Hi Canh,

I got it, i got confused because of  increased version to A.02.03 ,
I went through version handling given by Lennart

I just ACKed it.

-AVM

On 2/21/2017 3:29 PM, Canh Truong wrote:
> Hi Mahesh,
>
> SaLogFilterSetCallbackT was already declared before  . So we don't have to
> add more one header file.
>
> Regards
> Canh
>
> -Original Message-
> From: Canh Truong [mailto:canh.v.tru...@dektech.com.au]
> Sent: Tuesday, February 21, 2017 4:41 PM
> To: 'A V Mahesh'; 'lennart.l...@ericsson.com'; 'vu.m.ngu...@dektech.com.au'
> Cc: 'opensaf-devel@lists.sourceforge.net'
> Subject: RE: [devel] [PATCH 0 of 3] Review Request for log: implement
> SaLogFilterSetCallbackT and version handling V4 [#2146]
>
> Hi Mahesh,
>
> The saLogFilterSetCallback is already existing in spec. But it has not
> implemented yet. The patch implemented to received filter callback from log
> server. So we increase version to A.02.03.
> You can refer at Lennart's comments in
> https://sourceforge.net/p/opensaf/tickets/2146/ for version handling.
>
> Regards
> Canh
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Tuesday, February 21, 2017 4:31 PM
> To: Canh Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 0 of 3] Review Request for log: implement
> SaLogFilterSetCallbackT and version handling V4 [#2146]
>
> Hi Canh,
>
> I am sorry saLogFilterSetCallback is existing call back in specification and
> it seem we increased initialized  version jut to support  agent version is
> that right ?
>
> -AVM
>
> On 2/21/2017 2:51 PM, A V Mahesh wrote:
>> Hi Canh,
>>
>> The  general practice of implementing  any upcoming functionality of
>> SAF specification we do define in relevant structures
>> `src//saf/` file for example
>> `src/ckpt/saf/saCkpt_B_02_03.h` in addition to
>> `src/ckpt/saf/saCkpt.h`, so that user will include that new .h file
>> for new definitions
>>
>> Is their any reson  `SaLogFilterSetCallbackT` didn't followed this ?
>> How application will include this  `SaLogFilterSetCallbackT` ?
>>
>> -AVM
>>
>> On 2/21/2017 2:07 PM, A V Mahesh wrote:
>>> Hi Canh,
>>>
>>> I can see that you are passing NULL callbacks as `` for
>>> "logtest 1 10" and " logtest 1 11" by seeing
>>>
>>> -AVM
>>>
>>>
>>> On 2/21/2017 1:02 PM, Canh Truong wrote:
 Hi Mahesh,

 The test case " logtest 1 10" and " logtest 1 11"  are created for
 version handling. In standby node, it has new code for log agent
 (with #2146), that means that version handling in log agent have been
> added.
 The log agent check if minor version bigger than the agent support,
 it will return ERROR_VERSION.  The test case is successful.

 In test case 11, log agent reassign for version of client is A.02.01
 before sending to the initialized request to log server. So the test
 case is successful.

 The test cases for filter callback is in test suite 17. (logtest 17)

 Regards
 Canh


 -Original Message-
 From: A V Mahesh [mailto:mahesh.va...@oracle.com]
 Sent: Tuesday, February 21, 2017 2:10 PM
 To: Canh Van Truong; lennart.l...@ericsson.com;
 vu.m.ngu...@dektech.com.au
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [PATCH 0 of 3] Review Request for log: implement
 SaLogFilterSetCallbackT and version handling V4 [#2146]

 Hi  Canh,

 I was jut testing Agent in-service upgrade , so I have following
 setup and run the New FilterSetCallback test case and i was
 expecting case should receive fail/not-supported , but they are getting
> succeed how ?

 -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
 -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )

 SC-1# /usr/bin/logtest 1 10

 Suite 1: Library Life Cycle
 10  PASSED   saLogInitialize() with minor version is set bigger
> than
 supported version;

 
 
 =

 Test Result:
Total:  1
Passed: 1
Failed: 0

 SC-1# /usr/bin/logtest 1 11

 Suite 1: Library Life Cycle
 11  PASSED   saLogInitialize() with minor version is not set;

 
 
 =

 Test Result:
Total:  1
Passed: 1
Failed: 0

 -AVM

 On 2/16/2017 12:18 PM, Canh Van Truong wrote:
> Summary: log: implement SaLogFilterSetCallbackT and version
> handling
> V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
> Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es):
> default Development branch: default
>
> 

Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread Canh Truong
Hi Mahesh,

SaLogFilterSetCallbackT was already declared before  . So we don't have to
add more one header file. 

Regards
Canh

-Original Message-
From: Canh Truong [mailto:canh.v.tru...@dektech.com.au] 
Sent: Tuesday, February 21, 2017 4:41 PM
To: 'A V Mahesh'; 'lennart.l...@ericsson.com'; 'vu.m.ngu...@dektech.com.au'
Cc: 'opensaf-devel@lists.sourceforge.net'
Subject: RE: [devel] [PATCH 0 of 3] Review Request for log: implement
SaLogFilterSetCallbackT and version handling V4 [#2146]

Hi Mahesh,

The saLogFilterSetCallback is already existing in spec. But it has not
implemented yet. The patch implemented to received filter callback from log
server. So we increase version to A.02.03.
You can refer at Lennart's comments in
https://sourceforge.net/p/opensaf/tickets/2146/ for version handling.

Regards
Canh

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com]
Sent: Tuesday, February 21, 2017 4:31 PM
To: Canh Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 0 of 3] Review Request for log: implement
SaLogFilterSetCallbackT and version handling V4 [#2146]

Hi Canh,

I am sorry saLogFilterSetCallback is existing call back in specification and
it seem we increased initialized  version jut to support  agent version is
that right ?

-AVM

On 2/21/2017 2:51 PM, A V Mahesh wrote:
> Hi Canh,
>
> The  general practice of implementing  any upcoming functionality of 
> SAF specification we do define in relevant structures 
> `src//saf/` file for example 
> `src/ckpt/saf/saCkpt_B_02_03.h` in addition to 
> `src/ckpt/saf/saCkpt.h`, so that user will include that new .h file 
> for new definitions
>
> Is their any reson  `SaLogFilterSetCallbackT` didn't followed this ?
> How application will include this  `SaLogFilterSetCallbackT` ?
>
> -AVM
>
> On 2/21/2017 2:07 PM, A V Mahesh wrote:
>> Hi Canh,
>>
>> I can see that you are passing NULL callbacks as `` for 
>> "logtest 1 10" and " logtest 1 11" by seeing
>>
>> -AVM
>>
>>
>> On 2/21/2017 1:02 PM, Canh Truong wrote:
>>> Hi Mahesh,
>>>
>>> The test case " logtest 1 10" and " logtest 1 11"  are created for 
>>> version handling. In standby node, it has new code for log agent 
>>> (with #2146), that means that version handling in log agent have been
added.
>>> The log agent check if minor version bigger than the agent support, 
>>> it will return ERROR_VERSION.  The test case is successful.
>>>
>>> In test case 11, log agent reassign for version of client is A.02.01 
>>> before sending to the initialized request to log server. So the test 
>>> case is successful.
>>>
>>> The test cases for filter callback is in test suite 17. (logtest 17)
>>>
>>> Regards
>>> Canh
>>>
>>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Tuesday, February 21, 2017 2:10 PM
>>> To: Canh Van Truong; lennart.l...@ericsson.com; 
>>> vu.m.ngu...@dektech.com.au
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 0 of 3] Review Request for log: implement 
>>> SaLogFilterSetCallbackT and version handling V4 [#2146]
>>>
>>> Hi  Canh,
>>>
>>> I was jut testing Agent in-service upgrade , so I have following 
>>> setup and run the New FilterSetCallback test case and i was 
>>> expecting case should receive fail/not-supported , but they are getting
succeed how ?
>>>
>>>
>>> -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
>>> -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )
>>>
>>> SC-1# /usr/bin/logtest 1 10
>>>
>>> Suite 1: Library Life Cycle
>>>10  PASSED   saLogInitialize() with minor version is set bigger
than
>>> supported version;
>>>
>>> 
>>> 
>>> =
>>>
>>>Test Result:
>>>   Total:  1
>>>   Passed: 1
>>>   Failed: 0
>>>
>>> SC-1# /usr/bin/logtest 1 11
>>>
>>> Suite 1: Library Life Cycle
>>>11  PASSED   saLogInitialize() with minor version is not set;
>>>
>>> 
>>> 
>>> =
>>>
>>>Test Result:
>>>   Total:  1
>>>   Passed: 1
>>>   Failed: 0
>>>
>>> -AVM
>>>
>>> On 2/16/2017 12:18 PM, Canh Van Truong wrote:
 Summary: log: implement SaLogFilterSetCallbackT and version 
 handling
 V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
 Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es): 
 default Development branch: default

 
 Impacted area   Impact y/n
 
  Docsn
  Build systemn
  RPM/packaging   n
  Configuration files n
  Startup scripts n
  SAF servicesn
  OpenSAF servicesy
  Core libraries  n

Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread A V Mahesh
Hi Canh,

ACK tested ( including agent upgrade )

-AVM

On 2/21/2017 3:11 PM, Canh Truong wrote:
> Hi Mahesh,
>
> The saLogFilterSetCallback is already existing in spec. But it has not
> implemented yet. The patch implemented to received filter callback from log
> server. So we increase version to A.02.03.
> You can refer at Lennart's comments in
> https://sourceforge.net/p/opensaf/tickets/2146/ for version handling.
>
> Regards
> Canh
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Tuesday, February 21, 2017 4:31 PM
> To: Canh Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 0 of 3] Review Request for log: implement
> SaLogFilterSetCallbackT and version handling V4 [#2146]
>
> Hi Canh,
>
> I am sorry saLogFilterSetCallback is existing call back in specification and
> it seem we increased initialized  version jut to support  agent version is
> that right ?
>
> -AVM
>
> On 2/21/2017 2:51 PM, A V Mahesh wrote:
>> Hi Canh,
>>
>> The  general practice of implementing  any upcoming functionality of
>> SAF specification we do define in relevant structures
>> `src//saf/` file for example
>> `src/ckpt/saf/saCkpt_B_02_03.h` in addition to
>> `src/ckpt/saf/saCkpt.h`, so that user will include that new .h file
>> for new definitions
>>
>> Is their any reson  `SaLogFilterSetCallbackT` didn't followed this ?
>> How application will include this  `SaLogFilterSetCallbackT` ?
>>
>> -AVM
>>
>> On 2/21/2017 2:07 PM, A V Mahesh wrote:
>>> Hi Canh,
>>>
>>> I can see that you are passing NULL callbacks as `` for
>>> "logtest 1 10" and " logtest 1 11" by seeing
>>>
>>> -AVM
>>>
>>>
>>> On 2/21/2017 1:02 PM, Canh Truong wrote:
 Hi Mahesh,

 The test case " logtest 1 10" and " logtest 1 11"  are created for
 version handling. In standby node, it has new code for log agent
 (with #2146), that means that version handling in log agent have been
> added.
 The log agent check if minor version bigger than the agent support,
 it will return ERROR_VERSION.  The test case is successful.

 In test case 11, log agent reassign for version of client is A.02.01
 before sending to the initialized request to log server. So the test
 case is successful.

 The test cases for filter callback is in test suite 17. (logtest 17)

 Regards
 Canh


 -Original Message-
 From: A V Mahesh [mailto:mahesh.va...@oracle.com]
 Sent: Tuesday, February 21, 2017 2:10 PM
 To: Canh Van Truong; lennart.l...@ericsson.com;
 vu.m.ngu...@dektech.com.au
 Cc: opensaf-devel@lists.sourceforge.net
 Subject: Re: [PATCH 0 of 3] Review Request for log: implement
 SaLogFilterSetCallbackT and version handling V4 [#2146]

 Hi  Canh,

 I was jut testing Agent in-service upgrade , so I have following
 setup and run the New FilterSetCallback test case and i was
 expecting case should receive fail/not-supported , but they are getting
> succeed how ?

 -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
 -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )

 SC-1# /usr/bin/logtest 1 10

 Suite 1: Library Life Cycle
 10  PASSED   saLogInitialize() with minor version is set bigger
> than
 supported version;

 
 
 =

 Test Result:
Total:  1
Passed: 1
Failed: 0

 SC-1# /usr/bin/logtest 1 11

 Suite 1: Library Life Cycle
 11  PASSED   saLogInitialize() with minor version is not set;

 
 
 =

 Test Result:
Total:  1
Passed: 1
Failed: 0

 -AVM

 On 2/16/2017 12:18 PM, Canh Van Truong wrote:
> Summary: log: implement SaLogFilterSetCallbackT and version
> handling
> V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
> Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es):
> default Development branch: default
>
> 
> Impacted area   Impact y/n
> 
>   Docsn
>   Build systemn
>   RPM/packaging   n
>   Configuration files n
>   Startup scripts n
>   SAF servicesn
>   OpenSAF servicesy
>   Core libraries  n
>   Samples n
>   Tests   n
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
>   

Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread Canh Truong
Hi Mahesh,

The saLogFilterSetCallback is already existing in spec. But it has not
implemented yet. The patch implemented to received filter callback from log
server. So we increase version to A.02.03.
You can refer at Lennart's comments in
https://sourceforge.net/p/opensaf/tickets/2146/ for version handling.

Regards
Canh

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com] 
Sent: Tuesday, February 21, 2017 4:31 PM
To: Canh Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 0 of 3] Review Request for log: implement
SaLogFilterSetCallbackT and version handling V4 [#2146]

Hi Canh,

I am sorry saLogFilterSetCallback is existing call back in specification and
it seem we increased initialized  version jut to support  agent version is
that right ?

-AVM

On 2/21/2017 2:51 PM, A V Mahesh wrote:
> Hi Canh,
>
> The  general practice of implementing  any upcoming functionality of 
> SAF specification we do define in relevant structures 
> `src//saf/` file for example 
> `src/ckpt/saf/saCkpt_B_02_03.h` in addition to 
> `src/ckpt/saf/saCkpt.h`, so that user will include that new .h file 
> for new definitions
>
> Is their any reson  `SaLogFilterSetCallbackT` didn't followed this ?
> How application will include this  `SaLogFilterSetCallbackT` ?
>
> -AVM
>
> On 2/21/2017 2:07 PM, A V Mahesh wrote:
>> Hi Canh,
>>
>> I can see that you are passing NULL callbacks as `` for 
>> "logtest 1 10" and " logtest 1 11" by seeing
>>
>> -AVM
>>
>>
>> On 2/21/2017 1:02 PM, Canh Truong wrote:
>>> Hi Mahesh,
>>>
>>> The test case " logtest 1 10" and " logtest 1 11"  are created for 
>>> version handling. In standby node, it has new code for log agent 
>>> (with #2146), that means that version handling in log agent have been
added.
>>> The log agent check if minor version bigger than the agent support, 
>>> it will return ERROR_VERSION.  The test case is successful.
>>>
>>> In test case 11, log agent reassign for version of client is A.02.01 
>>> before sending to the initialized request to log server. So the test 
>>> case is successful.
>>>
>>> The test cases for filter callback is in test suite 17. (logtest 17)
>>>
>>> Regards
>>> Canh
>>>
>>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Tuesday, February 21, 2017 2:10 PM
>>> To: Canh Van Truong; lennart.l...@ericsson.com; 
>>> vu.m.ngu...@dektech.com.au
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 0 of 3] Review Request for log: implement 
>>> SaLogFilterSetCallbackT and version handling V4 [#2146]
>>>
>>> Hi  Canh,
>>>
>>> I was jut testing Agent in-service upgrade , so I have following 
>>> setup and run the New FilterSetCallback test case and i was 
>>> expecting case should receive fail/not-supported , but they are getting
succeed how ?
>>>
>>>
>>> -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
>>> -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )
>>>
>>> SC-1# /usr/bin/logtest 1 10
>>>
>>> Suite 1: Library Life Cycle
>>>10  PASSED   saLogInitialize() with minor version is set bigger
than
>>> supported version;
>>>
>>> 
>>> 
>>> =
>>>
>>>Test Result:
>>>   Total:  1
>>>   Passed: 1
>>>   Failed: 0
>>>
>>> SC-1# /usr/bin/logtest 1 11
>>>
>>> Suite 1: Library Life Cycle
>>>11  PASSED   saLogInitialize() with minor version is not set;
>>>
>>> 
>>> 
>>> =
>>>
>>>Test Result:
>>>   Total:  1
>>>   Passed: 1
>>>   Failed: 0
>>>
>>> -AVM
>>>
>>> On 2/16/2017 12:18 PM, Canh Van Truong wrote:
 Summary: log: implement SaLogFilterSetCallbackT and version 
 handling
 V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
 Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es): 
 default Development branch: default

 
 Impacted area   Impact y/n
 
  Docsn
  Build systemn
  RPM/packaging   n
  Configuration files n
  Startup scripts n
  SAF servicesn
  OpenSAF servicesy
  Core libraries  n
  Samples n
  Tests   n
  Other   n


 Comments (indicate scope for each "y" above):
 -
  <>

 changeset 05726400fc1a27cf50255b70bb7f952156cbe68f
 Author:Canh Van Truong 
 Date:  Mon, 21 Nov 2016 17:19:56 +0700

log: implement SaLogFilterSetCallbackT [#2146]

Implement 

[devel] [PATCH 3 of 3] log: add unit tests to verify interfaces provided by destination handler [#2258]

2017-02-21 Thread Vu Minh Nguyen
 src/log/Makefile   |4 +
 src/log/Makefile.am|   19 +++
 src/log/tests/Makefile |   20 +++
 src/log/tests/lgs_dest_test.cc |  209 +
 4 files changed, 252 insertions(+), 0 deletions(-)


Unit tests to verify major interfaces:
1) CfgDestination()
2) WriteToDestination()

diff --git a/src/log/Makefile b/src/log/Makefile
--- a/src/log/Makefile
+++ b/src/log/Makefile
@@ -1,6 +1,7 @@
 #  -*- OpenSAF  -*-
 #
 # (C) Copyright 2016 The OpenSAF Foundation
+# Copyright Ericsson AB 2016, 2017 - All Rights Reserved.
 #
 # This program is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -17,3 +18,6 @@
 all:
$(MAKE) -C ../.. lib/libSaLog.la bin/saflogger bin/osaflogd
 
+check:
+   $(MAKE) -C ../.. bin/testlogd
+   ../../bin/testlogd
diff --git a/src/log/Makefile.am b/src/log/Makefile.am
--- a/src/log/Makefile.am
+++ b/src/log/Makefile.am
@@ -81,6 +81,7 @@ noinst_HEADERS += \
 bin_PROGRAMS += bin/saflogger
 osaf_execbin_PROGRAMS += bin/osaflogd
 CORE_INCLUDES += -I$(top_srcdir)/src/log/saf
+TESTS += bin/testlogd
 pkgconfig_DATA += src/log/saf/opensaf-log.pc
 
 nodist_pkgclccli_SCRIPTS += \
@@ -218,4 +219,22 @@ bin_logtestfr_LDADD = \
lib/libSaImmOm.la \
lib/libopensaf_core.la
 
+bin_testlogd_CXXFLAGS =$(AM_CXXFLAGS)
+
+bin_testlogd_CPPFLAGS = \
+   $(AM_CPPFLAGS) \
+   -I$(GTEST_DIR)/include
+
+bin_testlogd_LDFLAGS = \
+   $(AM_LDFLAGS)
+
+bin_testlogd_SOURCES = \
+   src/log/tests/lgs_dest_test.cc \
+   src/log/logd/lgs_dest.cc
+
+bin_testlogd_LDADD = \
+   lib/libopensaf_core.la \
+   $(GTEST_DIR)/lib/libgtest.la \
+   $(GTEST_DIR)/lib/libgtest_main.la
+
 endif
diff --git a/src/log/tests/Makefile b/src/log/tests/Makefile
new file mode 100644
--- /dev/null
+++ b/src/log/tests/Makefile
@@ -0,0 +1,20 @@
+#  -*- OpenSAF  -*-
+#
+# (C) Copyright 2017 The OpenSAF Foundation
+# Copyright Ericsson AB 2017 - All Rights Reserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+# under the GNU Lesser General Public License Version 2.1, February 1999.
+# The complete license can be accessed from the following location:
+# http://opensource.org/licenses/lgpl-license.php
+# See the Copying file included with the OpenSAF distribution for full
+# licensing terms.
+#
+# Author(s): Ericsson AB
+#
+
+check:
+   $(MAKE) -C ../../.. bin/testlogd
+   ../../../bin/testlogd
diff --git a/src/log/tests/lgs_dest_test.cc b/src/log/tests/lgs_dest_test.cc
new file mode 100644
--- /dev/null
+++ b/src/log/tests/lgs_dest_test.cc
@@ -0,0 +1,209 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2017 The OpenSAF Foundation
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+#define protected public
+#define private public
+
+#include "log/logd/lgs_dest.h"
+#include 
+#include 
+#include "base/unix_server_socket.h"
+#include "gtest/gtest.h"
+
+// Verify it is OK to add one valid destination configuration
+TEST(CfgDestination, AddOneDestination) {
+  const std::vector vdest {"test;localsocket;/tmp/sock.sock"};
+  ASSERT_EQ(CfgDestination(vdest, ModifyType::kAdd), true);
+}
+
+// Verify it is Ok to add multiple destination configurations
+TEST(CfgDestination, AddMultipleDestination) {
+  const std::vector vdest {"test;localsocket;/tmp/sock.sock",
+"test1;localsocket;/tmp/sock1.sock", 
"test2;localsocket;/tmp/sock2.sock"};
+  ASSERT_EQ(CfgDestination(vdest, ModifyType::kAdd), true);
+}
+
+// Verify it is Ok to add NIL destination
+TEST(CfgDestination, AddNilDestination) {
+  const std::vector vdest {"test;localsocket;/tmp/sock.sock",
+"test1;localsocket;/tmp/sock1.sock", "test2;localsocket;"};
+  ASSERT_EQ(CfgDestination(vdest, ModifyType::kAdd), true);
+}
+
+// Verify it is OK to delete one destination configuration
+TEST(CfgDestination, DelOneDestination) {
+  const std::vector vdest {"test;localsocket;/tmp/sock.sock",
+"test1;localsocket;/tmp/sock1.sock", "test2;localsocket;"};
+  CfgDestination(vdest, ModifyType::kAdd);
+
+  // Delete destination
+  const std::vector vdeldest 
{"test1;localsocket;/tmp/sock1.sock"};
+  ASSERT_EQ(CfgDestination(vdeldest, 

[devel] [PATCH 1 of 3] log: add alternative destinations of log records [#2258]

2017-02-21 Thread Vu Minh Nguyen
 src/log/Makefile.am  |8 +-
 src/log/config/logsv_classes.xml |7 +-
 src/log/logd/lgs_config.cc   |  169 -
 src/log/logd/lgs_config.h|3 +-
 src/log/logd/lgs_dest.cc |  707 +++
 src/log/logd/lgs_dest.h  |  576 +++
 src/log/logd/lgs_evt.cc  |   33 +
 src/log/logd/lgs_imm.cc  |  202 +-
 src/log/logd/lgs_main.cc |8 +
 src/log/logd/lgs_mbcsv.cc|  103 +-
 src/log/logd/lgs_mbcsv.h |6 +-
 src/log/logd/lgs_mbcsv_v5.cc |   10 +
 src/log/logd/lgs_mbcsv_v7.cc |  177 +
 src/log/logd/lgs_mbcsv_v7.h  |   67 +++
 src/log/logd/lgs_stream.cc   |   60 +++-
 src/log/logd/lgs_stream.h|   16 +
 src/log/logd/lgs_util.cc |   63 +++
 src/log/logd/lgs_util.h  |   11 +-
 18 files changed, 2154 insertions(+), 72 deletions(-)


Here are major info, detailed info will be added to PR doc soon.
1) Add attribute "saLogRecordDestination" to log stream.
2) Add Local socket destintion handler
3) Integrate into first increment made by Lennart

diff --git a/src/log/Makefile.am b/src/log/Makefile.am
--- a/src/log/Makefile.am
+++ b/src/log/Makefile.am
@@ -72,9 +72,11 @@ noinst_HEADERS += \
src/log/logd/lgs_mbcsv_v2.h \
src/log/logd/lgs_mbcsv_v3.h \
src/log/logd/lgs_mbcsv_v5.h \
+   src/log/logd/lgs_mbcsv_v7.h \
src/log/logd/lgs_recov.h \
src/log/logd/lgs_stream.h \
-   src/log/logd/lgs_util.h
+   src/log/logd/lgs_util.h \
+   src/log/logd/lgs_dest.h
 
 bin_PROGRAMS += bin/saflogger
 osaf_execbin_PROGRAMS += bin/osaflogd
@@ -118,10 +120,12 @@ bin_osaflogd_SOURCES = \
src/log/logd/lgs_mbcsv_v2.cc \
src/log/logd/lgs_mbcsv_v3.cc \
src/log/logd/lgs_mbcsv_v5.cc \
+   src/log/logd/lgs_mbcsv_v7.cc \
src/log/logd/lgs_mds.cc \
src/log/logd/lgs_recov.cc \
src/log/logd/lgs_stream.cc \
-   src/log/logd/lgs_util.cc
+   src/log/logd/lgs_util.cc \
+   src/log/logd/lgs_dest.cc
 
 bin_osaflogd_LDADD = \
lib/libosaf_common.la \
diff --git a/src/log/config/logsv_classes.xml b/src/log/config/logsv_classes.xml
--- a/src/log/config/logsv_classes.xml
+++ b/src/log/config/logsv_classes.xml
@@ -147,12 +147,13 @@
SA_CONFIG
SA_WRITABLE

-   
+   
saLogRecordDestination
-   SA_UINT32_T
+   SA_STRING_T
SA_CONFIG
SA_WRITABLE
-SA_MULTI_VALUE
+   SA_MULTI_VALUE
+   SA_NO_DUPLICATES


saLogStreamCreationTimestamp
diff --git a/src/log/logd/lgs_config.cc b/src/log/logd/lgs_config.cc
--- a/src/log/logd/lgs_config.cc
+++ b/src/log/logd/lgs_config.cc
@@ -40,6 +40,7 @@
 #include "osaf/immutil/immutil.h"
 #include "log/logd/lgs_file.h"
 #include "log/logd/lgs.h"
+#include "log/logd/lgs_util.h"
 
 static SaVersionT immVersion = { 'A', 2, 11 };
 
@@ -709,33 +710,162 @@ static int lgs_cfg_verify_log_filesys_co
   return rc;
 }
 
+//>
+// Utility functions to validate destination configuration format
+//<
+// Typedef for shorten declaration
+// This type could be used to hold set of strings with formats
+// 1) {"name;type;value", etc.}
+// 2) {"name", "type", "value"}
+// 3) etc.
+using VectorString = std::vector;
+//>
+// Define the "token" possition in destination configuration.
+// kName : use this index to get "name" token
+// kType : use this index to get "type" token
+// kValue: use this index to get "value" token
+// kSize : this is the maximum size of the dest configuration vector.
+//<
+enum { kName = 0, kType, kValue, kSize };
+// Tokens seperator
+const char kSemicolon[] = ";";
+
+
+// The format of destination must be one of followings:
+// 1) "name;type;"
+// 2) "name;type;value"
+// So, in destination configuration, must have 02 semiconlons
+// no more, no less.
+//
+bool is_right_destination_fmt(const VectorString& vdest) {
+  int nl_cnt = 0;
+  // Check each single destination
+  for (const auto& it : vdest) {
+nl_cnt = std::count(it.begin(), it.end(), ';');
+if (nl_cnt != 2) {
+  TRACE("%s wrong destination format", __func__);
+  return false;
+}
+  }
+  return true;
+}
+
+// Return false if "name" token is invalid
+bool is_name_valid(const VectorString& vdest) {
+  // Check each single destination
+  for (const auto& it : vdest) {
+const VectorString sdes = logutil::Parser(it, kSemicolon);
+if (sdes[kName].length() == 0) {
+  TRACE("%s wrong name format (name is empty value)", __func__);
+  return false;
+}
+// invalid name if having special characters in
+if (logutil::isUnixName(sdes[kName]) == false) {
+  TRACE("%s wrong name format (has special chars 

[devel] [PATCH 0 of 3] Review Request for log: add alternative destinations of log records [#2258] V4

2017-02-21 Thread Vu Minh Nguyen
Summary: log: add alternative destinations of log records [#2258]
Review request for Trac Ticket(s): #2258
Peer Reviewer(s): Lennart, Canh, Mahesh
Pull request to: <>
Affected branch(es): Default
Development branch: Default


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   y
 Other   n


Comments (indicate scope for each "y" above):
-
 To run the test, this patch has dependent on following patches:
 1) #2293 (sent by Anders Widel, but not yet pushed)
 2) #2258 (v2, sent by Lennart, but not yet pushed yet)

changeset d74aaf3025c99cade3165a15831124548f4d85bd
Author: Vu Minh Nguyen 
Date:   Wed, 15 Feb 2017 14:36:00 +0700

log: add alternative destinations of log records [#2258]

Here are major info, detailed info will be added to PR doc soon. 1) Add
attribute "saLogRecordDestination" to log stream. 2) Add Local socket
destintion handler 3) Integrate into first increment made by Lennart

changeset 4bae27a478c235df3058f43c92d3a5483233b01d
Author: Vu Minh Nguyen 
Date:   Wed, 15 Feb 2017 15:07:09 +0700

log: add UML test case to verify alternative destination [#2258]

Major changes: 1) Modify Lennart's test cases because enhancing 
destination
configuration validation rules. 2) Add test suite #17 to verify 
alternative
destination

changeset bc375725fed22bb4f8cb3ae3df5f96fb9d281efb
Author: Vu Minh Nguyen 
Date:   Thu, 16 Feb 2017 17:22:13 +0700

log: add unit tests to verify interfaces provided by destination handler
[#2258]

Unit tests to verify major interfaces: 1) CfgDestination() 2)
WriteToDestination()


Added Files:

 src/log/apitest/tet_cfg_destination.c
 src/log/logd/lgs_dest.cc
 src/log/logd/lgs_dest.h
 src/log/logd/lgs_mbcsv_v7.cc
 src/log/logd/lgs_mbcsv_v7.h
 src/log/tests/lgs_dest_test.cc
 src/log/tests/Makefile


Complete diffstat:
--
 src/log/Makefile  |4 +
 src/log/Makefile.am   |   31 +-
 src/log/apitest/tet_LogOiOps.c|8 +-
 src/log/apitest/tet_cfg_destination.c |  483 

 src/log/config/logsv_classes.xml  |7 +-
 src/log/logd/lgs_config.cc|  169 +---
 src/log/logd/lgs_config.h |3 +-
 src/log/logd/lgs_dest.cc  |  707 
+
 src/log/logd/lgs_dest.h   |  576 
++
 src/log/logd/lgs_evt.cc   |   33 ++
 src/log/logd/lgs_imm.cc   |  202 
+--
 src/log/logd/lgs_main.cc  |8 +
 src/log/logd/lgs_mbcsv.cc |  103 ++-
 src/log/logd/lgs_mbcsv.h  |6 +-
 src/log/logd/lgs_mbcsv_v5.cc  |   10 +
 src/log/logd/lgs_mbcsv_v7.cc  |  177 
+++
 src/log/logd/lgs_mbcsv_v7.h   |   67 +
 src/log/logd/lgs_stream.cc|   60 +++-
 src/log/logd/lgs_stream.h |   16 +++
 src/log/logd/lgs_util.cc  |   63 
 src/log/logd/lgs_util.h   |   11 +-
 src/log/tests/Makefile|   20 +++
 src/log/tests/lgs_dest_test.cc|  209 
+
 23 files changed, 2896 insertions(+), 77 deletions(-)


Testing Commands:
-
 Run UML test suite #17


Testing, Expected Results:
--
 All test passed


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is 

[devel] [PATCH 2 of 3] log: add UML test case to verify alternative destination [#2258]

2017-02-21 Thread Vu Minh Nguyen
 src/log/Makefile.am   |4 +-
 src/log/apitest/tet_LogOiOps.c|8 +-
 src/log/apitest/tet_cfg_destination.c |  483 ++
 3 files changed, 490 insertions(+), 5 deletions(-)


Major changes:
1) Modify Lennart's test cases because enhancing destination
   configuration validation rules.
2) Add test suite #17 to verify alternative destination

diff --git a/src/log/Makefile.am b/src/log/Makefile.am
--- a/src/log/Makefile.am
+++ b/src/log/Makefile.am
@@ -183,7 +183,9 @@ bin_logtest_SOURCES = \
src/log/apitest/tet_Log_recov.c \
src/log/apitest/tet_log_runtime_cfgobj.c \
src/log/apitest/tet_log_longDN.c \
-   src/log/apitest/tet_Log_clm.c
+   src/log/apitest/tet_Log_clm.c \
+   src/log/apitest/tet_cfg_destination.c
+
 
 bin_logtest_LDADD = \
lib/libapitest.la \
diff --git a/src/log/apitest/tet_LogOiOps.c b/src/log/apitest/tet_LogOiOps.c
--- a/src/log/apitest/tet_LogOiOps.c
+++ b/src/log/apitest/tet_LogOiOps.c
@@ -1923,7 +1923,7 @@ void check_logRecordDestinationConfigura
do {
// Add values
for (int i = 0; i < num_values; i++) {
-   sprintf(set_values[i], "Name%d;Type%d;Setting%d", i, i, 
i);
+   sprintf(set_values[i], "Name%d;localsocket;Setting%d", 
i, i);
sprintf(command, "immcfg "
"-a logRecordDestinationConfiguration+="
"'%s' "
@@ -1979,7 +1979,7 @@ void check_logRecordDestinationConfigura
do {
// Add values
for (int i = 0; i < num_values; i++) {
-   sprintf(set_values[i], "Name%d;Type%d;Setting%d", i, i, 
i);
+   sprintf(set_values[i], "Name%d;localsocket;Setting%d", 
i, i);
sprintf(command, "immcfg "
"-a logRecordDestinationConfiguration+="
"'%s' "
@@ -2067,7 +2067,7 @@ void check_logRecordDestinationConfigura
do {
// Add values that will be replaced
for (int i = 0; i < num_values; i++) {
-   sprintf(set_values[i], "Name%d;Type%d;Setting%d", i, i, 
i);
+   sprintf(set_values[i], "Name%d;localsocket;Setting%d", 
i, i);
sprintf(command, "immcfg "
"-a logRecordDestinationConfiguration+="
"'%s' "
@@ -2094,7 +2094,7 @@ void check_logRecordDestinationConfigura
int num_new_values = 3;
for (int i = 0; i < num_new_values; i++) {
sprintf(set_values[i],
-   "NewName%d;NewType%d;NewSetting%d", i, i, i);
+   "NewName%d;localsocket;NewSetting%d", i, i);
}
sprintf(command, "immcfg "
"-a logRecordDestinationConfiguration='%s' "
diff --git a/src/log/apitest/tet_cfg_destination.c 
b/src/log/apitest/tet_cfg_destination.c
new file mode 100644
--- /dev/null
+++ b/src/log/apitest/tet_cfg_destination.c
@@ -0,0 +1,483 @@
+/*  -*- OpenSAF  -*-
+ *
+ * (C) Copyright 2017 The OpenSAF Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+ * under the GNU Lesser General Public License Version 2.1, February 1999.
+ * The complete license can be accessed from the following location:
+ * http://opensource.org/licenses/lgpl-license.php
+ * See the Copying file included with the OpenSAF distribution for full
+ * licensing terms.
+ *
+ * Author(s): Ericsson AB
+ *
+ */
+
+#include "log/apitest/logtest.h"
+
+// These test cases are for testing #2258 - alternative destinations
+
+//==
+// Validate `logRecordDestinationConfiguration`
+//==
+const char validDest[] = "desta;localsocket;/var/lib/opensaf/mds_log.sock";
+// Multi destinations
+const char multiDest1[] = "desta;localsocket;/var/lib/opensaf/mds_log.sock";
+const char multiDest2[] = "destb;localsocket;/var/lib/opensaf/local.sock";
+// Delete destination
+const char delDest[] = "";
+// NIL destination configution.
+const char nildest[] = "destc;localsocket;";
+
+//>
+// Abnormal cases
+//<
+// Only destination type = "unix" is supported.
+const char invalidTypeDest[] = "test;invalid;/var/lib/opensaf/mds_log.sock";
+// "name" & "type" must have at least.
+const char invalidFmtDest[] = "test";
+// "name" must not contain special characters
+const char invalidNameDest[] = "destA?abc;localsocket;";
+// Same "name" must go with same "dest" and vice versa.
+const char invalidDuplicatedDest[] =
+ 

Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread A V Mahesh
Hi Canh,

I am sorry saLogFilterSetCallback is existing call back in specification
and it seem we increased initialized  version jut to support  agent 
version is that right ?

-AVM

On 2/21/2017 2:51 PM, A V Mahesh wrote:
> Hi Canh,
>
> The  general practice of implementing  any upcoming functionality of SAF
> specification we do define in relevant structures
> `src//saf/` file
> for example `src/ckpt/saf/saCkpt_B_02_03.h` in addition to
> `src/ckpt/saf/saCkpt.h`, so that user will include that new .h file for
> new definitions
>
> Is their any reson  `SaLogFilterSetCallbackT` didn't followed this ?
> How application will include this  `SaLogFilterSetCallbackT` ?
>
> -AVM
>
> On 2/21/2017 2:07 PM, A V Mahesh wrote:
>> Hi Canh,
>>
>> I can see that you are passing NULL callbacks as `` for
>> "logtest 1 10" and " logtest 1 11" by seeing
>>
>> -AVM
>>
>>
>> On 2/21/2017 1:02 PM, Canh Truong wrote:
>>> Hi Mahesh,
>>>
>>> The test case " logtest 1 10" and " logtest 1 11"  are created for version
>>> handling. In standby node, it has new code for log agent (with #2146), that
>>> means that version handling in log agent have been added.
>>> The log agent check if minor version bigger than the agent support, it will
>>> return ERROR_VERSION.  The test case is successful.
>>>
>>> In test case 11, log agent reassign for version of client is A.02.01 before
>>> sending to the initialized request to log server. So the test case is
>>> successful.
>>>
>>> The test cases for filter callback is in test suite 17. (logtest 17)
>>>
>>> Regards
>>> Canh
>>>
>>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Tuesday, February 21, 2017 2:10 PM
>>> To: Canh Van Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 0 of 3] Review Request for log: implement
>>> SaLogFilterSetCallbackT and version handling V4 [#2146]
>>>
>>> Hi  Canh,
>>>
>>> I was jut testing Agent in-service upgrade , so I have following setup and
>>> run the New FilterSetCallback test case and i was expecting case should
>>> receive fail/not-supported , but they are getting succeed how ?
>>>
>>>
>>> -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
>>> -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )
>>>
>>> SC-1# /usr/bin/logtest 1 10
>>>
>>> Suite 1: Library Life Cycle
>>>10  PASSED   saLogInitialize() with minor version is set bigger than
>>> supported version;
>>>
>>> 
>>> =
>>>
>>>Test Result:
>>>   Total:  1
>>>   Passed: 1
>>>   Failed: 0
>>>
>>> SC-1# /usr/bin/logtest 1 11
>>>
>>> Suite 1: Library Life Cycle
>>>11  PASSED   saLogInitialize() with minor version is not set;
>>>
>>> 
>>> =
>>>
>>>Test Result:
>>>   Total:  1
>>>   Passed: 1
>>>   Failed: 0
>>>
>>> -AVM
>>>
>>> On 2/16/2017 12:18 PM, Canh Van Truong wrote:
 Summary: log: implement SaLogFilterSetCallbackT and version handling
 V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
 Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es): default
 Development branch: default

 
 Impacted area   Impact y/n
 
  Docsn
  Build systemn
  RPM/packaging   n
  Configuration files n
  Startup scripts n
  SAF servicesn
  OpenSAF servicesy
  Core libraries  n
  Samples n
  Tests   n
  Other   n


 Comments (indicate scope for each "y" above):
 -
  <>

 changeset 05726400fc1a27cf50255b70bb7f952156cbe68f
 Author:Canh Van Truong 
 Date:  Mon, 21 Nov 2016 17:19:56 +0700

log: implement SaLogFilterSetCallbackT [#2146]

Implement SaLogFilterSetCallbackT which is mentioned at section
>>> 3.6.5
SaLogFilterSetCallbackT @ AIS LOG document.

LGS:
 - Whenever severity filter is changed for app and systerm
>>> streams, lgs will
find which clients that associate with the stream. Then lgs sends
>>> message
callback to clients.
 - Encoding callback message for severity filter callback

LGA:
 - Decoding callback message for severity callback from lgs and
>>> send the
message to the client which setting filter callback.
 - Dispatching severity filter callback

- Encrease version of log service to A.02.03

 changeset 

Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread A V Mahesh
Hi Canh,

The  general practice of implementing  any upcoming functionality of SAF 
specification we do define in relevant structures 
`src//saf/` file
for example `src/ckpt/saf/saCkpt_B_02_03.h` in addition to 
`src/ckpt/saf/saCkpt.h`, so that user will include that new .h file for 
new definitions

Is their any reson  `SaLogFilterSetCallbackT` didn't followed this ?
How application will include this  `SaLogFilterSetCallbackT` ?

-AVM

On 2/21/2017 2:07 PM, A V Mahesh wrote:
> Hi Canh,
>
> I can see that you are passing NULL callbacks as `` for
> "logtest 1 10" and " logtest 1 11" by seeing
>
> -AVM
>
>
> On 2/21/2017 1:02 PM, Canh Truong wrote:
>> Hi Mahesh,
>>
>> The test case " logtest 1 10" and " logtest 1 11"  are created for version
>> handling. In standby node, it has new code for log agent (with #2146), that
>> means that version handling in log agent have been added.
>> The log agent check if minor version bigger than the agent support, it will
>> return ERROR_VERSION.  The test case is successful.
>>
>> In test case 11, log agent reassign for version of client is A.02.01 before
>> sending to the initialized request to log server. So the test case is
>> successful.
>>
>> The test cases for filter callback is in test suite 17. (logtest 17)
>>
>> Regards
>> Canh
>>
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, February 21, 2017 2:10 PM
>> To: Canh Van Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 0 of 3] Review Request for log: implement
>> SaLogFilterSetCallbackT and version handling V4 [#2146]
>>
>> Hi  Canh,
>>
>> I was jut testing Agent in-service upgrade , so I have following setup and
>> run the New FilterSetCallback test case and i was expecting case should
>> receive fail/not-supported , but they are getting succeed how ?
>>
>>
>> -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
>> -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )
>>
>> SC-1# /usr/bin/logtest 1 10
>>
>> Suite 1: Library Life Cycle
>>   10  PASSED   saLogInitialize() with minor version is set bigger than
>> supported version;
>>
>> 
>> =
>>
>>   Test Result:
>>  Total:  1
>>  Passed: 1
>>  Failed: 0
>>
>> SC-1# /usr/bin/logtest 1 11
>>
>> Suite 1: Library Life Cycle
>>   11  PASSED   saLogInitialize() with minor version is not set;
>>
>> 
>> =
>>
>>   Test Result:
>>  Total:  1
>>  Passed: 1
>>  Failed: 0
>>
>> -AVM
>>
>> On 2/16/2017 12:18 PM, Canh Van Truong wrote:
>>> Summary: log: implement SaLogFilterSetCallbackT and version handling
>>> V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
>>> Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es): default
>>> Development branch: default
>>>
>>> 
>>> Impacted area   Impact y/n
>>> 
>>> Docsn
>>> Build systemn
>>> RPM/packaging   n
>>> Configuration files n
>>> Startup scripts n
>>> SAF servicesn
>>> OpenSAF servicesy
>>> Core libraries  n
>>> Samples n
>>> Tests   n
>>> Other   n
>>>
>>>
>>> Comments (indicate scope for each "y" above):
>>> -
>>> <>
>>>
>>> changeset 05726400fc1a27cf50255b70bb7f952156cbe68f
>>> Author: Canh Van Truong 
>>> Date:   Mon, 21 Nov 2016 17:19:56 +0700
>>>
>>> log: implement SaLogFilterSetCallbackT [#2146]
>>>
>>> Implement SaLogFilterSetCallbackT which is mentioned at section
>> 3.6.5
>>> SaLogFilterSetCallbackT @ AIS LOG document.
>>>
>>> LGS:
>>>  - Whenever severity filter is changed for app and systerm
>> streams, lgs will
>>> find which clients that associate with the stream. Then lgs sends
>> message
>>> callback to clients.
>>>  - Encoding callback message for severity filter callback
>>>
>>> LGA:
>>>  - Decoding callback message for severity callback from lgs and
>> send the
>>> message to the client which setting filter callback.
>>>  - Dispatching severity filter callback
>>>
>>> - Encrease version of log service to A.02.03
>>>
>>> changeset 8d41edf85334f1b14d858e2ad2f705aecf6b9a68
>>> Author: Canh Van Truong 
>>> Date:   Tue, 17 Jan 2017 14:24:33 +0700
>>>
>>> log: Add minor version checking in log server [#2146]
>>>
>>> Checking minor version and return version error if major/minor
>> version is
>>> higher than supported major/minor
>>>
>>> Add client_version to log_client_t 

[devel] FW: [PATCH 1 of 3] log: add alternative destinations of log records [#2258]

2017-02-21 Thread Canh Truong
Hi Vu,

Please see some my comments with [Canh]

Regards
Canh

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: Thursday, February 16, 2017 5:30 PM
To: lennart.l...@ericsson.com; mahesh.va...@oracle.com;
canh.v.tru...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 3] log: add alternative destinations of log records
[#2258]

 src/log/Makefile.am  |8 +-
 src/log/config/logsv_classes.xml |7 +-
 src/log/logd/lgs_config.cc   |  193 +++--
 src/log/logd/lgs_config.h|3 +-
 src/log/logd/lgs_dest.cc |  746
+++
 src/log/logd/lgs_dest.h  |  580 ++
 src/log/logd/lgs_evt.cc  |   33 +
 src/log/logd/lgs_imm.cc  |  140 ++-
 src/log/logd/lgs_mbcsv.cc|   91 -
 src/log/logd/lgs_mbcsv.h |6 +-
 src/log/logd/lgs_mbcsv_v7.cc |  177 +
 src/log/logd/lgs_mbcsv_v7.h  |   67 +++
 src/log/logd/lgs_stream.cc   |   54 ++-
 src/log/logd/lgs_stream.h|   16 +
 14 files changed, 2041 insertions(+), 80 deletions(-)


Here are major info, detailed info will be added to PR doc soon.
1) Add attribute "saLogRecordDestination" to log stream.
2) Add Local socket destintion handler
3) Integrate into first increment made by Lennart

diff --git a/src/log/Makefile.am b/src/log/Makefile.am
--- a/src/log/Makefile.am
+++ b/src/log/Makefile.am
@@ -71,9 +71,11 @@ noinst_HEADERS += \
src/log/logd/lgs_mbcsv_v2.h \
src/log/logd/lgs_mbcsv_v3.h \
src/log/logd/lgs_mbcsv_v5.h \
+   src/log/logd/lgs_mbcsv_v7.h \
src/log/logd/lgs_recov.h \
src/log/logd/lgs_stream.h \
-   src/log/logd/lgs_util.h
+   src/log/logd/lgs_util.h \
+   src/log/logd/lgs_dest.h
 
 bin_PROGRAMS += bin/saflogger
 osaf_execbin_PROGRAMS += bin/osaflogd
@@ -117,10 +119,12 @@ bin_osaflogd_SOURCES = \
src/log/logd/lgs_mbcsv_v2.cc \
src/log/logd/lgs_mbcsv_v3.cc \
src/log/logd/lgs_mbcsv_v5.cc \
+   src/log/logd/lgs_mbcsv_v7.cc \
src/log/logd/lgs_mds.cc \
src/log/logd/lgs_recov.cc \
src/log/logd/lgs_stream.cc \
-   src/log/logd/lgs_util.cc
+   src/log/logd/lgs_util.cc \
+   src/log/logd/lgs_dest.cc
 
 bin_osaflogd_LDADD = \
lib/libosaf_common.la \
diff --git a/src/log/config/logsv_classes.xml
b/src/log/config/logsv_classes.xml
--- a/src/log/config/logsv_classes.xml
+++ b/src/log/config/logsv_classes.xml
@@ -147,12 +147,13 @@
SA_CONFIG
SA_WRITABLE

-   
+   
saLogRecordDestination
-   SA_UINT32_T
+   SA_STRING_T
SA_CONFIG
SA_WRITABLE
-SA_MULTI_VALUE
+   SA_MULTI_VALUE
+   SA_NO_DUPLICATES


saLogStreamCreationTimestamp
diff --git a/src/log/logd/lgs_config.cc b/src/log/logd/lgs_config.cc
--- a/src/log/logd/lgs_config.cc
+++ b/src/log/logd/lgs_config.cc
@@ -40,6 +40,7 @@
 #include "osaf/immutil/immutil.h"
 #include "log/logd/lgs_file.h"
 #include "log/logd/lgs.h"
+#include "log/logd/lgs_dest.h"
 
 static SaVersionT immVersion = { 'A', 2, 11 };
 
@@ -117,10 +118,6 @@ typedef struct _lgs_conf_t {
   std::vector logRecordDestinationConfiguration; // Default
empty
   /* --- end correspond to IMM Class --- */
 
-  /* --- Used with OpenSafLogCurrentConfig runtime object only --- */
-  /* Note: Has no cnfflag */
-  std::vector logRecordDestinationStatus; // Default empty
-
   /* Used for checkpointing time when files are closed */
   time_t chkp_file_close_time;
 
@@ -254,6 +251,9 @@ void lgs_cfgupd_multival_add(const std::
  const std::vector& value_list,
  lgs_config_chg_t *config_data) {
   TRACE_ENTER();
+
+  CfgDestination(value_list, ModifyType::kAdd);
+
   // Get the existing multi-values and add them to the config data list
   lgs_logconfGet_t param_id = param_name_to_id(attribute_name);
   const std::vector *exist_list =
@@ -294,6 +294,9 @@ void lgs_cfgupd_multival_delete(std::str
 std::vector value_list,
 lgs_config_chg_t *config_data) {
   TRACE_ENTER();
+
+  CfgDestination(value_list, ModifyType::kDelete);
+
   // Get the existing multi-values
   lgs_logconfGet_t param_id = param_name_to_id(attribute_name);
   const std::vector *exist_list =
@@ -325,6 +328,9 @@ void lgs_cfgupd_mutival_replace(std::str
 std::vector value_list,
 lgs_config_chg_t *config_data) {
   TRACE_ENTER();
+
+  CfgDestination(value_list, ModifyType::kReplace);
+
   // Add given value-list to the config data list
   for (auto& value : value_list) {

Re: [devel] [PATCH 0 of 3] Review Request for log: implement SaLogFilterSetCallbackT and version handling V4 [#2146]

2017-02-21 Thread A V Mahesh
Hi Canh,

I can see that you are passing NULL callbacks as `` for 
"logtest 1 10" and " logtest 1 11" by seeing

-AVM


On 2/21/2017 1:02 PM, Canh Truong wrote:
> Hi Mahesh,
>
> The test case " logtest 1 10" and " logtest 1 11"  are created for version
> handling. In standby node, it has new code for log agent (with #2146), that
> means that version handling in log agent have been added.
> The log agent check if minor version bigger than the agent support, it will
> return ERROR_VERSION.  The test case is successful.
>
> In test case 11, log agent reassign for version of client is A.02.01 before
> sending to the initialized request to log server. So the test case is
> successful.
>
> The test cases for filter callback is in test suite 17. (logtest 17)
>
> Regards
> Canh
>
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Tuesday, February 21, 2017 2:10 PM
> To: Canh Van Truong; lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 0 of 3] Review Request for log: implement
> SaLogFilterSetCallbackT and version handling V4 [#2146]
>
> Hi  Canh,
>
> I was jut testing Agent in-service upgrade , so I have following setup and
> run the New FilterSetCallback test case and i was expecting case should
> receive fail/not-supported , but they are getting succeed how ?
>
>
> -SC-2  ACTIVE  Old Node ( LOG is old code with out #2146 patch )
> -SC-1  STANDBY  New Node ( LOG is new code with #2146 patch )
>
> SC-1# /usr/bin/logtest 1 10
>
> Suite 1: Library Life Cycle
>  10  PASSED   saLogInitialize() with minor version is set bigger than
> supported version;
>
> 
> =
>
>  Test Result:
> Total:  1
> Passed: 1
> Failed: 0
>
> SC-1# /usr/bin/logtest 1 11
>
> Suite 1: Library Life Cycle
>  11  PASSED   saLogInitialize() with minor version is not set;
>
> 
> =
>
>  Test Result:
> Total:  1
> Passed: 1
> Failed: 0
>
> -AVM
>
> On 2/16/2017 12:18 PM, Canh Van Truong wrote:
>> Summary: log: implement SaLogFilterSetCallbackT and version handling
>> V4 [#2146] Review request for Trac Ticket(s): #2146 Peer Reviewer(s):
>> Lennart, Vu, Mahesh Pull request to: Vu Affected branch(es): default
>> Development branch: default
>>
>> 
>> Impacted area   Impact y/n
>> 
>>Docsn
>>Build systemn
>>RPM/packaging   n
>>Configuration files n
>>Startup scripts n
>>SAF servicesn
>>OpenSAF servicesy
>>Core libraries  n
>>Samples n
>>Tests   n
>>Other   n
>>
>>
>> Comments (indicate scope for each "y" above):
>> -
>><>
>>
>> changeset 05726400fc1a27cf50255b70bb7f952156cbe68f
>> Author:  Canh Van Truong 
>> Date:Mon, 21 Nov 2016 17:19:56 +0700
>>
>>  log: implement SaLogFilterSetCallbackT [#2146]
>>
>>  Implement SaLogFilterSetCallbackT which is mentioned at section
> 3.6.5
>>  SaLogFilterSetCallbackT @ AIS LOG document.
>>
>>  LGS:
>>   - Whenever severity filter is changed for app and systerm
> streams, lgs will
>>  find which clients that associate with the stream. Then lgs sends
> message
>>  callback to clients.
>>   - Encoding callback message for severity filter callback
>>
>>  LGA:
>>   - Decoding callback message for severity callback from lgs and
> send the
>>  message to the client which setting filter callback.
>>   - Dispatching severity filter callback
>>
>>  - Encrease version of log service to A.02.03
>>
>> changeset 8d41edf85334f1b14d858e2ad2f705aecf6b9a68
>> Author:  Canh Van Truong 
>> Date:Tue, 17 Jan 2017 14:24:33 +0700
>>
>>  log: Add minor version checking in log server [#2146]
>>
>>  Checking minor version and return version error if major/minor
> version is
>>  higher than supported major/minor
>>
>>  Add client_version to log_client_t and checkpoint struct in lgs
>>
>>  Increase checkpoint version and checkpoint client_ver to stand by
>>
>>  Only send filter callback to client that initialized with minor
>> version > 3
>>
>> changeset ff130149eb45136a50563878431a92b52e024997
>> Author:  Canh Van Truong 
>> Date:Tue, 17 Jan 2017 15:42:40 +0700
>>
>>  log: fix checking version in log agent [#2146]
>>
>>  Fix checking version in log agent
>>
>>  The agent report highest supported version except getting
> ERR_VERSION from
>>  server. if agent get ERR_VERSION, it will set supported