Re: [devel] [PATCH 1 of 1] imported patch 1967_fix_headless_error_cppcheck.patch

2016-08-24 Thread A V Mahesh
ACK not tested

-AVM

On 8/25/2016 10:06 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Logic of this part is complicated so I modified it wrong.
> This time I correct it, not a roll back.
> That part is subsequence of if clause above.
>
> Sincerely,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Thursday, August 25, 2016 11:21 AM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] imported patch
> 1967_fix_headless_error_cppcheck.patch
>
> Hi Hoang,
>
> Is this rollback of  `ckpt: fix cppcheck warning [#1874]` ?
>
> ===
>
> @@ -4766,6 +4758,13 @@ static uint32_t cpnd_transfer_replica(CP
> total_num++;
>   tmp_sec_info =
> cpnd_ckpt_sec_get_next(_node->replica_info, tmp_sec_info);
> +if (tmp_sec_info == NULL) {
> +rc = NCSCC_RC_FAILURE;
> +TRACE_4("cpnd ckpt memory get next allocation failed");
> +send_evt.info.cpnd.info.ckpt_nd2nd_sync.data = sec_data;
> +
> cpnd_proc_free_cpsv_ckpt_data(send_evt.info.cpnd.info.ckpt_nd2nd_sync.data);
> +return rc;
> +}
> }
>
> ===
>
> -AVM
>
> On 8/24/2016 7:06 PM, Hoang Vo wrote:
>>osaf/services/saf/cpsv/cpd/cpd_proc.c  |   4 ++--
>>osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 ++-
>>2 files changed, 4 insertions(+), 11 deletions(-)
>>
>>
>> diff --git a/osaf/services/saf/cpsv/cpd/cpd_proc.c
>> b/osaf/services/saf/cpsv/cpd/cpd_proc.c
>> --- a/osaf/services/saf/cpsv/cpd/cpd_proc.c
>> +++ b/osaf/services/saf/cpsv/cpd/cpd_proc.c
>> @@ -1142,7 +1142,7 @@ void cpd_cb_dump(void)
>>
>>
> TRACE("--");
>>  TRACE(" CKPT ID:  = %d",
> (uint32_t)ckpt_node->ckpt_id);
>> -TRACE(" CKPT Name len  = %lu",
> strlen(ckpt_node->ckpt_name));
>> +TRACE(" CKPT Name len  = %zu",
> strlen(ckpt_node->ckpt_name));
>>  TRACE(" CKPT Name: %s",
> ckpt_node->ckpt_name);
>>
>>  TRACE(" UNLINK = %d, Active Exists = %d",
>> ckpt_node->is_unlink_set, @@ -1196,7 +1196,7 @@ void cpd_cb_dump(void)
>>  name = ckpt_map_node->ckpt_name;
>>
>>
> TRACE("--");
>> -TRACE(" CKPT Name len  = %lu",
> strlen(name));
>> +TRACE(" CKPT Name len  = %zu",
> strlen(name));
>>  TRACE(" CKPT Name: %s", name);
>>
>>  TRACE(" CKPT ID:  = %d",
> (uint32_t)ckpt_map_node->ckpt_id);
>> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> @@ -4700,8 +4700,8 @@ static uint32_t cpnd_transfer_replica(CP
>>
>>  while (1) {
>>
>> -if (((size + tmp_sec_info->sec_size) >
> MAX_SYNC_TRANSFER_SIZE)
>> -|| (total_num == cp_node->replica_info.n_secs)) {
>> +if ((total_num == cp_node->replica_info.n_secs) ||
>> +((size + tmp_sec_info->sec_size) > MAX_SYNC_TRANSFER_SIZE))
> {
>>
>>  send_evt.info.cpnd.info.ckpt_nd2nd_sync.num_of_elmts
> = num;
>>  send_evt.info.cpnd.info.ckpt_nd2nd_sync.data =
> sec_data; @@
>> -4758,13 +4758,6 @@ static uint32_t cpnd_transfer_replica(CP
>>  total_num++;
>>
>>  tmp_sec_info =
> cpnd_ckpt_sec_get_next(_node->replica_info, tmp_sec_info);
>> -if (tmp_sec_info == NULL) {
>> -rc = NCSCC_RC_FAILURE;
>> -TRACE_4("cpnd ckpt memory get next allocation
> failed");
>> -send_evt.info.cpnd.info.ckpt_nd2nd_sync.data =
> sec_data;
>> -
> cpnd_proc_free_cpsv_ckpt_data(send_evt.info.cpnd.info.ckpt_nd2nd_sync.data);
>> -return rc;
>> -}
>>  }
>>
>>  TRACE_LEAVE();
>


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


Re: [devel] Review Request for log: update OpenSAF_LOG_PR for long DN [#1898]

2016-08-24 Thread A V Mahesh
ACK

-AVM


On 8/25/2016 8:08 AM, Vu Minh Nguyen wrote:
>
> Hi Mahesh,
>
> Any comments on the PR?
>
> Regards, Vu
>
> *From:* Lennart Lund [mailto:lennart.l...@ericsson.com]
> *Sent:* Wednesday, August 17, 2016 5:50 PM
> *To:* Vu Minh Nguyen ; mahesh.va...@oracle.com
> *Cc:* opensaf-devel@lists.sourceforge.net
> *Subject:* RE: [devel] Review Request for log: update OpenSAF_LOG_PR 
> for long DN [#1898]
>
> Hi Vu
>
> Ack with some minor comments. See attached document. To see comments, 
> switch on “Show Changes” in Edit->Show Changes
>
> Thanks
>
> Lennart
>
> *From:* Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> *Sent:* den 15 augusti 2016 13:43
> *To:* Lennart Lund  >; mahesh.va...@oracle.com 
> 
> *Cc:* opensaf-devel@lists.sourceforge.net 
> 
> *Subject:* [devel] Review Request for log: update OpenSAF_LOG_PR for 
> long DN [#1898]
>
> Summary: log: improve test cases for log service [#1898]
>
> Review request for Trac Ticket(s): #1898
>
> Peer Reviewer(s): Mahesh, Lennart
>
> Pull request to: <>
>
> Affected branch(es): default
>
> Development branch: default
>
> 
>
> Impacted area   Impact y/n
>
> 
>
> Docsy
>
> Build systemn
>
> RPM/packaging   n
>
> Configuration files n
>
> Startup scripts n
>
> SAF servicesn
>
> OpenSAF servicesn
>
> Core libraries  n
>
> Samples n
>
> Tests   n
>
> Other   n
>
> Comments (indicate scope for each "y" above):
>
> -
>
> <>
>
> 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.
>
> ___ 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.
>


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


Re: [devel] [PATCH 1 of 1] imported patch 1967_fix_headless_error_cppcheck.patch

2016-08-24 Thread A V Mahesh
Hi Hoang,

Is this rollback of  `ckpt: fix cppcheck warning [#1874]` ?

===

@@ -4766,6 +4758,13 @@ static uint32_t cpnd_transfer_replica(CP
   total_num++;
 tmp_sec_info = 
cpnd_ckpt_sec_get_next(_node->replica_info, tmp_sec_info);
+if (tmp_sec_info == NULL) {
+rc = NCSCC_RC_FAILURE;
+TRACE_4("cpnd ckpt memory get next allocation failed");
+send_evt.info.cpnd.info.ckpt_nd2nd_sync.data = sec_data;
+ 
cpnd_proc_free_cpsv_ckpt_data(send_evt.info.cpnd.info.ckpt_nd2nd_sync.data);
+return rc;
+}
   }

===

-AVM

On 8/24/2016 7:06 PM, Hoang Vo wrote:
>   osaf/services/saf/cpsv/cpd/cpd_proc.c  |   4 ++--
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 ++-
>   2 files changed, 4 insertions(+), 11 deletions(-)
>
>
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_proc.c 
> b/osaf/services/saf/cpsv/cpd/cpd_proc.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_proc.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_proc.c
> @@ -1142,7 +1142,7 @@ void cpd_cb_dump(void)
>   
>   
> TRACE("--");
>   TRACE(" CKPT ID:  = %d", 
> (uint32_t)ckpt_node->ckpt_id);
> - TRACE(" CKPT Name len  = %lu", 
> strlen(ckpt_node->ckpt_name));
> + TRACE(" CKPT Name len  = %zu", 
> strlen(ckpt_node->ckpt_name));
>   TRACE(" CKPT Name: %s", ckpt_node->ckpt_name);
>   
>   TRACE(" UNLINK = %d, Active Exists = %d", 
> ckpt_node->is_unlink_set,
> @@ -1196,7 +1196,7 @@ void cpd_cb_dump(void)
>   name = ckpt_map_node->ckpt_name;
>   
>   
> TRACE("--");
> - TRACE(" CKPT Name len  = %lu", strlen(name));
> + TRACE(" CKPT Name len  = %zu", strlen(name));
>   TRACE(" CKPT Name: %s", name);
>   
>   TRACE(" CKPT ID:  = %d", 
> (uint32_t)ckpt_map_node->ckpt_id);
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> @@ -4700,8 +4700,8 @@ static uint32_t cpnd_transfer_replica(CP
>   
>   while (1) {
>   
> - if (((size + tmp_sec_info->sec_size) > MAX_SYNC_TRANSFER_SIZE)
> - || (total_num == cp_node->replica_info.n_secs)) {
> + if ((total_num == cp_node->replica_info.n_secs) ||
> + ((size + tmp_sec_info->sec_size) > MAX_SYNC_TRANSFER_SIZE)) {
>   
>   send_evt.info.cpnd.info.ckpt_nd2nd_sync.num_of_elmts = 
> num;
>   send_evt.info.cpnd.info.ckpt_nd2nd_sync.data = sec_data;
> @@ -4758,13 +4758,6 @@ static uint32_t cpnd_transfer_replica(CP
>   total_num++;
>   
>   tmp_sec_info = cpnd_ckpt_sec_get_next(_node->replica_info, 
> tmp_sec_info);
> - if (tmp_sec_info == NULL) {
> - rc = NCSCC_RC_FAILURE;
> - TRACE_4("cpnd ckpt memory get next allocation failed");
> - send_evt.info.cpnd.info.ckpt_nd2nd_sync.data = sec_data;
> - 
> cpnd_proc_free_cpsv_ckpt_data(send_evt.info.cpnd.info.ckpt_nd2nd_sync.data);
> - return rc;
> - }
>   }
>   
>   TRACE_LEAVE();


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


Re: [devel] [PATCH 1 of 1] dtm: Fix cppcheck warnings [#1963]

2016-08-24 Thread A V Mahesh
Hi Anders Widell,

ACK Reviewed & tested IPv4 & IPv6

-AVM

On 8/23/2016 3:34 PM, Anders Widell wrote:
>   osaf/services/infrastructure/dtms/dtm/dtm_inter_svc.c|5 +-
>   osaf/services/infrastructure/dtms/dtm/dtm_intra.c|   10 +-
>   osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c|   18 +-
>   osaf/services/infrastructure/dtms/dtm/dtm_main.c |   18 -
>   osaf/services/infrastructure/dtms/dtm/dtm_node.c |   96 --
>   osaf/services/infrastructure/dtms/dtm/dtm_node_db.c  |   94 -
>   osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c |  236 
> +--
>   osaf/services/infrastructure/dtms/dtm/dtm_read_config.c  |   41 +-
>   osaf/services/infrastructure/dtms/include/dtm.h  |3 -
>   osaf/services/infrastructure/dtms/include/dtm_cb.h   |2 +-
>   osaf/services/infrastructure/dtms/include/dtm_node.h |2 -
>   11 files changed, 49 insertions(+), 476 deletions(-)
>
>
> The following warnings, reported by cppcheck version 1.75, have been fixed:
>
> [osaf/services/infrastructure/dtms/dtm/dtm_inter_svc.c:342]: (style) The 
> scope of the variable 'buffer' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra.c:95]: (style) The scope of 
> the variable 'servlen' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra.c:97]: (style) The scope of 
> the variable 'server_ux_name' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra.c:155]: (style) Obsolescent 
> function 'bzero' called. It is recommended to use 'memset' instead.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra.c:207]: (error) 
> Uninitialized variable: serveraddr
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:139]: (style) The 
> scope of the variable 'del_ptr' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:243]: (style) The 
> scope of the variable 'tmp' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:1836]: (style) The 
> scope of the variable 'local_svc_node' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:710]: (style) Variable 
> 'node_id' is assigned a value that is never used.
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:320]: (error) Memory 
> leak: svc_node
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:512]: (error) Memory 
> leak: subscr_node
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:516]: (error) Memory 
> leak: subscr_info
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:1728]: (error) Memory 
> leak: svc_info
> [osaf/services/infrastructure/dtms/dtm/dtm_intra_svc.c:1754]: (error) Memory 
> leak: local_svc_info
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:54]: (style) 
> Assignment of function parameter has no effect outside the function.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:74]: (style) The 
> scope of the variable 'optlen' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:423]: (style) The 
> scope of the variable 'err' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:617]: (style) The 
> scope of the variable 'ip_addr_eth' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:720]: (style) The 
> scope of the variable 'mcast_addr_eth' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:812]: (style) The 
> scope of the variable 'mcast_addr_eth' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:1428]: (style) The 
> scope of the variable 'numericAddress' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:1429]: (style) The 
> scope of the variable 'addrBuffer' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:191]: (error) 
> Uninitialized variable: join_request
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:192]: (error) 
> Uninitialized variable: join_request
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:950]: (error) 
> Uninitialized variable: addr_list
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:1014]: (error) 
> Uninitialized variable: maddr
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:1015]: (error) 
> Uninitialized variable: maddr
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:1144]: (error) 
> Uninitialized variable: maddr
> [osaf/services/infrastructure/dtms/dtm/dtm_node_sockets.c:1145]: (error) 
> Uninitialized variable: maddr
> [osaf/services/infrastructure/dtms/dtm/dtm_read_config.c:139]: (style) The 
> scope of the variable 'tmp' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_read_config.c:140]: (style) The 
> scope of the variable 'buf' can be reduced.
> [osaf/services/infrastructure/dtms/dtm/dtm_read_config.c:271]: (warning) 
> fscanf() without field width limits can crash with huge input data.
> [osaf/services/infrastructure/dtms/dtm/dtm_read_config.c:327]: (error) 
> 

Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams [#1941]

2016-08-23 Thread A V Mahesh
Hi Vu,

ACK,   Add TRACE`s  in error return cases

-AVM


On 8/23/2016 3:29 PM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> Seems "/var/log/opensaf/saflog" not shared folder?
>
> To check that, create something (e.g: a file ) in that folder, and check
> whether that file
> can be seen by all nodes.
>
> To pass the test, the log folder has to be seen by all nodes.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, August 23, 2016 4:04 PM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'Lennart Lund'
>> <lennart.l...@ericsson.com>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams
>> [#1941]
>>
>> Hi Vu,
>>
>> In case logRootDirectory   is /var/log/opensaf/saflog ,
>> and it is available , still getting problem.
>>
>> **
>> **
>> PL-3:/var/log/opensaf/saflog # /usr/bin/logtest -e 9
>>
>> Suite 9: LOG Server down / up
>>   ;
>> Preparing 8 streams for test. Please wait...
>> Preparing stream 0
>> ...
>> Preparing stream 1
>> ...
>> cur_logfile_name_get scandir Fail No such file or
>> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
>>   2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE
>> (1))PL-3:/var/log/opensaf/saflog # /usr/bin/logtest -e 9
>>
>> Suite 9: LOG Server down / up
>>   ;
>> Preparing 8 streams for test. Please wait...
>> Preparing stream 0
>> ...
>> Preparing stream 1
>> ...
>> cur_logfile_name_get scandir Fail No such file or
>> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
>>   2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE
>> (1))PL-3:/var/log/opensaf/saflog # pwd
>> /var/log/opensaf/saflog
>> PL-3:/var/log/opensaf/saflog # ls
>> PL-3:/var/log/opensaf/saflog # immlist logConfig=1,safApp=safLogService
>> Name   Type Value(s)
>> ==
>> ==
>> logStreamSystemLowLimitSA_UINT32_T  0 (0x0)
>> logStreamSystemHighLimit   SA_UINT32_T  0 (0x0)
>> logStreamFileFormatSA_STRING_T 
>> logStreamAppLowLimit   SA_UINT32_T  0 (0x0)
>> logStreamAppHighLimit  SA_UINT32_T  0 (0x0)
>> logRootDirectory   SA_STRING_T
>> /var/log/opensaf/saflog
>> logMaxLogrecsize   SA_UINT32_T  1024
> (0x400)
>> logMaxApplicationStreams   SA_UINT32_T  64 (0x40)
>> logFileSysConfig   SA_UINT32_T  1 (0x1)
>> logFileIoTimeout   SA_UINT32_T  500
> (0x1f4)
>> logDataGroupname   SA_STRING_T 
>> logConfig  SA_STRING_T logConfig=1
>> SaImmAttrImplementerName   SA_STRING_T
>> safLogService
>> SaImmAttrClassName SA_STRING_T
>> OpenSafLogConfig
>> SaImmAttrAdminOwnerNameSA_STRING_T IMMLOADER
>> **
>> **
>>
>>
>> -AVM
>>
>> On 8/23/2016 12:50 PM, Vu Minh Nguyen wrote:
>>> Hi Mahesh,
>>>
>>> The folder "/repl_opensaf/saflog/logtest_sc_down_path/" is on UML
>> container.
>>> I guess, on your system, the path is different.
>>>
>>> To get the correct patch to shared log folder, do following:
>>>
>>> 1) Get the log root folder:
>>> # immlist logConfig=1,safApp=safLogService
>>> Name   Type Value(s)
>>>
>> ==
>> ==
>>> logRootDirectory   SA_STRING_T
>>> /repl_opensaf/saflog
>>>
>>>
>>> 2) On PL, check if the node can access to shared folder:
>>> /logtest_sc_down_path
>>>
>>>
>>> Regards, Vu
>>>
>>>> -Original Message-
>>>> Fro

Re: [devel] [PATCH 1 of 1] MDS: Log TIPC dropped messages [#1957]

2016-08-23 Thread A V Mahesh
Hi HansN,

It seems I am missing some thing , please allow me to under stand

If I currently understand you observation :

With current Opensaf code ( this #1957 patch NOT applied ) , by default  
TIPC_DROPPABLE=true ,while running Opensaf with that binary
when TIPC_ERR_OVERLOAD  occurring, TIPC is not  given errors 
TIPC_ERRINFO or  TIPC_RETDATA and following code is not being get hit
of function recvfrom_connectionless(), is my  understanding right ?

=

*if (anc->cmsg_type == TIPC_ERRINFO) {*
 /* TIPC_ERRINFO - TIPC error code associated with a returned data 
message or a connection termination message  so abort */
 m_MDS_LOG_CRITICAL("MDTM: undelivered message condition ancillary 
data: TIPC_ERRINFO abort err :%s", strerror(errno) );
*abort();*
*} else if (anc->cmsg_type == TIPC_RETDATA) {*
 /* If we set TIPC_DEST_DROPPABLE off messge (configure TIPC to 
return rejected messages to the sender )
we will hit this when we implement MDS retransmit lost messages  
abort can be replaced with flow control logic*/
 for (i = anc->cmsg_len - sizeof(*anc); i > 0; i--) {
 m_MDS_LOG_DBG("MDTM: returned byte 0x%02x\n", *cptr);
 cptr++;
 }
 /* TIPC_RETDATA -The contents of a returned data message  so abort */
 m_MDS_LOG_CRITICAL("MDTM: undelivered message condition ancillary 
data: TIPC_RETDATA abort err :%s", strerror(errno) );
*abort();*
}

=

-AVM


On 8/23/2016 1:08 PM, Hans Nordebäck wrote:
> Hi Mahesh,
>
> Please see response below with [HansN]
> /Thanks HansN
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: den 23 augusti 2016 08:25
> To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Anders Widell 
> <anders.wid...@ericsson.com>; mathi.naic...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] MDS: Log TIPC dropped messages [#1957]
>
> Hi HansN
>
> Please see response below with [AVM]
>
> -AVM
>
> On 8/23/2016 11:41 AM, Hans Nordebäck wrote:
>> Hi Mahesh,
>>
>> please see comments below.
>>
>> /Thanks HansN
>>
>>
>> On 08/23/2016 07:21 AM, A V Mahesh wrote:
>>> Hi HansN,
>>>
>>> Let us fist discuss the error handling and abort, then we can come
>>> back to interpretation of  TIPC currently  does permit  OR does not
>>> permit an application to send a multicast message with the
>>> "destination droppable" setting disabled.
>>>
>>> Let us disable TIPC_DEST_DROPPABLE, so that  TIPC will try to return
>>> an undelivered multicast message to its sender and we can  determine
>>> issue is  because of TIPC_ERR_OVERLOAD, this helps in debugging , so
>>> that application may increased SO_SNDBUF/SO_RCVBUF to reduce the
>>> problem.
>>>
>>> But still we need to abort(), the reason for that is current MDS
>>> implementations doesn't have flow control logic ( no retry because of
>>> error ) , so Application like AMF can go wrong and cluster will go
>>> into unstable/recoverble state.
>>>
>> [HansN] In the current implementation messages are dropped silently
>> and no abort is done.
> [AVM]  I can see  abort(); in current code , you mean abort(); is not working 
> and application(amf) is not existing ?
> [HansN] In case of TIPC_DROPPABLE=true and messages are dropped, 
> (TIPC_ERR_OVERLOAD)  no abort is be performed, e.g
> amfd detects this in the msg sanity chk and logs "invalid msg id ..."
> 
> if (anc->cmsg_type == TIPC_ERRINFO) {
>   /* TIPC_ERRINFO - TIPC error code associated with a returned data 
> message or a connection termination message  so abort */
>   m_MDS_LOG_CRITICAL("MDTM: undelivered message condition ancillary
> data: TIPC_ERRINFO abort err :%s", strerror(errno) );
> *abort();*
> } else if (anc->cmsg_type == TIPC_RETDATA) {
>   /* If we set TIPC_DEST_DROPPABLE off messge (configure TIPC to return 
> rejected messages to the sender )
>  we will hit this when we implement MDS retransmit lost messages 
> abort can be replaced with flow control logic*/
>   for (i = anc->cmsg_len - sizeof(*anc); i > 0; i--) {
>   m_MDS_LOG_DBG("MDTM: returned byte 0x%02x\n", *cptr);
>   cptr++;
>   }
>   /* TIPC_RETDATA -The contents of a returned data message  so abort */
>   m_MDS_LOG_CRITICAL("MDTM: undeliver

Re: [devel] [PATCH 1 of 1] ckpt: fix cppcheck warning [#1874] v2

2016-08-23 Thread A V Mahesh
ACK

-AVM


On 8/23/2016 2:11 PM, Hoang Vo wrote:
>   osaf/services/saf/cpsv/cpd/cpd_db.c |   8 ++---
>   osaf/services/saf/cpsv/cpd/cpd_evt.c|   4 +-
>   osaf/services/saf/cpsv/cpd/cpd_imm.c|   2 +-
>   osaf/services/saf/cpsv/cpd/cpd_tmr.c|   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  49 
> 
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   2 +-
>   6 files changed, 32 insertions(+), 35 deletions(-)
>
>
> This enhancement fix following warning results from cppcheck 1.74:
> Either the condition is redundant or there is possible null pointer 
> dereference
>
> This enhancement does not fix following warnings when they are not problems:
> Possible null pointer dereference
> Style and performance warnings
>
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_db.c 
> b/osaf/services/saf/cpsv/cpd/cpd_db.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_db.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_db.c
> @@ -842,12 +842,10 @@ uint32_t cpd_cpnd_info_node_delete(CPD_C
>   }
>   
>   /* Free the Client Node */
> - if (cpnd_info_node) {
> - if (cpnd_info_node->cpnd_ret_timer.uarg)
> - ncshm_destroy_hdl(NCS_SERVICE_ID_CPD, 
> cpnd_info_node->cpnd_ret_timer.uarg);
> + if (cpnd_info_node->cpnd_ret_timer.uarg)
> + ncshm_destroy_hdl(NCS_SERVICE_ID_CPD, 
> cpnd_info_node->cpnd_ret_timer.uarg);
>   
> - m_MMGR_FREE_CPD_CPND_INFO_NODE(cpnd_info_node);
> - }
> + m_MMGR_FREE_CPD_CPND_INFO_NODE(cpnd_info_node);
>   
>   return rc;
>   
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
> b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> @@ -1434,7 +1434,7 @@ static uint32_t cpd_evt_proc_mds_evt(CPD
>   /* No Checkpoints on this node, */
>   TRACE_LEAVE();
>   return NCSCC_RC_SUCCESS;
> - } else if (node_info && 
> (node_info->ckpt_ref_list == NULL)) {
> + } else if (node_info->ckpt_ref_list == NULL) {
>   cpd_cpnd_info_node_delete(cb, 
> node_info);
>   TRACE_LEAVE();
>   return NCSCC_RC_SUCCESS;
> @@ -1448,7 +1448,7 @@ static uint32_t cpd_evt_proc_mds_evt(CPD
>   /* No Checkpoints on this node, */
>   return NCSCC_RC_SUCCESS;
>   }
> - else if (node_info && (node_info->ckpt_ref_list 
> == NULL)) {
> + else if (node_info->ckpt_ref_list == NULL) {
>   cpd_cpnd_info_node_delete(cb, 
> node_info);
>   TRACE_LEAVE();
>   return NCSCC_RC_SUCCESS;
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_imm.c 
> b/osaf/services/saf/cpsv/cpd/cpd_imm.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_imm.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_imm.c
> @@ -1014,7 +1014,7 @@ SaUint32T cpd_get_scAbsenceAllowed_attr(
>   
>   /* Handle the global scAbsenceAllowed_flag */
>   attribute = attributes[0];
> - TRACE("%s attrName \"%s\"",__FUNCTION__,attribute->attrName);
> + TRACE("%s attrName 
> \"%s\"",__FUNCTION__,attribute?attribute->attrName:"");
>   if ((attribute != NULL) && (attribute->attrValuesNumber != 0)) {
>   /* scAbsenceAllowed has value. Get the value */
>   value = attribute->attrValues[0];
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_tmr.c 
> b/osaf/services/saf/cpsv/cpd/cpd_tmr.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_tmr.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_tmr.c
> @@ -42,7 +42,7 @@ void cpd_timer_expiry(NCSCONTEXT uarg)
>   CPSV_EVT *evt = NULL;
>   uint32_t cpd_hdl = m_CPD_GET_CB_HDL;
>   
> - TRACE("cpd_timer_expiry(uarg=%p, type=%u)", uarg, tmr->type);
> + TRACE("cpd_timer_expiry(uarg=%p, type=%u)", uarg, tmr ? tmr->type : 0);
>   
>   /* post a message to the corresponding component */
>   if ((cb = (CPD_CB *)ncshm_take_hdl(NCS_SERVICE_ID_CPD, cpd_hdl)) == 
> NULL)
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> @@ -759,7 +759,7 @@ static uint32_t cpnd_evt_proc_ckpt_open(
>   send_evt.info.cpa.info.openRsp.error = SA_AIS_ERR_NO_MEMORY;
>   goto agent_rsp;
>   }
> - if (out_evt && out_evt->info.cpnd.info.ckpt_info.error != SA_AIS_OK) {
> + if (out_evt->info.cpnd.info.ckpt_info.error != SA_AIS_OK) {
>   send_evt.info.cpa.info.openRsp.error = 
> out_evt->info.cpnd.info.ckpt_info.error;
>   goto agent_rsp;
>   }
> @@ -872,10 +872,8 @@ 

Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams [#1941]

2016-08-23 Thread A V Mahesh
Hi Vu,

In case logRootDirectory   is /var/log/opensaf/saflog ,
and it is available , still getting problem.


PL-3:/var/log/opensaf/saflog # /usr/bin/logtest -e 9

Suite 9: LOG Server down / up
 ;
Preparing 8 streams for test. Please wait...
Preparing stream 0
...
Preparing stream 1
...
cur_logfile_name_get scandir Fail No such file or 
directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
 2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE 
(1))PL-3:/var/log/opensaf/saflog # /usr/bin/logtest -e 9

Suite 9: LOG Server down / up
 ;
Preparing 8 streams for test. Please wait...
Preparing stream 0
...
Preparing stream 1
...
cur_logfile_name_get scandir Fail No such file or 
directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
 2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE 
(1))PL-3:/var/log/opensaf/saflog # pwd
/var/log/opensaf/saflog
PL-3:/var/log/opensaf/saflog # ls
PL-3:/var/log/opensaf/saflog # immlist logConfig=1,safApp=safLogService
Name   Type Value(s)

logStreamSystemLowLimitSA_UINT32_T  0 (0x0)
logStreamSystemHighLimit   SA_UINT32_T  0 (0x0)
logStreamFileFormatSA_STRING_T 
logStreamAppLowLimit   SA_UINT32_T  0 (0x0)
logStreamAppHighLimit  SA_UINT32_T  0 (0x0)
logRootDirectory   SA_STRING_T 
/var/log/opensaf/saflog
logMaxLogrecsize   SA_UINT32_T  1024 (0x400)
logMaxApplicationStreams   SA_UINT32_T  64 (0x40)
logFileSysConfig   SA_UINT32_T  1 (0x1)
logFileIoTimeout   SA_UINT32_T  500 (0x1f4)
logDataGroupname   SA_STRING_T 
logConfig  SA_STRING_T logConfig=1
SaImmAttrImplementerName   SA_STRING_T 
safLogService
SaImmAttrClassName SA_STRING_T 
OpenSafLogConfig
SaImmAttrAdminOwnerNameSA_STRING_T IMMLOADER

 


-AVM

On 8/23/2016 12:50 PM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> The folder "/repl_opensaf/saflog/logtest_sc_down_path/" is on UML container.
> I guess, on your system, the path is different.
>
> To get the correct patch to shared log folder, do following:
>
> 1) Get the log root folder:
> # immlist logConfig=1,safApp=safLogService
> Name   Type Value(s)
> 
> logRootDirectory   SA_STRING_T
> /repl_opensaf/saflog
>
>
> 2) On PL, check if the node can access to shared folder:
> /logtest_sc_down_path
>
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, August 23, 2016 1:59 PM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'Lennart Lund'
>> <lennart.l...@ericsson.com>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams
>> [#1941]
>>
>> Hi Vu,
>>
>> This folder doesn't exist , i just created on PL-3 , still failing
>>
>> PL-3:~ # mkdir -p /repl_opensaf/saflog/logtest_sc_down_path/
>> PL-3:~ #
>>
>> PL-3:~ # /usr/bin/logtest -e 9
>>
>> Suite 9: LOG Server down / up
>>   ;
>> Preparing 8 streams for test. Please wait...
>> Preparing stream 0
>> ...
>> Preparing stream 1
>> ...
>> cur_logfile_name_get scandir Fail No such file or
>> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
>>   2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE (1))PL-3:~ #
>>
>> -AVM
>>
>>
>> On 8/23/2016 12:21 PM, Vu Minh Nguyen wrote:
>>> Hi Mahesh,
>>>
>>> Can you check if PL node can access the shared log folder?
>>>
>>> E.g: path on UML test
>>> /repl_opensaf/saflog/logtest_sc_down_path/
>>>
>>> I guess the problem is caused by PL not able to access the SAF log
> folder.
>>> Regards, Vu
>>>
>>>> -Original Message-
>>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>>

Re: [devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574] v5

2016-08-23 Thread A V Mahesh
Hi Hoang,

Please send the all update patches 1 to 8  & README in single tar,
so that I can commit.

-AVM


On 8/23/2016 12:48 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> I updated README file and sent as attachment to this email.
> I also sent update patches following your comments.
>
> Please help me push these items if there is no further problem.
>
> Thank you and best regards,
> Hoang
>
> -----Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Monday, August 22, 2016 1:53 PM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than
> 255 bytes [#1574] v5
>
> Hi Hoang,
>
> ACK, Please Update README
>
> Note : tested default functionality , LONG DN functionality not tested in
> full fledged.
>
> -AVM
>
>
> On 8/18/2016 12:48 PM, Hoang Vo wrote:
>> Summary: CKPT: Support DNs longer than 255 bytes {#1574} Review
>> request for Trac Ticket(s): 1574 Peer Reviewer(s):
>> mahesh.va...@oracle.com; anders.wid...@ericsson.com Pull request to:
>> mahesh.va...@oracle.com 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 servicesy
>>OpenSAF servicesn
>>Core libraries  n
>>Samples n
>>Tests   n
>>Other   n
>>
>>
>> Comments (indicate scope for each "y" above):
>> -
>>
>> changeset 05233bdae1fb000fea001964eba1c51ebf3bfd8e
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpd: Add support for extended SaNameT [#1574] v3
>>
>> changeset cecabec5b6be73e731e540fd439e1d0e3534809f
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpnd: Add support for extended SaNameT [#1574] v3
>>
>> changeset 940dc877c94a9539e3da06d89c6480ef7e0ceda0
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpa: Add support for extended SaNameT [#1574] v1
>>
>> changeset 1f74531a36163bdfecd6b27174443d51c11ecf61
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpsv: Add new message to support extended SaNameT [#1574] v3
>>
>> changeset 29df19302186b3275ad06db00dc62f275dea25e1
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpd: Add new mbcsv messages supporting extended SaNameT [#1574] v2
>>
>> changeset 3f72410a7c2bb077647bdd4e46869a31a832f1d8
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpsv: Apply new messages supporting extended SaNameT to CPD, CPND,
> and CPA
>>  [#1574] v4
>>
>> changeset f32a0b3ca1ebf6049d2103e68e91d98bf086c48e
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  ckpt: Add new test cases to verify long DN feature on CPSV [#1574]
> v1
>> changeset 1aa38b707cf2cec14c416631cfc7e5518b25735f
>> Author:  Hoang Vo <hoang.m...@dektech.com.au>
>> Date:Thu, 18 Aug 2016 13:51:56 +0700
>>
>>  cpnd: add support for shm recovery for in-service update without
> restarting
>>  node [#1574] v1
>>
>>
>> Complete diffstat:
>> --
>>osaf/libs/agents/saf/cpa/Makefile.am  |1 +
>>osaf/libs/agents/saf/cpa/cpa_api.c|   48 --
>>osaf/libs/agents/saf/cpa/cpa_db.c |2 +
>>osaf/libs/agents/saf/cpa/cpa_mds.c|4 +-
>>osaf/libs/agents/saf/cpa/cpa_proc.c   |2 +-
>>osaf/libs/common/cpsv/cpsv_evt.c  |  440
> ++---
>>osaf/libs/common/cpsv/include/cpa.h   |1 +
>>osaf/libs/common/cpsv/include/cpa_cb.h|2 +-
>>osaf/libs/common/cpsv/include/cpa_proc.h  |2 +-
>>osaf/libs/common/cpsv/in

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA [#1574] v4

2016-08-23 Thread A V Mahesh
Hi Hoang,

Please send the all update patches 1 to 8  , so that I can commit.

-AVM


On 8/23/2016 12:46 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> I would like to send updated patch following your comment.
> When this is minor comment, I send it as attached file.
>
> Sincerely,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Monday, August 22, 2016 1:02 PM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 6 of 8] cpsv: Apply new messages supporting extended
> SaNameT to CPD, CPND, and CPA [#1574] v4
>
> Hi Hoang,
>
> ACK for  [PATCH 6 of 8]  with following minor comment
> I think CPND should return SA_AIS_ERR_TOO_BIG = 26 instead of
> SA_AIS_ERR_INVALID_PARAM ( please sync-up with other service return values
> ).
>
> Note : tested default functionality , LONG DN functionality not tested in
> full fledged
>
> -AVM
>
>
> On 8/18/2016 12:48 PM, Hoang Vo wrote:
>>osaf/libs/agents/saf/cpa/cpa_api.c  |  12 
>>osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>>osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>>osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>>osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |   2 ++
>>osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   2 +-
>>6 files changed, 18 insertions(+), 3 deletions(-)
>>
>>
>> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c
>> b/osaf/libs/agents/saf/cpa/cpa_api.c
>> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
>> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
>> @@ -880,6 +880,10 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>>  }
>>
>>  ckpt_name = osaf_extended_name_borrow(checkpointName);
>> +if (strlen(ckpt_name) >= kOsafMaxDnLength) {
>> +TRACE_LEAVE2("API return code = %u",
> SA_AIS_ERR_INVALID_PARAM);
>> +return SA_AIS_ERR_INVALID_PARAM;
>> +}
>>
>>  /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>>   Section 3.6.1 saCkptCheckpointOpen() and
>> saCkptCheckpointOpenAsync(), Return Values */ @@ -1192,6 +1196,10 @@
> SaAisErrorT saCkptCheckpointOpenAsync(Sa
>>  }
>>
>>  ckpt_name = osaf_extended_name_borrow(checkpointName);
>> +if (strlen(ckpt_name) >= kOsafMaxDnLength) {
>> +TRACE_LEAVE2("API return code = %u",
> SA_AIS_ERR_INVALID_PARAM);
>> +return SA_AIS_ERR_INVALID_PARAM;
>> +}
>>
>>  /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>>   Section 3.6.1 saCkptCheckpointOpen() and
>> saCkptCheckpointOpenAsync(), Return Values */ @@ -1597,6 +1605,10 @@
> SaAisErrorT saCkptCheckpointUnlink(SaCkp
>>  }
>>
>>  ckpt_name = osaf_extended_name_borrow(checkpointName);
>> +if (strlen(ckpt_name) >= kOsafMaxDnLength) {
>> +TRACE_LEAVE2("API return code = %u",
> SA_AIS_ERR_INVALID_PARAM);
>> +return SA_AIS_ERR_INVALID_PARAM;
>> +}
>>
>>  /* retrieve CPA CB */
>>  m_CPA_RETRIEVE_CB(cb);
>> diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c
>> b/osaf/libs/agents/saf/cpa/cpa_mds.c
>> --- a/osaf/libs/agents/saf/cpa/cpa_mds.c
>> +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c
>> @@ -515,9 +515,9 @@ static uint32_t cpa_mds_svc_evt(CPA_CB *
>> /* Populate & Send the Open Event to CPND */
>> memset(, 0, sizeof(CPSV_EVT));
>> evt.type = CPSV_EVT_TYPE_CPND;
>> -   evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
>> evt.info.cpnd.info.ckptListUpdate.client_hdl =
> lc_node->cl_hdl;
>> osaf_extended_name_lend(lc_node->ckpt_name,
>> _name);
>> +   evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
>>
>> proc_rc = cpa_mds_msg_send(cb->cpa_mds_hdl,
> >cpnd_mds_dest,
>> , NCSMDS_SVC_ID_CPND);
>>
>> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c
>> b/osaf/libs/common/cpsv/cpsv_evt.c
>> --- a/osaf/libs/common/cpsv/cpsv_evt.c
>> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
>> @@ -2378,6 +2378,7 @@ static uint32_t cpsv_encode_extended_nam
>>  if(!osaf_is_an_extended_name(name))
>>  return NCSCC_RC_SUCCESS;
>>
>> +TRACE("length = %d", name->length);
>>  SaConstStringT value = osaf_extended_name_borrow(name);
>>  uint16_t length = osaf_extended_name_length(name);
>>
>> 

Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams [#1941]

2016-08-23 Thread A V Mahesh
Hi Vu,

This folder doesn't exist , i just created on PL-3 , still failing

PL-3:~ # mkdir -p /repl_opensaf/saflog/logtest_sc_down_path/
PL-3:~ #

PL-3:~ # /usr/bin/logtest -e 9

Suite 9: LOG Server down / up
 ;
Preparing 8 streams for test. Please wait...
Preparing stream 0
...
Preparing stream 1
...
cur_logfile_name_get scandir Fail No such file or 
directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
 2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE (1))PL-3:~ #

-AVM


On 8/23/2016 12:21 PM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> Can you check if PL node can access the shared log folder?
>
> E.g: path on UML test
> /repl_opensaf/saflog/logtest_sc_down_path/
>
> I guess the problem is caused by PL not able to access the SAF log folder.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, August 23, 2016 1:46 PM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; Lennart Lund
>> <lennart.l...@ericsson.com>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams
>> [#1941]
>>
>> Hi Vu,
>>
>> I got it running on SC , but it is failing on PL with :
>>
>> "cur_logfile_name_get scandir Fail No such file or
>> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
>>   2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE (1))"
>>
>> -AVM
>>
>>
>> On 8/23/2016 12:06 PM, A V Mahesh wrote:
>>> Hi Vu,
>>>
>>> Why test case is allowed on SC`s ?
>>>
>>>
>> ==
>> 
>>> SC-1:~ # /usr/bin/logtest -e 9
>>>
>>> Suite 9: LOG Server down / up
>>>;
>>> Preparing 8 streams for test. Please wait...
>>> Preparing stream 0
>>> ...
>>> Preparing stream 1
>>> ...
>>> Preparing stream 2
>>> ...
>>> Preparing stream 3
>>> ..
>>> Preparing stream 4
>>> ..
>>> Preparing stream 5
>>> .
>>> Preparing stream 6
>>> Preparing stream 7
>>>2  PASSED   Before SC down: Prepare 8 streams;
>>> Preparing 1 config stream (notification) for test . Please wait...
>>> .
>>>3  PASSED   Before SC down: Prepare 1 cfg (notif) stream;
>>>
>>> Stop both SC nodes [stdby first]. Press Enter when stopped...
>>>;
>>>
>>> Start at least one SC node. Press Enter when started...
>>>
>>>
>> ==
>> 
>>> -AVM
>>>
>>> On 8/23/2016 12:03 PM, A V Mahesh wrote:
>>>> Hi Vu,
>>>>
>>>> test case 9 failing on PL-3 , i am i missing any configuration ?
>>>>
>>>> # /usr/bin/logtest -e 9
>>>>
>>>> Suite 9: LOG Server down / up
>>>> ;
>>>> Preparing 8 streams for test. Please wait...
>>>> Preparing stream 0
>>>> ...
>>>> Preparing stream 1
>>>> ...
>>>> cur_logfile_name_get scandir Fail No such file or
>>>> directorysaLogRecov_prepare_client1_8streams Internal error. Test
> failed
>>>>
>>>> -AVM
>>>>
>>>> On 8/10/2016 12:09 PM, Vu Minh Nguyen wrote:
>>>>>  osaf/services/saf/logsv/lgs/lgs_recov.cc |  59
> +
>> --
>>>>>  1 files changed, 32 insertions(+), 27 deletions(-)
>>>>>
>>>>>
>>>>> create_new_app_stream() was changed and introduced new error codes
>> in long DN
>>>>> ticket. One of them is SA_AIS_ERR_EXIST.
>>>>>
>>>>> When SCs restart from headless, create_new_app_stream() returns
>> SA_AIS_ERR_EXIST
>>>>> but this error code was not handled correctly and made recovery
>> functionality
>>>>> fail.
>>>>>
>>>>> lgs_restore_one_app_stream needs to be updated.
>>>>>
>>>>> diff --git a/osaf/services/saf/logsv/lgs/lgs_recov.cc
>> b/osaf/services/saf/logsv/lgs/lgs_recov.cc
>>>>> --- a/osaf/services/saf/logsv/lgs/lgs_recov.cc
>>>>> +++ b/osaf/services/saf/logsv/lgs/lgs_recov.c

Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams [#1941]

2016-08-23 Thread A V Mahesh
Hi Vu,

I got it running on SC , but it is failing on PL with :

"cur_logfile_name_get scandir Fail No such file or 
directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
 2  FAILED   (expected EXIT_SUCCESS, got EXIT_FAILURE (1))"

-AVM


On 8/23/2016 12:06 PM, A V Mahesh wrote:
> Hi Vu,
>
> Why test case is allowed on SC`s ?
>
> ==
>
> SC-1:~ # /usr/bin/logtest -e 9
>
> Suite 9: LOG Server down / up
>   ;
> Preparing 8 streams for test. Please wait...
> Preparing stream 0
> ...
> Preparing stream 1
> ...
> Preparing stream 2
> ...
> Preparing stream 3
> ..
> Preparing stream 4
> ..
> Preparing stream 5
> .
> Preparing stream 6
> Preparing stream 7
>   2  PASSED   Before SC down: Prepare 8 streams;
> Preparing 1 config stream (notification) for test . Please wait...
> .
>   3  PASSED   Before SC down: Prepare 1 cfg (notif) stream;
>
> Stop both SC nodes [stdby first]. Press Enter when stopped...
>   ;
>
> Start at least one SC node. Press Enter when started...
>
> ======
>
> -AVM
>
> On 8/23/2016 12:03 PM, A V Mahesh wrote:
>> Hi Vu,
>>
>> test case 9 failing on PL-3 , i am i missing any configuration ?
>>
>> # /usr/bin/logtest -e 9
>>
>> Suite 9: LOG Server down / up
>>;
>> Preparing 8 streams for test. Please wait...
>> Preparing stream 0
>> ...
>> Preparing stream 1
>> ...
>> cur_logfile_name_get scandir Fail No such file or
>> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
>>
>>
>> -AVM
>>
>> On 8/10/2016 12:09 PM, Vu Minh Nguyen wrote:
>>> osaf/services/saf/logsv/lgs/lgs_recov.cc |  59 
>>> +--
>>> 1 files changed, 32 insertions(+), 27 deletions(-)
>>>
>>>
>>> create_new_app_stream() was changed and introduced new error codes in long 
>>> DN
>>> ticket. One of them is SA_AIS_ERR_EXIST.
>>>
>>> When SCs restart from headless, create_new_app_stream() returns 
>>> SA_AIS_ERR_EXIST
>>> but this error code was not handled correctly and made recovery 
>>> functionality
>>> fail.
>>>
>>> lgs_restore_one_app_stream needs to be updated.
>>>
>>> diff --git a/osaf/services/saf/logsv/lgs/lgs_recov.cc 
>>> b/osaf/services/saf/logsv/lgs/lgs_recov.cc
>>> --- a/osaf/services/saf/logsv/lgs/lgs_recov.cc
>>> +++ b/osaf/services/saf/logsv/lgs/lgs_recov.cc
>>> @@ -309,24 +309,6 @@ static int lgs_get_file_params_h(gfp_in_
>>> return rc;
>>> }
>>> 
>>> -static void lgs_remove_stream(uint32_t client_id, log_stream_t *log_stream)
>>> -{
>>> -   TRACE_ENTER();
>>> -
>>> -   /* Remove the stream handle and
>>> -* remove the stream resources
>>> -*/
>>> -   if (lgs_client_stream_rmv(client_id, log_stream->streamId) < 0) {
>>> -  TRACE("%s lgs_client_stream_rmv Fail", __FUNCTION__);
>>> -   }
>>> -
>>> -   log_free_stream_resources(log_stream);
>>> -
>>> -   log_stream = NULL;
>>> -
>>> -   TRACE_LEAVE();
>>> -}
>>> -
>>> /**
>>>  * Restore parameters for a lost runtime (application) stream, create 
>>> the
>>>  * stream in the local stream list and associate with a client.
>>> @@ -344,7 +326,6 @@ int lgs_restore_one_app_stream(
>>> {
>>> int int_rc = 0;
>>> int rc_out = 0;
>>> -   SaAisErrorT ais_rc = SA_AIS_OK;
>>> SaImmHandleT immOmHandle;
>>> SaImmAttrValuesT_2 *attribute;
>>> SaImmAttrValuesT_2 **attributes;
>>> @@ -353,7 +334,7 @@ int lgs_restore_one_app_stream(
>>> int list_pos;
>>> int n;
>>> int i = 0;
>>> -
>>> +   SaBoolT twelveHourModeFlag = SA_FALSE;
>>> lgsv_stream_open_req_t open_stream_param;
>>> log_stream_t *log_stream = NULL;
>>> SaTimeT restored_creationTimeStamp = 0;
>>> @@ -552,23 +533,46 @@ int lgs_restore_one_app_stream(
>>>  */
>>> open_stream_param.client_id = clie

Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams [#1941]

2016-08-23 Thread A V Mahesh
Hi Vu,

Why test case is allowed on SC`s ?

==

SC-1:~ # /usr/bin/logtest -e 9

Suite 9: LOG Server down / up
 ;
Preparing 8 streams for test. Please wait...
Preparing stream 0
...
Preparing stream 1
...
Preparing stream 2
...
Preparing stream 3
..
Preparing stream 4
..
Preparing stream 5
.
Preparing stream 6
Preparing stream 7
 2  PASSED   Before SC down: Prepare 8 streams;
Preparing 1 config stream (notification) for test . Please wait...
.
 3  PASSED   Before SC down: Prepare 1 cfg (notif) stream;

Stop both SC nodes [stdby first]. Press Enter when stopped...
 ;

Start at least one SC node. Press Enter when started...

==

-AVM

On 8/23/2016 12:03 PM, A V Mahesh wrote:
> Hi Vu,
>
> test case 9 failing on PL-3 , i am i missing any configuration ?
>
> # /usr/bin/logtest -e 9
>
> Suite 9: LOG Server down / up
>   ;
> Preparing 8 streams for test. Please wait...
> Preparing stream 0
> ...
> Preparing stream 1
> ...
> cur_logfile_name_get scandir Fail No such file or
> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed
>
>
> -AVM
>
> On 8/10/2016 12:09 PM, Vu Minh Nguyen wrote:
>>osaf/services/saf/logsv/lgs/lgs_recov.cc |  59 
>> +--
>>1 files changed, 32 insertions(+), 27 deletions(-)
>>
>>
>> create_new_app_stream() was changed and introduced new error codes in long DN
>> ticket. One of them is SA_AIS_ERR_EXIST.
>>
>> When SCs restart from headless, create_new_app_stream() returns 
>> SA_AIS_ERR_EXIST
>> but this error code was not handled correctly and made recovery functionality
>> fail.
>>
>> lgs_restore_one_app_stream needs to be updated.
>>
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_recov.cc 
>> b/osaf/services/saf/logsv/lgs/lgs_recov.cc
>> --- a/osaf/services/saf/logsv/lgs/lgs_recov.cc
>> +++ b/osaf/services/saf/logsv/lgs/lgs_recov.cc
>> @@ -309,24 +309,6 @@ static int lgs_get_file_params_h(gfp_in_
>>  return rc;
>>}
>>
>> -static void lgs_remove_stream(uint32_t client_id, log_stream_t *log_stream)
>> -{
>> -TRACE_ENTER();
>> -
>> -/* Remove the stream handle and
>> - * remove the stream resources
>> - */
>> -   if (lgs_client_stream_rmv(client_id, log_stream->streamId) < 0) {
>> -   TRACE("%s lgs_client_stream_rmv Fail", __FUNCTION__);
>> -   }
>> -
>> -   log_free_stream_resources(log_stream);
>> -
>> -   log_stream = NULL;
>> -
>> -   TRACE_LEAVE();
>> -}
>> -
>>/**
>> * Restore parameters for a lost runtime (application) stream, create the
>> * stream in the local stream list and associate with a client.
>> @@ -344,7 +326,6 @@ int lgs_restore_one_app_stream(
>>{
>>  int int_rc = 0;
>>  int rc_out = 0;
>> -SaAisErrorT ais_rc = SA_AIS_OK;
>>  SaImmHandleT immOmHandle;
>>  SaImmAttrValuesT_2 *attribute;
>>  SaImmAttrValuesT_2 **attributes;
>> @@ -353,7 +334,7 @@ int lgs_restore_one_app_stream(
>>  int list_pos;
>>  int n;
>>  int i = 0;
>> -
>> +SaBoolT twelveHourModeFlag = SA_FALSE;
>>  lgsv_stream_open_req_t open_stream_param;
>>  log_stream_t *log_stream = NULL;
>>  SaTimeT restored_creationTimeStamp = 0;
>> @@ -552,23 +533,46 @@ int lgs_restore_one_app_stream(
>>   */
>>  open_stream_param.client_id = client_id;
>>  open_stream_param.lstr_open_flags = 0; /* Dummy not used here */
>> -
>>  open_stream_param.logFileName = const_cast(fileName.c_str());
>>  open_stream_param.logFilePathName = const_cast> *>(pathName.c_str());
>>
>> -ais_rc = create_new_app_stream(_stream_param, _stream);
>> -if ( ais_rc != SA_AIS_OK) {
>> -TRACE("%s: create_new_app_stream Fail %s",
>> -__FUNCTION__, saf_error(ais_rc));
>> +log_stream = log_stream_new(stream_name, STREAM_NEW);
>> +if (log_stream == NULL) {
>>  rc_out = -1;
>>  goto done_free_attr;
>>  }
>>
>> +/**
>> + * No need to verify all attributes as
>> + * they have been verified at the time of creation
>> + */
>> +
>> +/* Get twelveHourModeFlag from the logFileFmt */
>

Re: [devel] [PATCH 1 of 1] MDS: Log TIPC dropped messages [#1957]

2016-08-23 Thread A V Mahesh
Hi HansN

Please see response below with [AVM]

-AVM

On 8/23/2016 11:41 AM, Hans Nordebäck wrote:
> Hi Mahesh,
>
> please see comments below.
>
> /Thanks HansN
>
>
> On 08/23/2016 07:21 AM, A V Mahesh wrote:
>> Hi HansN,
>>
>> Let us fist discuss the error handling and abort, then we can come 
>> back to
>> interpretation of  TIPC currently  does permit  OR does not permit an 
>> application to send
>> a multicast message with the "destination droppable" setting disabled.
>>
>> Let us disable TIPC_DEST_DROPPABLE, so that  TIPC will try to return 
>> an undelivered multicast message to its sender
>> and we can  determine issue is  because of TIPC_ERR_OVERLOAD, this 
>> helps in debugging ,
>> so that application may increased SO_SNDBUF/SO_RCVBUF to reduce the 
>> problem.
>>
>> But still we need to abort(), the reason for that is current MDS 
>> implementations doesn't
>> have flow control logic ( no retry because of error ) , so 
>> Application like AMF can go wrong and cluster will go into 
>> unstable/recoverble state.
>>
> [HansN] In the current implementation messages are dropped silently 
> and no abort is done. 
[AVM]  I can see  abort(); in current code , you mean abort(); is not 
working and application(amf) is not existing ?

if (anc->cmsg_type == TIPC_ERRINFO) {
 /* TIPC_ERRINFO - TIPC error code associated with a returned data 
message or a connection termination message  so abort */
 m_MDS_LOG_CRITICAL("MDTM: undelivered message condition ancillary 
data: TIPC_ERRINFO abort err :%s", strerror(errno) );
*abort();*
} else if (anc->cmsg_type == TIPC_RETDATA) {
 /* If we set TIPC_DEST_DROPPABLE off messge (configure TIPC to 
return rejected messages to the sender )
we will hit this when we implement MDS retransmit lost messages  
abort can be replaced with flow control logic*/
 for (i = anc->cmsg_len - sizeof(*anc); i > 0; i--) {
 m_MDS_LOG_DBG("MDTM: returned byte 0x%02x\n", *cptr);
 cptr++;
 }
 /* TIPC_RETDATA -The contents of a returned data message  so abort */
 m_MDS_LOG_CRITICAL("MDTM: undelivered message condition ancillary 
data: TIPC_RETDATA abort err :%s", strerror(errno) );
*abort();*
}

> This patch enables logging
> when packages are dropped to help in debugging. I don't agree that we 
> should also introduce abort, but instead:
> 1) Implement a solution to handle dropped packages, ticket #1960
[AVM]  This is nothing but flow control implementation in MDS, this is 
future enhancement

> 2) Investigate why packages may be dropped, the receiving MDS thread 
> is a real time thread and should be able to consume a large amount of 
> incoming messages.
> E.g. is the receiving MDS thread "live hanging" due to locks, file I/O 
> etc?
>> This was the reason we haven't gone for it while addressing Ticket 
>> #1227 (https://sourceforge.net/p/opensaf/mailman/message/33207717/)
>> So currently we don't have any advantage of disabling 
>> TIPC_DEST_DROPPABLE and not allowing multicast  messages.
>>
>> -AVM
>>
>>
>> On 8/18/2016 2:43 PM, Hans Nordeback wrote:
>>>   osaf/libs/core/mds/mds_dt_tipc.c |  32 
>>> +---
>>>   1 files changed, 25 insertions(+), 7 deletions(-)
>>>
>>>
>>> diff --git a/osaf/libs/core/mds/mds_dt_tipc.c 
>>> b/osaf/libs/core/mds/mds_dt_tipc.c
>>> --- a/osaf/libs/core/mds/mds_dt_tipc.c
>>> +++ b/osaf/libs/core/mds/mds_dt_tipc.c
>>> @@ -320,6 +320,15 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid,
>>>   m_MDS_LOG_INFO("MDTM: Successfully set default 
>>> socket option TIPC_IMP = %d", TIPCIMPORTANCE);
>>>   }
>>>   +int droppable = 0;
>>> +if (setsockopt(tipc_cb.BSRsock, SOL_TIPC, 
>>> TIPC_DEST_DROPPABLE, , sizeof(droppable)) != 0) {
>>> +LOG_ER("MDTM: Can't set TIPC_DEST_DROPPABLE to zero 
>>> err :%s\n", strerror(errno));
>>> +m_MDS_LOG_ERR("MDTM: Can't set TIPC_DEST_DROPPABLE 
>>> to zero err :%s\n", strerror(errno));
>>> +osafassert(0);
>>> +} else {
>>> +m_MDS_LOG_NOTIFY("MDTM: Successfully set 
>>> TIPC_DEST_DROPPABLE to zero");
>>> +}
>>> +
>>>   return NCSCC_RC_SUCCESS;
>>>   }
>>>   @@ -563,6 +572,8 @@ ssize_t recvfrom_

Re: [devel] [PATCH 1 of 1] MDS: Log TIPC dropped messages [#1957]

2016-08-22 Thread A V Mahesh
Hi HansN,

Let us fist discuss the error handling and abort, then we can come back to
interpretation of  TIPC currently  does permit  OR does not permit an 
application to send
a multicast message with the "destination droppable" setting disabled.

Let us disable TIPC_DEST_DROPPABLE, so that  TIPC will try to return an 
undelivered multicast message to its sender
and we can  determine issue is  because of TIPC_ERR_OVERLOAD, this helps 
in debugging ,
so that application may increased SO_SNDBUF/SO_RCVBUF to reduce the problem.

But still we need to abort(), the reason for that is current MDS 
implementations doesn't
have flow control logic ( no retry because of error ) , so Application 
like AMF can go wrong and cluster will go into unstable/recoverble state.

This was the reason we haven't gone for it while addressing Ticket #1227 
(https://sourceforge.net/p/opensaf/mailman/message/33207717/)
So currently we don't have any advantage of disabling 
TIPC_DEST_DROPPABLE and not allowing multicast  messages.

-AVM


On 8/18/2016 2:43 PM, Hans Nordeback wrote:
>   osaf/libs/core/mds/mds_dt_tipc.c |  32 +---
>   1 files changed, 25 insertions(+), 7 deletions(-)
>
>
> diff --git a/osaf/libs/core/mds/mds_dt_tipc.c 
> b/osaf/libs/core/mds/mds_dt_tipc.c
> --- a/osaf/libs/core/mds/mds_dt_tipc.c
> +++ b/osaf/libs/core/mds/mds_dt_tipc.c
> @@ -320,6 +320,15 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid,
>   m_MDS_LOG_INFO("MDTM: Successfully set default socket 
> option TIPC_IMP = %d", TIPCIMPORTANCE);
>   }
>   
> +int droppable = 0;
> +if (setsockopt(tipc_cb.BSRsock, SOL_TIPC, TIPC_DEST_DROPPABLE, 
> , sizeof(droppable)) != 0) {
> +LOG_ER("MDTM: Can't set TIPC_DEST_DROPPABLE to zero err 
> :%s\n", strerror(errno));
> +m_MDS_LOG_ERR("MDTM: Can't set TIPC_DEST_DROPPABLE to zero 
> err :%s\n", strerror(errno));
> +osafassert(0);
> +} else {
> +m_MDS_LOG_NOTIFY("MDTM: Successfully set TIPC_DEST_DROPPABLE 
> to zero");
> +}
> +
>   return NCSCC_RC_SUCCESS;
>   }
>   
> @@ -563,6 +572,8 @@ ssize_t recvfrom_connectionless (int sd,
>   unsigned char *cptr;
>   int i;
>   int has_addr;
> + int anc_data[2];
> +
>   ssize_t sz;
>   
>   has_addr = (from != NULL) && (addrlen != NULL);
> @@ -591,19 +602,26 @@ ssize_t recvfrom_connectionless (int sd,
>  if the message was sent using a TIPC name or name 
> sequence as the
>  destination rather than a TIPC port ID So abort for 
> TIPC_ERRINFO and TIPC_RETDATA*/
>   if (anc->cmsg_type == TIPC_ERRINFO) {
> - /* TIPC_ERRINFO - TIPC error code associated 
> with a returned data message or a connection termination message  so abort */
> - m_MDS_LOG_CRITICAL("MDTM: undelivered message 
> condition ancillary data: TIPC_ERRINFO abort err :%s", strerror(errno) );
> - abort();
> + anc_data[0] = *((unsigned int*)(CMSG_DATA(anc) 
> + 0));
> + if (anc_data[0] == TIPC_ERR_OVERLOAD) {
> + LOG_CR("MDTM: undelivered message 
> condition ancillary data: TIPC_ERR_OVERLOAD");
> + m_MDS_LOG_CRITICAL("MDTM: undelivered 
> message condition ancillary data: TIPC_ERR_OVERLOAD");
> + } else {
> + /* TIPC_ERRINFO - TIPC error code 
> associated with a returned data message or a connection termination message  
> so abort */
> + LOG_CR("MDTM: undelivered message 
> condition ancillary data: TIPC_ERRINFO abort err : %d", anc_data[0]);
> + m_MDS_LOG_CRITICAL("MDTM: undelivered 
> message condition ancillary data: TIPC_ERRINFO abort err : %d", anc_data[0]);
> + }
>   } else if (anc->cmsg_type == TIPC_RETDATA) {
> - /* If we set TIPC_DEST_DROPPABLE off messge 
> (configure TIPC to return rejected messages to the sender )
> + /* If we set TIPC_DEST_DROPPABLE off message 
> (configure TIPC to return rejected messages to the sender )
>  we will hit this when we implement MDS 
> retransmit lost messages  abort can be replaced with flow control logic*/
>   for (i = anc->cmsg_len - sizeof(*anc); i > 0; 
> i--) {
> - m_MDS_LOG_DBG("MDTM: returned byte 
> 0x%02x\n", *cptr);
> + LOG_CR("MDTM: returned byte 0x%02x\n", 
> *cptr);
> + m_MDS_LOG_CRITICAL("MDTM: returned byte 
> 0x%02x\n", *cptr);
>   cptr++;
>   }
>   

Re: [devel] [PATCH 1 of 1] log: fix incorrect usage of saImmRtObjectDelete on cfg app stream [#1330]

2016-08-22 Thread A V Mahesh
Hi Vu,

ACK

-AVM


On 7/20/2016 11:40 AM, Vu Minh Nguyen wrote:
>   osaf/services/saf/logsv/lgs/lgs_imm.cc|  25 +
>   osaf/services/saf/logsv/lgs/lgs_mbcsv.cc  |   1 +
>   osaf/services/saf/logsv/lgs/lgs_stream.cc |   6 --
>   osaf/services/saf/logsv/lgs/lgs_stream.h  |   8 
>   4 files changed, 22 insertions(+), 18 deletions(-)
>
>
> saImmRtObjectDelete() was always called when closing app streams,
> even the stream was configurable. If it was the case, that IMM API
> would return SA_AIS_ERR_NOT_EXIST and had WA in syslog.
>
> This patch introduce one flag in `log_stream_t`, showing
> the closed stream is runtime or configurable. And only
> call to the IMM API if the app stream is runtime.
> And this flag value is cached locally at SCs node.
>
> diff --git a/osaf/services/saf/logsv/lgs/lgs_imm.cc 
> b/osaf/services/saf/logsv/lgs/lgs_imm.cc
> --- a/osaf/services/saf/logsv/lgs/lgs_imm.cc
> +++ b/osaf/services/saf/logsv/lgs/lgs_imm.cc
> @@ -405,28 +405,21 @@ static void adminOperationCallback(SaImm
>   
>   if (opId == SA_LOG_ADMIN_CHANGE_FILTER) {
>   /* Only allowed to update runtime objects (application streams) 
> */
> - /**
> -  * className holds a pointer to an duplicated memory (strdup).
> -  * Must be free after done using.
> -  */
> - SaImmClassNameT className = immutil_get_className(objectName);
> -
> - if (!strcmp(className, "SaLogStreamConfig")) {
> + if (stream->streamType != STREAM_TYPE_APPLICATION) {
> + report_om_error(immOiHandle, invocation,
> + "Admin op change filter for non app 
> stream");
> + goto done;
> + }
> +
> + /* Not allow perform adm op on configurable app streams */
> + if (stream->isRtStream != SA_TRUE) {
>   ais_rc = 
> immutil_saImmOiAdminOperationResult(immOiHandle,
> -   invocation, 
> SA_AIS_ERR_NOT_SUPPORTED);
> +  
> invocation, SA_AIS_ERR_NOT_SUPPORTED);
>   if (ais_rc != SA_AIS_OK) {
>   LOG_ER("immutil_saImmOiAdminOperationResult 
> failed %s", saf_error(ais_rc));
>   osaf_abort(0);
>   }
>   
> - free(className);
> - goto done;
> - }
> - free(className);
> -
> - if (stream->streamType != STREAM_TYPE_APPLICATION) {
> - report_om_error(immOiHandle, invocation,
> - "Admin op change filter for non app 
> stream");
>   goto done;
>   }
>   
> diff --git a/osaf/services/saf/logsv/lgs/lgs_mbcsv.cc 
> b/osaf/services/saf/logsv/lgs/lgs_mbcsv.cc
> --- a/osaf/services/saf/logsv/lgs/lgs_mbcsv.cc
> +++ b/osaf/services/saf/logsv/lgs/lgs_mbcsv.cc
> @@ -1943,6 +1943,7 @@ uint32_t ckpt_proc_open_stream(lgs_cb_t
>   stream->logFileCurrent = param->logFileCurrent;
>   stream->stb_prev_actlogFileCurrent = param->logFileCurrent;
>   stream->stb_logFileCurrent = param->logFileCurrent;
> + stream->isRtStream = SA_TRUE;
>   }
>   
>   /* If configured for split file system files shall be opened on stand by
> diff --git a/osaf/services/saf/logsv/lgs/lgs_stream.cc 
> b/osaf/services/saf/logsv/lgs/lgs_stream.cc
> --- a/osaf/services/saf/logsv/lgs/lgs_stream.cc
> +++ b/osaf/services/saf/logsv/lgs/lgs_stream.cc
> @@ -386,7 +386,7 @@ void log_stream_delete(log_stream_t **s)
>   TRACE_ENTER2("%s", stream->name.c_str());
>   
>   if (lgs_cb->ha_state == SA_AMF_HA_ACTIVE) {
> - if (stream->streamType == STREAM_TYPE_APPLICATION) {
> + if (stream->isRtStream == SA_TRUE) {
>   SaAisErrorT rv;
>   TRACE("Stream is closed, I am HA active so remove IMM 
> object");
>   SaNameT objectName;
> @@ -457,6 +457,7 @@ int lgs_populate_log_stream(
>   o_stream->twelveHourModeFlag = twelveHourModeFlag;
>   o_stream->logRecordId = logRecordId;
>   o_stream->stb_logRecordId = 0;
> + o_stream->isRtStream = SA_TRUE;
>   
>   o_stream->logFileFormat = strdup(logFileFormat);
>   if (o_stream->logFileFormat == NULL) {
> @@ -633,7 +634,8 @@ log_stream_t *log_stream_new(const std::
>   stream->streamId = stream_id;
>   stream->creationTimeStamp = lgs_get_SaTime();
>   stream->severityFilter = 0x7f;  /* by default all levels are allowed */
> - 
> + stream->isRtStream = SA_FALSE;
> +
>   /* Initiate local or shared stream file descriptor dependant on shared 
> or
>* split file system
>*/
> diff --git a/osaf/services/saf/logsv/lgs/lgs_stream.h 
> 

Re: [devel] [PATCH 1 of 1] ckpt: fix cppcheck warning [#1874]

2016-08-22 Thread A V Mahesh
Hi Hoan,

Can you please push

-AVM


On 6/13/2016 11:58 AM, A V Mahesh wrote:
> Hi Hoang Vo,
>
> ACK , Not tested.
>
> By the way which GCC/tool given these warnings ?
>
> -AVM
>
> On 6/13/2016 9:20 AM, Hoang Vo wrote:
>>   osaf/services/saf/cpsv/cpd/cpd_db.c |   8 ++---
>>   osaf/services/saf/cpsv/cpd/cpd_evt.c|   4 +-
>>   osaf/services/saf/cpsv/cpd/cpd_imm.c|   2 +-
>>   osaf/services/saf/cpsv/cpd/cpd_tmr.c|   2 +-
>>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  49 
>> 
>>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   2 +-
>>   6 files changed, 32 insertions(+), 35 deletions(-)
>>
>>
>> This enhancement fix following warning results from cppcheck 1.74:
>> Either the condition is redundant or there is possible null pointer 
>> dereference
>>
>> This enhancement does not fix following warnings when they are not 
>> problems:
>> Possible null pointer dereference
>> Style and performance warnings
>>
>> diff --git a/osaf/services/saf/cpsv/cpd/cpd_db.c 
>> b/osaf/services/saf/cpsv/cpd/cpd_db.c
>> --- a/osaf/services/saf/cpsv/cpd/cpd_db.c
>> +++ b/osaf/services/saf/cpsv/cpd/cpd_db.c
>> @@ -843,12 +843,10 @@ uint32_t cpd_cpnd_info_node_delete(CPD_C
>>   }
>> /* Free the Client Node */
>> -if (cpnd_info_node) {
>> -if (cpnd_info_node->cpnd_ret_timer.uarg)
>> -ncshm_destroy_hdl(NCS_SERVICE_ID_CPD, 
>> cpnd_info_node->cpnd_ret_timer.uarg);
>> +if (cpnd_info_node->cpnd_ret_timer.uarg)
>> +ncshm_destroy_hdl(NCS_SERVICE_ID_CPD, 
>> cpnd_info_node->cpnd_ret_timer.uarg);
>>   -m_MMGR_FREE_CPD_CPND_INFO_NODE(cpnd_info_node);
>> -}
>> +m_MMGR_FREE_CPD_CPND_INFO_NODE(cpnd_info_node);
>> return rc;
>>   diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
>> b/osaf/services/saf/cpsv/cpd/cpd_evt.c
>> --- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
>> +++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
>> @@ -1439,7 +1439,7 @@ static uint32_t cpd_evt_proc_mds_evt(CPD
>>   /* No Checkpoints on this node, */
>>   TRACE_LEAVE();
>>   return NCSCC_RC_SUCCESS;
>> -} else if (node_info && (node_info->ckpt_ref_list == 
>> NULL)) {
>> +} else if (node_info->ckpt_ref_list == NULL) {
>>   cpd_cpnd_info_node_delete(cb, node_info);
>>   TRACE_LEAVE();
>>   return NCSCC_RC_SUCCESS;
>> @@ -1453,7 +1453,7 @@ static uint32_t cpd_evt_proc_mds_evt(CPD
>>   /* No Checkpoints on this node, */
>>   return NCSCC_RC_SUCCESS;
>>   }
>> -else if (node_info && (node_info->ckpt_ref_list == 
>> NULL)) {
>> +else if (node_info->ckpt_ref_list == NULL) {
>>   cpd_cpnd_info_node_delete(cb, node_info);
>>   TRACE_LEAVE();
>>   return NCSCC_RC_SUCCESS;
>> diff --git a/osaf/services/saf/cpsv/cpd/cpd_imm.c 
>> b/osaf/services/saf/cpsv/cpd/cpd_imm.c
>> --- a/osaf/services/saf/cpsv/cpd/cpd_imm.c
>> +++ b/osaf/services/saf/cpsv/cpd/cpd_imm.c
>> @@ -904,7 +904,7 @@ SaUint32T cpd_get_scAbsenceAllowed_attr(
>> /* Handle the global scAbsenceAllowed_flag */
>>   attribute = attributes[0];
>> -TRACE("%s attrName \"%s\"",__FUNCTION__,attribute->attrName);
>> +TRACE("%s attrName 
>> \"%s\"",__FUNCTION__,attribute?attribute->attrName:"");
>>   if ((attribute != NULL) && (attribute->attrValuesNumber != 0)) {
>>   /* scAbsenceAllowed has value. Get the value */
>>   value = attribute->attrValues[0];
>> diff --git a/osaf/services/saf/cpsv/cpd/cpd_tmr.c 
>> b/osaf/services/saf/cpsv/cpd/cpd_tmr.c
>> --- a/osaf/services/saf/cpsv/cpd/cpd_tmr.c
>> +++ b/osaf/services/saf/cpsv/cpd/cpd_tmr.c
>> @@ -42,7 +42,7 @@ void cpd_timer_expiry(NCSCONTEXT uarg)
>>   CPSV_EVT *evt = NULL;
>>   uint32_t cpd_hdl = m_CPD_GET_CB_HDL;
>>   -TRACE("cpd_timer_expiry(uarg=%p, type=%u)", uarg, tmr->type);
>> +TRACE("cpd_timer_expiry(uarg=%p, type=%u)", uarg, tmr ? 
>> tmr->type : 0);
>> /* post a message to the corresponding component */
>>   if ((cb = (CPD_CB *)ncshm_take_hdl(NCS_SERVICE_ID_CPD, 
>> cpd_hdl)) == NULL)
>> diff --git a/osaf/services/saf/

Re: [devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574] v5

2016-08-22 Thread A V Mahesh
Hi Hoang,

ACK, Please Update README

Note : tested default functionality , LONG DN functionality not tested
in full fledged.

-AVM


On 8/18/2016 12:48 PM, Hoang Vo wrote:
> Summary: CKPT: Support DNs longer than 255 bytes {#1574}
> Review request for Trac Ticket(s): 1574
> Peer Reviewer(s): mahesh.va...@oracle.com; anders.wid...@ericsson.com
> Pull request to: mahesh.va...@oracle.com
> 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 servicesy
>   OpenSAF servicesn
>   Core libraries  n
>   Samples n
>   Tests   n
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
>
> changeset 05233bdae1fb000fea001964eba1c51ebf3bfd8e
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpd: Add support for extended SaNameT [#1574] v3
>
> changeset cecabec5b6be73e731e540fd439e1d0e3534809f
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpnd: Add support for extended SaNameT [#1574] v3
>
> changeset 940dc877c94a9539e3da06d89c6480ef7e0ceda0
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpa: Add support for extended SaNameT [#1574] v1
>
> changeset 1f74531a36163bdfecd6b27174443d51c11ecf61
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpsv: Add new message to support extended SaNameT [#1574] v3
>
> changeset 29df19302186b3275ad06db00dc62f275dea25e1
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpd: Add new mbcsv messages supporting extended SaNameT [#1574] v2
>
> changeset 3f72410a7c2bb077647bdd4e46869a31a832f1d8
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and 
> CPA
>   [#1574] v4
>
> changeset f32a0b3ca1ebf6049d2103e68e91d98bf086c48e
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   ckpt: Add new test cases to verify long DN feature on CPSV [#1574] v1
>
> changeset 1aa38b707cf2cec14c416631cfc7e5518b25735f
> Author:   Hoang Vo 
> Date: Thu, 18 Aug 2016 13:51:56 +0700
>
>   cpnd: add support for shm recovery for in-service update without 
> restarting
>   node [#1574] v1
>
>
> Complete diffstat:
> --
>   osaf/libs/agents/saf/cpa/Makefile.am  |1 +
>   osaf/libs/agents/saf/cpa/cpa_api.c|   48 --
>   osaf/libs/agents/saf/cpa/cpa_db.c |2 +
>   osaf/libs/agents/saf/cpa/cpa_mds.c|4 +-
>   osaf/libs/agents/saf/cpa/cpa_proc.c   |2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c  |  440 
> ++---
>   osaf/libs/common/cpsv/include/cpa.h   |1 +
>   osaf/libs/common/cpsv/include/cpa_cb.h|2 +-
>   osaf/libs/common/cpsv/include/cpa_proc.h  |2 +-
>   osaf/libs/common/cpsv/include/cpd.h   |1 +
>   osaf/libs/common/cpsv/include/cpd_cb.h|   17 +-
>   osaf/libs/common/cpsv/include/cpd_imm.h   |4 +-
>   osaf/libs/common/cpsv/include/cpd_mem.h   |   25 +++-
>   osaf/libs/common/cpsv/include/cpd_proc.h  |2 +-
>   osaf/libs/common/cpsv/include/cpnd.h  |1 +
>   osaf/libs/common/cpsv/include/cpnd_cb.h   |5 +-
>   osaf/libs/common/cpsv/include/cpnd_init.h |3 +-
>   osaf/libs/common/cpsv/include/cpsv_evt.h  |   10 +
>   osaf/libs/common/cpsv/include/cpsv_shm.h  |   24 +++-
>   osaf/services/saf/cpsv/cpd/Makefile.am|1 +
>   osaf/services/saf/cpsv/cpd/cpd_amf.c  |7 +-
>   osaf/services/saf/cpsv/cpd/cpd_db.c   |   95 +++---
>   osaf/services/saf/cpsv/cpd/cpd_evt.c  |  103 ++-
>   osaf/services/saf/cpsv/cpd/cpd_imm.c  |  268 
> ++
>   osaf/services/saf/cpsv/cpd/cpd_main.c |7 +
>   osaf/services/saf/cpsv/cpd/cpd_mbcsv.c|   31 -
>   osaf/services/saf/cpsv/cpd/cpd_mds.c  |   84 -
>   osaf/services/saf/cpsv/cpd/cpd_proc.c |  180 
> ++--
>   osaf/services/saf/cpsv/cpd/cpd_red.c  |6 +-
>   osaf/services/saf/cpsv/cpd/cpd_sbevt.c|   57 +++-
>   osaf/services/saf/cpsv/cpnd/Makefile.am   |1 +
>   osaf/services/saf/cpsv/cpnd/cpnd_db.c |6 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c|   73 ---
>   osaf/services/saf/cpsv/cpnd/cpnd_main.c   |7 +
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c|   86 

Re: [devel] [PATCH 7 of 8] ckpt: Add new test cases to verify long DN feature on CPSV [#1574] v1

2016-08-22 Thread A V Mahesh
ACK.

Not tested.

-AVM

On 8/18/2016 12:48 PM, Hoang Vo wrote:
>   tests/cpsv/Makefile.am  |1 +
>   tests/cpsv/test_cpa.c   |  180 
> +++-
>   tests/cpsv/test_cpa_util.c  |   16 +++-
>   tests/cpsv/test_cpsv.h  |6 +
>   tests/cpsv/test_cpsv_conf.h |3 +
>   5 files changed, 201 insertions(+), 5 deletions(-)
>
>
> diff --git a/tests/cpsv/Makefile.am b/tests/cpsv/Makefile.am
> --- a/tests/cpsv/Makefile.am
> +++ b/tests/cpsv/Makefile.am
> @@ -21,6 +21,7 @@ MAINTAINERCLEANFILES = Makefile.in
>   bin_PROGRAMS = ckpttest
>   
>   ckpttest_CPPFLAGS = \
> + -DSA_EXTENDED_NAME_SOURCE \
>   $(AM_CPPFLAGS) \
>   -I$(top_srcdir)/tests/unit_test_fw/inc \
>   -I$(top_srcdir)/osaf/libs/common/immsv/include \
> diff --git a/tests/cpsv/test_cpa.c b/tests/cpsv/test_cpa.c
> --- a/tests/cpsv/test_cpa.c
> +++ b/tests/cpsv/test_cpa.c
> @@ -1,6 +1,8 @@
>   #include 
>   #include 
>   
> +#include "saAis.h"
> +#include "osaf_extended_name.h"
>   #include "test_cpsv.h"
>   #include "test_cpsv_conf.h"
>   #include "ncs_main_papi.h"
> @@ -42,6 +44,10 @@ const char *saf_error_string[] = {
>   #define m_TEST_CPSV_PRINTF(...)
>   #endif
>   
> +#define VALID_EXTENDED_NAME_LENGTH 400
> +#define INVALID_EXTENDED_NAME_LENGTH 2049
> +
> +
>   extern int gl_prev_act;
>   
>   /** Ultility Functions /
> @@ -82,6 +88,18 @@ void printResult(int result)
>   
>   }
>   
> +bool is_extended_name_enable() {
> +
> +  char *extended_name_env = getenv("SA_ENABLE_EXTENDED_NAMES");
> +  if (extended_name_env == 0)
> +   return false;
> +
> +  if (strcmp(extended_name_env, "1") != 0)
> +   return false;
> +
> +  return true;
> +}
> +
>   void handleAssigner(SaInvocationT invocation, SaCkptCheckpointHandleT 
> checkpointHandle)
>   {
>  if (invocation == 1014)
> @@ -122,8 +140,7 @@ void fill_ckpt_attri(SaCkptCheckpointCre
>   
>   
> 
>   void fill_ckpt_name(SaNameT *name,char *string)
>   {
> -   strcpy((char *)name->value,string);
> -   name->length = strlen((char *)name->value);
> +   saAisNameLend(string, name);
>   }
>   
>   void fill_sec_attri(SaCkptSectionCreationAttributesT 
> *sec_cr_attr,SaCkptSectionIdT *sec,SaTimeT exp_time)
> @@ -279,6 +296,20 @@ void fill_testcase_data()
>  
> fill_ckpt_name(_replica_ckpt_large,"safCkpt=weak_replica_large_ckpt,safApp=safCkptService");
>  
> fill_ckpt_name(_ckpt_large,"safCkpt=collocated_large_ckpt,safApp=safCkptService");
>   
> +   char *ckpt_name = malloc(VALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, 0, VALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, '.', VALID_EXTENDED_NAME_LENGTH - 1);
> +   int length = sprintf(ckpt_name, 
> "safCkpt=all_replicas_ckpt_with_valid_extended_name_length");
> +   *(ckpt_name + length) = '.';
> +   saAisNameLend(ckpt_name, 
> _replicas_ckpt_with_valid_extended_name_length);
> +
> +   ckpt_name = malloc(INVALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, 0, INVALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, '.', INVALID_EXTENDED_NAME_LENGTH - 1);
> +   length = sprintf(ckpt_name, 
> "safCkpt=all_replicas_ckpt_with_invalid_extended_name_length");
> +   *(ckpt_name + length) = '.';
> +   saAisNameLend(ckpt_name, 
> _replicas_ckpt_with_invalid_extended_name_length);
> +
>  /* Variables for sec create */
>  tcd.sec_id1 = (SaUint8T*)"11";
>  tcd.section1.idLen = 2;
> @@ -451,6 +482,9 @@ void test_ckpt_cleanup(CPSV_CLEANUP_CKPT
> error = test_ckptUnlink(CKPT_UNLINK_SUCCESS9_T,TEST_CONFIG_MODE);
> break;
>   
> + case CPSV_CLEAN_ASYNC_ALL_REPLICAS_CKPT_EXTENDED_NAME:
> +  error = 
> test_ckptUnlink(CKPT_UNLINK_ALL_REPLICAS_EXTENDED_NAME_SUCCESS_T,TEST_CONFIG_MODE);
> +  break;
> }
>   
> if(error != TEST_PASS)
> @@ -2278,6 +2312,122 @@ final1:
> test_validate(result, TEST_PASS);
>   }
>   
> +void cpsv_it_open_55()
> +{
> +  int result;
> +  printHead("To verify creating a ckpt with valid extended name length");
> +
> +  /* Skip the test if Extended Name is not enable */
> +  if (is_extended_name_enable() == false)
> +   return test_validate(TEST_PASS, TEST_PASS);
> +
> +  result = test_ckptInitialize(CKPT_INIT_SUCCESS_T,TEST_CONFIG_MODE);
> +  if(result != TEST_PASS)
> + goto final1;
> +
> +  result = 
> test_ckptOpen(CKPT_OPEN_ALL_CREATE_EXTENDED_NAME_SUCCESS_T,TEST_NONCONFIG_MODE);
> +
> +  test_cpsv_cleanup(CPSV_CLEAN_INIT_SUCCESS_T);
> +
> +final1:
> +  printResult(result);
> +  test_validate(result, TEST_PASS);
> +}
> +
> +void cpsv_it_open_56()
> +{
> +  int result;
> +  printHead("To verify creating a ckpt with invalid extended name length");
> +
> +  /* Skip the test if Extended Name is not enable */
> +  if (is_extended_name_enable() == false)
> +   return test_validate(TEST_PASS, TEST_PASS);
> 

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA [#1574] v4

2016-08-22 Thread A V Mahesh
Hi Hoang,

ACK for  [PATCH 6 of 8]  with following minor comment
I think CPND should return SA_AIS_ERR_TOO_BIG = 26 instead of
SA_AIS_ERR_INVALID_PARAM ( please sync-up with other service return 
values ).

Note : tested default functionality , LONG DN functionality not tested 
in full fledged

-AVM


On 8/18/2016 12:48 PM, Hoang Vo wrote:
>   osaf/libs/agents/saf/cpa/cpa_api.c  |  12 
>   osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>   osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |   2 ++
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   2 +-
>   6 files changed, 18 insertions(+), 3 deletions(-)
>
>
> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c 
> b/osaf/libs/agents/saf/cpa/cpa_api.c
> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
> @@ -880,6 +880,10 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength) {
> + TRACE_LEAVE2("API return code = %u", SA_AIS_ERR_INVALID_PARAM);
> + return SA_AIS_ERR_INVALID_PARAM;
> + }
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -1192,6 +1196,10 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength) {
> + TRACE_LEAVE2("API return code = %u", SA_AIS_ERR_INVALID_PARAM);
> + return SA_AIS_ERR_INVALID_PARAM;
> + }
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -1597,6 +1605,10 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength) {
> + TRACE_LEAVE2("API return code = %u", SA_AIS_ERR_INVALID_PARAM);
> + return SA_AIS_ERR_INVALID_PARAM;
> + }
>   
>   /* retrieve CPA CB */
>   m_CPA_RETRIEVE_CB(cb);
> diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c 
> b/osaf/libs/agents/saf/cpa/cpa_mds.c
> --- a/osaf/libs/agents/saf/cpa/cpa_mds.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c
> @@ -515,9 +515,9 @@ static uint32_t cpa_mds_svc_evt(CPA_CB *
>  /* Populate & Send the Open Event to CPND */
>  memset(, 0, sizeof(CPSV_EVT));
>  evt.type = CPSV_EVT_TYPE_CPND;
> -evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
>  evt.info.cpnd.info.ckptListUpdate.client_hdl = 
> lc_node->cl_hdl;
>  osaf_extended_name_lend(lc_node->ckpt_name, 
> _name);
> +evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
>   
>  proc_rc = cpa_mds_msg_send(cb->cpa_mds_hdl, 
> >cpnd_mds_dest, , NCSMDS_SVC_ID_CPND);
>   
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -2378,6 +2378,7 @@ static uint32_t cpsv_encode_extended_nam
>   if(!osaf_is_an_extended_name(name))
>   return NCSCC_RC_SUCCESS;
>   
> + TRACE("length = %d", name->length);
>   SaConstStringT value = osaf_extended_name_borrow(name);
>   uint16_t length = osaf_extended_name_length(name);
>   
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_proc.c 
> b/osaf/services/saf/cpsv/cpd/cpd_proc.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_proc.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_proc.c
> @@ -61,9 +61,9 @@ uint32_t cpd_noncolloc_ckpt_rep_create(C
>   /* Send the Replica create info to CPND */
>   memset(_evt, 0, sizeof(CPSV_EVT));
>   send_evt.type = CPSV_EVT_TYPE_CPND;
> - send_evt.info.cpnd.type = CPND_EVT_D2ND_CKPT_CREATE;
>   
>   osaf_extended_name_lend(map_info->ckpt_name, 
> _evt.info.cpnd.info.ckpt_create.ckpt_name);
> + send_evt.info.cpnd.type = CPND_EVT_D2ND_CKPT_CREATE;
>   
>   d2nd_info = _evt.info.cpnd.info.ckpt_create.ckpt_info;
>   
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> @@ -4638,6 +4638,8 @@ uint32_t cpnd_evt_destroy(CPSV_EVT *evt)
>   if 
> (osaf_is_an_extended_name(>info.cpnd.info.ckptListUpdate.ckpt_name))
>   free((void 
> *)osaf_extended_name_borrow(>info.cpnd.info.ckptListUpdate.ckpt_name));
>   } else if (evt->info.cpnd.type == CPND_EVT_D2ND_CKPT_CREATE) {
> + if (evt->info.cpnd.info.ckpt_create.ckpt_info.dest_list != NULL)
> + 
> 

Re: [devel] [PATCH 4 of 8] cpsv: Add new message to support extended SaNameT [#1574] v3

2016-08-21 Thread A V Mahesh
Hi Hoang,

ACK for  [PATCH 4 of 8]   assuming unrequited comment code will be removed

Note : tested default functionality , LONG DN functionality not tested
in full fledged

-AVM


On 8/18/2016 12:48 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/cpsv_evt.c |  439 
> +-
>   osaf/libs/common/cpsv/include/cpsv_evt.h |   10 +
>   osaf/services/saf/cpsv/cpd/cpd_mds.c |   84 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c   |   86 +-
>   4 files changed, 581 insertions(+), 38 deletions(-)
>
>
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -30,11 +30,14 @@
>   
>   #include "cpsv.h"
>   #include "cpa_tmr.h"
> +#include "osaf_extended_name.h"
>   
>   FUNC_DECLARATION(CPSV_CKPT_DATA);
>   static SaCkptSectionIdT *cpsv_evt_dec_sec_id(NCS_UBAID *i_ub, uint32_t 
> svc_id);
>   static uint32_t cpsv_evt_enc_sec_id(NCS_UBAID *o_ub, SaCkptSectionIdT 
> *sec_id);
>   static void cpsv_convert_sec_id_to_string(char *sec_id_str, 
> SaCkptSectionIdT *section_id);
> +static uint32_t cpsv_encode_extended_name_flat(NCS_UBAID *uba, SaNameT 
> *name);
> +static uint32_t cpsv_decode_extended_name_flat(NCS_UBAID *uba, SaNameT 
> *name);
>   
>   const char *cpa_evt_str[] = {
>   "STRING_0",
> @@ -254,8 +257,8 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   case CPND_EVT_A2ND_CKPT_OPEN:
>   {
>   CPSV_A2ND_OPEN_REQ *info = >info.cpnd.info.openReq;
> - snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_OPEN(hdl=%llu, %s)",
> - info->client_hdl, info->ckpt_name.value);
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_OPEN_2(hdl=%llu, %s)",
> + info->client_hdl, 
> osaf_extended_name_borrow(>ckpt_name));
>   break;
>   }
>   case CPND_EVT_A2ND_CKPT_CLOSE:
> @@ -268,7 +271,7 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   case CPND_EVT_A2ND_CKPT_UNLINK:
>   {
>   CPSV_A2ND_CKPT_UNLINK *info = 
> >info.cpnd.info.ulinkReq;
> - snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_UNLINK(%s)", info->ckpt_name.value);
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_UNLINK_2(%s)", 
> osaf_extended_name_borrow(>ckpt_name));
>   break;
>   }
>   case CPND_EVT_A2ND_CKPT_RDSET:
> @@ -513,12 +516,22 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   case CPND_EVT_D2ND_CKPT_CREATE:
>   {
>   CPSV_D2ND_CKPT_CREATE *info = 
> >info.cpnd.info.ckpt_create;
> - snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, active=0x%X)",
> - info->ckpt_info.ckpt_id, info->ckpt_name.value,
> + snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE_2(%s, create_rep=%s, is_act=%s, active=0x%X, 
> dest_cnt=%d)",
> + info->ckpt_info.ckpt_id, 
> osaf_extended_name_borrow(>ckpt_name),
>   info->ckpt_info.ckpt_rep_create ? "true" : 
> "false",
> - 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest));
> + info->ckpt_info.is_active_exists ? "true" : 
> "false",
> + 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest),
> + info->ckpt_info.dest_cnt);
> +
> + SaCkptCheckpointCreationAttributesT *attr = 
> >ckpt_info.attributes;
> + TRACE("mSecS=%lld, flags=%d, mSec=%d, mSecIdS=%lld, 
> ret=%lld, ckptS=%lld", attr->maxSectionSize,
> + attr->creationFlags, attr->maxSections, 
> attr->maxSectionIdSize, attr->retentionDuration,
> + attr->checkpointSize);
> + for (int i = 0; i < info->ckpt_info.dest_cnt; i++)
> + TRACE("dest[%d] = 0x%" PRIX64 " ", i, 
> info->ckpt_info.dest_list[i].dest);
>   break;
>   }
> +
>   case CPND_EVT_D2ND_CKPT_DESTROY:
>   {
>   snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_DESTROY", evt->info.cpnd.info.ckpt_destroy.ckpt_id);
> @@ -608,8 +621,8 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   case CPND_EVT_A2ND_CKPT_LIST_UPDATE:
>   {
>   CPSV_A2ND_CKPT_LIST_UPDATE *info = 
> >info.cpnd.info.ckptListUpdate;
> - snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_LIST_UPDATE(hdl=%llu, %s)",
> - info->client_hdl, info->ckpt_name.value);
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_LIST_UPDATE_2(hdl=%llu, %s)",
> +

Re: [devel] [PATCH 3 of 8] cpa: Add support for extended SaNameT [#1574] v1

2016-08-21 Thread A V Mahesh
Hi Hoang,

ACK for  [PATCH 3 of 8]   with following minor comment
I think API should return SA_AIS_ERR_TOO_BIG = 26 instead of
SA_AIS_ERR_INVALID_PARAM ( please sync-up with other service return 
values ).

Note : tested default functionality , LONG DN functionality not tested 
in full fledged

-AVM

On 8/18/2016 12:48 PM, Hoang Vo wrote:
>   osaf/libs/agents/saf/cpa/Makefile.am |   1 +
>   osaf/libs/agents/saf/cpa/cpa_api.c   |  36 
> 
>   osaf/libs/agents/saf/cpa/cpa_db.c|   2 +
>   osaf/libs/agents/saf/cpa/cpa_mds.c   |   2 +-
>   osaf/libs/agents/saf/cpa/cpa_proc.c  |   2 +-
>   osaf/libs/common/cpsv/include/cpa.h  |   1 +
>   osaf/libs/common/cpsv/include/cpa_cb.h   |   2 +-
>   osaf/libs/common/cpsv/include/cpa_proc.h |   2 +-
>   8 files changed, 26 insertions(+), 22 deletions(-)
>
>
> diff --git a/osaf/libs/agents/saf/cpa/Makefile.am 
> b/osaf/libs/agents/saf/cpa/Makefile.am
> --- a/osaf/libs/agents/saf/cpa/Makefile.am
> +++ b/osaf/libs/agents/saf/cpa/Makefile.am
> @@ -22,6 +22,7 @@ noinst_LTLIBRARIES = libcpa.la
>   
>   libcpa_la_CPPFLAGS = \
>   -DNCS_CPA=1 \
> + -DSA_EXTENDED_NAME_SOURCE \
>   $(AM_CPPFLAGS) \
>   -I$(top_srcdir)/osaf/libs/common/cpsv/include
>   
> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c 
> b/osaf/libs/agents/saf/cpa/cpa_api.c
> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
> @@ -870,19 +870,20 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   bool locked = false;
>   uint32_t time_out=0;
>   CPA_GLOBAL_CKPT_NODE *gc_node = NULL;
> + SaConstStringT ckpt_name = NULL;
>   
>   TRACE_ENTER2("SaCkptCheckpointHandleT passed is %llx",ckptHandle);
> - if ((checkpointName == NULL) || (checkpointHandle == NULL) || 
> (checkpointName->length == 0)) {
> + if ((checkpointName == NULL) || (checkpointHandle == NULL) || 
> (osaf_extended_name_length(checkpointName) == 0)) {
>   TRACE_4("Cpa CkptOpen Api failed with return 
> value:%d,ckptHandle:%llx", SA_AIS_ERR_INVALID_PARAM, ckptHandle);
>   TRACE_LEAVE2("API return code = %u", rc);
>   return SA_AIS_ERR_INVALID_PARAM;
>   }
>   
> - m_CPSV_SET_SANAMET(checkpointName);
> + ckpt_name = osaf_extended_name_borrow(checkpointName);
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> -if (strncmp((const char *)checkpointName->value, "safCkpt=", 8) != 
> 0) {
> +if (strncmp(ckpt_name, "safCkpt=", 8) != 0) {
>   TRACE_4("Cpa CkptOpen:DN failed with return 
> value:%d,ckptHandle:%llx", SA_AIS_ERR_INVALID_PARAM, ckptHandle);
>   TRACE_LEAVE2("API return code = %u", rc);
>   return SA_AIS_ERR_INVALID_PARAM;
[AVM] I think this should return SA_AIS_ERR_TOO_BIG = 26 ( please 
sync-up with other service return values )
> @@ -909,7 +910,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   
>   
>   /* Draft Validations */
> - rc = cpa_open_attr_validate(checkpointCreationAttributes, 
> checkpointOpenFlags, checkpointName);
> + rc = cpa_open_attr_validate(checkpointCreationAttributes, 
> checkpointOpenFlags);
>   if (rc != SA_AIS_OK) {
>   /* No need to log, already logged inside the 
> cpa_open_attr_validate */
>   goto done;
> @@ -965,7 +966,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   lc_node->cl_hdl = ckptHandle;
>   lc_node->open_flags = checkpointOpenFlags;
>   
> - lc_node->ckpt_name = *checkpointName;
> + lc_node->ckpt_name = strdup(ckpt_name);
>   
>   /* Add CPA_LOCAL_CKPT_NODE to lcl_ckpt_hdl_tree */
>   proc_rc = cpa_lcl_ckpt_node_add(>lcl_ckpt_tree, lc_node);
> @@ -984,7 +985,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> - evt.info.cpnd.info.openReq.ckpt_name = *checkpointName;
> + osaf_extended_name_lend(ckpt_name, 
> _name);
>   
>   if (checkpointCreationAttributes) {
>   evt.info.cpnd.info.openReq.ckpt_attrib = 
> *checkpointCreationAttributes;
> @@ -1128,6 +1129,7 @@ gl_node_add_fail:
>   
>lc_node_add_fail:
>   if (lc_node != NULL) {
> + free((void *)lc_node->ckpt_name);
>   m_MMGR_FREE_CPA_LOCAL_CKPT_NODE(lc_node);
>   }
>   
> @@ -1179,6 +1181,7 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   CPA_LOCAL_CKPT_NODE *lc_node = NULL;
>   CPA_CLIENT_NODE *cl_node = NULL;
>   uint32_t proc_rc = NCSCC_RC_SUCCESS;
> + SaConstStringT ckpt_name = NULL;
>   
>   TRACE_ENTER2("SaCkptCheckpointHandleT passed is %llx",ckptHandle);
>   
> @@ -1188,19 +1191,17 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   return SA_AIS_ERR_INVALID_PARAM;
>   }
>   
> 

Re: [devel] [PATCH 1 of 1] MDS: Log TIPC dropped messages [#1957]

2016-08-19 Thread A V Mahesh
Ok

I need some time to  re-check the TIPC code , will back to you soon.

-AVM


On 8/19/2016 1:46 PM, Hans Nordebäck wrote:
> Hi Mahesh,
>
> there is a problem that TIPC may silently drop messages at overload 
> situations, as MDS uses the SOCK_RDM option.
>
> At least it has to be logged when messages are dropped. It is allowed 
> in TIPC to set TIPC_DROPPABLE=false and also
>
> use multicast. The concern may be that the send buffer size may also 
> be overloaded at receive buffer full,
>
> as the ancillary message has to be  sent, this case is though very 
> unlikely.
>
> I'll update the patch with the logging of the returned message 
> removed, and only log that a message has been dropped, which
>
> should be enough for debugging purposes.
>
> /Thanks HansN
>
>
>
> On 08/18/2016 11:27 AM, A V Mahesh wrote:
>> Hi HansN,
>>
>> It seem you missed to see below :
>>
>> On 8/12/2016 9:11 AM, A V Mahesh wrote:
>>> Hi HansN,
>>>
>>> We were having ticket for this  raised by  Hans Feldt 
>>> `https://sourceforge.net/p/opensaf/tickets/634/`
>>>
>>> at that time i have give my analysis base the MDS code at that time 
>>> as below please check.
>>>
>>> 
>>>  
>>>
>>>
>>> The Linux TIPC 2.0 Programmer's Guide in section 1.5.7. Multicast 
>>> Message Delivery mention that.
>>>
>>> The TIPC currently does not permit an application to send a 
>>> multicast message with the "destination droppable" setting disabled.
>>> Consequently, TIPC will never try to return an undeliverable 
>>> multicast message to its sender.
>>>
>>> so if we set destination droppable disabled , multicast is not 
>>> permitted
>>> I experimented setting TIPC_DEST_DROPPABLE=off in multicast_demo and 
>>> observed that multicast is working
>>>
>>> As if The Opensaf using multicast , it is not allowed to set 
>>> TIPC_DEST_DROPPABLE=off
>>>
>>> ==
>>>  
>>
>>
>>
>> So the TIPC_DEST_DROPPABLE should be enabled only if 
>> MDS_TIPC_MCAST_ENABLED is disabled,
>> currently  by default TIPC Multicast Messaging Setting  enabled 
>> (MDS_TIPC_MCAST_ENABLED =1 )
>> in /etc/opensaf/nid.conf , if TIPC Multicast Messagingis disabled we 
>> can set  TIPC_DEST_DROPPABLE
>> dynamically.
>>
>> == 
>>
>>
>> # This is valid when above MDS_TRANSPORT is set to TIPC.
>> # Setting MDS_TIPC_MCAST_ENABLED to 1 or 0, allows OpenSAF
>> # to enable or disable TIPC Multicast Messaging.
>> # By Default TIPC  Multicast Messaging is Enabled.
>> # Note: In case of TIPC Multicast Messaging disabled (0), the 
>> performance
>> # of OpenSAF will be considerably lower as compared to Enabled (1).
>> export MDS_TIPC_MCAST_ENABLED=1
>>
>> == 
>>
>>
>> -AVM
>>
>>
>> On 8/18/2016 2:43 PM, Hans Nordeback wrote:
>>>   osaf/libs/core/mds/mds_dt_tipc.c |  32 
>>> +---
>>>   1 files changed, 25 insertions(+), 7 deletions(-)
>>>
>>>
>>> diff --git a/osaf/libs/core/mds/mds_dt_tipc.c 
>>> b/osaf/libs/core/mds/mds_dt_tipc.c
>>> --- a/osaf/libs/core/mds/mds_dt_tipc.c
>>> +++ b/osaf/libs/core/mds/mds_dt_tipc.c
>>> @@ -320,6 +320,15 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid,
>>>   m_MDS_LOG_INFO("MDTM: Successfully set default 
>>> socket option TIPC_IMP = %d", TIPCIMPORTANCE);
>>>   }
>>>   +int droppable = 0;
>>> +if (setsockopt(tipc_cb.BSRsock, SOL_TIPC, 
>>> TIPC_DEST_DROPPABLE, , sizeof(droppable)) != 0) {
>>> +LOG_ER("MDTM: Can't set TIPC_DEST_DROPPABLE to zero 
>>> err :%s\n", strerror(errno));
>>> +m_MDS_LOG_ERR("MDTM: Can't set TIPC_DEST_DROPPABLE 
>>> to zero err :%s\n", strerror(errno));
>>> +osafassert(0);
>>> +} else {
>>> +m_MDS_LOG_NOTIFY("MDTM: Successfully set 
>>> TIPC_DEST_DROPPABLE to zero");
>>> +}
>>> +
>>>   return NCSCC_RC_SUCCESS;
>>>   }
>>>   @@ -

Re: [devel] [PATCH 1 of 1] MDS: Log TIPC dropped messages [#1957]

2016-08-18 Thread A V Mahesh
Hi HansN,

It seem you missed to see below :

On 8/12/2016 9:11 AM, A V Mahesh wrote:
> Hi HansN,
>
> We were having ticket for this  raised by  Hans Feldt 
> `https://sourceforge.net/p/opensaf/tickets/634/`
>
> at that time i have give my analysis base the MDS code at that time as 
> below please check.
>
> 
>  
>
>
> The Linux TIPC 2.0 Programmer's Guide in section 1.5.7. Multicast 
> Message Delivery mention that.
>
> The TIPC currently does not permit an application to send a multicast 
> message with the "destination droppable" setting disabled.
> Consequently, TIPC will never try to return an undeliverable multicast 
> message to its sender.
>
> so if we set destination droppable disabled , multicast is not permitted
> I experimented setting TIPC_DEST_DROPPABLE=off in multicast_demo and 
> observed that multicast is working
>
> As if The Opensaf using multicast , it is not allowed to set 
> TIPC_DEST_DROPPABLE=off
>
> ==
>  

So the TIPC_DEST_DROPPABLE should be enabled only if 
MDS_TIPC_MCAST_ENABLED is disabled,
currently  by default TIPC Multicast Messaging Setting  enabled 
(MDS_TIPC_MCAST_ENABLED =1 )
in /etc/opensaf/nid.conf , if TIPC Multicast Messagingis disabled we can 
set  TIPC_DEST_DROPPABLE
dynamically.

==

# This is valid when above MDS_TRANSPORT is set to TIPC.
# Setting MDS_TIPC_MCAST_ENABLED to 1 or 0, allows OpenSAF
# to enable or disable TIPC Multicast Messaging.
# By Default TIPC  Multicast Messaging is Enabled.
# Note: In case of TIPC Multicast Messaging disabled (0), the performance
# of OpenSAF will be considerably lower as compared to Enabled (1).
export MDS_TIPC_MCAST_ENABLED=1

==

-AVM


On 8/18/2016 2:43 PM, Hans Nordeback wrote:
>   osaf/libs/core/mds/mds_dt_tipc.c |  32 +---
>   1 files changed, 25 insertions(+), 7 deletions(-)
>
>
> diff --git a/osaf/libs/core/mds/mds_dt_tipc.c 
> b/osaf/libs/core/mds/mds_dt_tipc.c
> --- a/osaf/libs/core/mds/mds_dt_tipc.c
> +++ b/osaf/libs/core/mds/mds_dt_tipc.c
> @@ -320,6 +320,15 @@ uint32_t mdtm_tipc_init(NODE_ID nodeid,
>   m_MDS_LOG_INFO("MDTM: Successfully set default socket 
> option TIPC_IMP = %d", TIPCIMPORTANCE);
>   }
>   
> +int droppable = 0;
> +if (setsockopt(tipc_cb.BSRsock, SOL_TIPC, TIPC_DEST_DROPPABLE, 
> , sizeof(droppable)) != 0) {
> +LOG_ER("MDTM: Can't set TIPC_DEST_DROPPABLE to zero err 
> :%s\n", strerror(errno));
> +m_MDS_LOG_ERR("MDTM: Can't set TIPC_DEST_DROPPABLE to zero 
> err :%s\n", strerror(errno));
> +osafassert(0);
> +} else {
> +m_MDS_LOG_NOTIFY("MDTM: Successfully set TIPC_DEST_DROPPABLE 
> to zero");
> +}
> +
>   return NCSCC_RC_SUCCESS;
>   }
>   
> @@ -563,6 +572,8 @@ ssize_t recvfrom_connectionless (int sd,
>   unsigned char *cptr;
>   int i;
>   int has_addr;
> + int anc_data[2];
> +
>   ssize_t sz;
>   
>   has_addr = (from != NULL) && (addrlen != NULL);
> @@ -591,19 +602,26 @@ ssize_t recvfrom_connectionless (int sd,
>  if the message was sent using a TIPC name or name 
> sequence as the
>  destination rather than a TIPC port ID So abort for 
> TIPC_ERRINFO and TIPC_RETDATA*/
>   if (anc->cmsg_type == TIPC_ERRINFO) {
> - /* TIPC_ERRINFO - TIPC error code associated 
> with a returned data message or a connection termination message  so abort */
> - m_MDS_LOG_CRITICAL("MDTM: undelivered message 
> condition ancillary data: TIPC_ERRINFO abort err :%s", strerror(errno) );
> - abort();
> + anc_data[0] = *((unsigned int*)(CMSG_DATA(anc) 
> + 0));
> + if (anc_data[0] == TIPC_ERR_OVERLOAD) {
> + LOG_CR("MDTM: undelivered message 
> condition ancillary data: TIPC_ERR_OVERLOAD");
> + m_MDS_LOG_CRITICAL("MDTM: undelivered 
> message condition ancillary data: TIPC_ERR_OVERLOAD");
> + } else {
> + /* TIPC_ERRINFO - TIPC error code 
> associated with a returned data message

Re: [devel] [PATCH 1 of 1] log: fix ER in syslog if changing saLogStreamFileName and other atrributes[#1887]

2016-08-16 Thread A V Mahesh
Hi,

ACK , tested

Please re-base before publishing.

-AVM


On 8/4/2016 9:36 AM, Canh Van Truong wrote:
>   osaf/services/saf/logsv/lgs/lgs_imm.cc |  52 
> +-
>   1 files changed, 26 insertions(+), 26 deletions(-)
>
>
> When changing saLogStreamFileName  with other attributes, the action
> "closing current log file", "rename", "create new cfg and log file" are
> duplicated. This cause the ER in syslog, because lgsv can not find log
> file when closing secondly. Name of current log file was changed at first 
> time.
>
> This patch make lgsv just do above action only once.
>
> diff --git a/osaf/services/saf/logsv/lgs/lgs_imm.cc 
> b/osaf/services/saf/logsv/lgs/lgs_imm.cc
> --- a/osaf/services/saf/logsv/lgs/lgs_imm.cc
> +++ b/osaf/services/saf/logsv/lgs/lgs_imm.cc
> @@ -2275,7 +2275,7 @@ static void stream_ccb_apply_modify(cons
>   bool new_cfg_file_needed = false;
>   struct timespec curtime_tspec;
>   std::string fileName;
> - bool modify = false;
> + bool stream_filename_modified = false;
>   
>   TRACE_ENTER2("CCB ID %llu, '%s'", opdata->ccbId, 
> opdata->objectName.value);
>   
> @@ -2295,7 +2295,7 @@ static void stream_ccb_apply_modify(cons
>   
>   if (!strcmp(attribute->attrName, "saLogStreamFileName")) {
>   fileName = *((char **)value);
> - modify = true;
> + stream_filename_modified = true;
>   } else if (!strcmp(attribute->attrName, 
> "saLogStreamMaxLogFileSize")) {
>   SaUint64T maxLogFileSize = *((SaUint64T *)value);
>   stream->maxLogFileSize = maxLogFileSize;
> @@ -2337,7 +2337,30 @@ static void stream_ccb_apply_modify(cons
>   time_t cur_time = curtime_tspec.tv_sec;
>   std::string root_path = static_cast *>(lgs_cfg_get(LGS_IMM_LOG_ROOT_DIRECTORY));
>   
> - if (new_cfg_file_needed) {
> + /* Fix for ticket #1346 */
> + if (stream_filename_modified) {
> + int rc;
> + if ((rc = log_stream_config_change(!LGS_STREAM_CREATE_FILES,
> + root_path, stream, current_logfile_name, _time))
> + != 0) {
> + LOG_ER("log_stream_config_change failed: %d", rc);
> + }
> +
> + stream->fileName = fileName;
> +
> + if ((rc = lgs_create_config_file_h(root_path, stream)) != 0) {
> + LOG_ER("lgs_create_config_file_h failed: %d", rc);
> + }
> +
> + char *current_time = lgs_get_time(_time);
> + stream->logFileCurrent = stream->fileName + "_" + current_time;
> +
> + // Create the new log file based on updated configuration
> + if ((*stream->p_fd = log_file_open(root_path,
> + stream, stream->logFileCurrent, NULL)) == -1)
> + LOG_ER("New log file could not be created for stream: 
> %s",
> + stream->name);
> + } else if (new_cfg_file_needed) {
>   int rc;
>   if ((rc = log_stream_config_change(LGS_STREAM_CREATE_FILES,
>   root_path, stream,
> @@ -2347,29 +2370,6 @@ static void stream_ccb_apply_modify(cons
>   }
>   }
>   
> - /* Fix for ticket #1346 */
> - if (modify) {
> - int rc;
> - if ((rc = log_stream_config_change(!LGS_STREAM_CREATE_FILES,
> - root_path, stream, current_logfile_name, _time))
> - != 0) {
> - LOG_ER("log_stream_config_change failed: %d", rc);
> - }
> -
> - stream->fileName = fileName;
> -
> - if ((rc = lgs_create_config_file_h(root_path, stream)) != 0) {
> - LOG_ER("lgs_create_config_file_h failed: %d", rc);
> - }
> -
> - char *current_time = lgs_get_time(_time);
> - stream->logFileCurrent = stream->fileName + "_" + current_time;
> -
> - // Create the new log file based on updated configuration
> - *stream->p_fd = log_file_open(root_path,
> - stream, stream->logFileCurrent, NULL);
> - }
> -
>   /* Checkpoint to standby LOG server */
>   /* Save time change was done for standby */
>   stream->act_last_close_timestamp = cur_time;


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


Re: [devel] [PATCH 1 of 1] clm: fix string format for size_t type [#1906]

2016-08-16 Thread A V Mahesh
Hi Zoran,

ACK Not tested.

-AVM


On 8/16/2016 3:01 PM, Zoran Milinkovic wrote:
>   osaf/services/saf/clmsv/clms/clms_imm.c |  2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> Fix string format for size_t type, so that 32-bit compilers can compile 
> OpenSAF without errors.
>
> diff --git a/osaf/services/saf/clmsv/clms/clms_imm.c 
> b/osaf/services/saf/clmsv/clms/clms_imm.c
> --- a/osaf/services/saf/clmsv/clms/clms_imm.c
> +++ b/osaf/services/saf/clmsv/clms/clms_imm.c
> @@ -225,7 +225,7 @@ CLMS_CLUSTER_NODE *clms_node_new(SaNameT
>   SaNameT *name = (SaNameT *)value;
>   size_t nameLen = osaf_extended_name_length(name);
>   
> - TRACE("saClmNodeEE attribute name's length %lu", 
> nameLen);
> + TRACE("saClmNodeEE attribute name's length %zu", 
> nameLen);
>   
>   if (nameLen != 0) {
>   if (nameLen >= SA_MAX_NAME_LENGTH) {
>
> --
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


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


Re: [devel] [PATCH 1 of 1] clm: fix decoding for SaNameT type [#1906]

2016-08-16 Thread A V Mahesh
Hi Zoran,

ACK tested.

-AVM


On 8/16/2016 1:31 PM, Zoran Milinkovic wrote:
>   osaf/libs/common/clmsv/clmsv_enc_dec.c |  3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
>
> Add null-terminated string to the end of decoded string for SaNameT type.
>
> diff --git a/osaf/libs/common/clmsv/clmsv_enc_dec.c 
> b/osaf/libs/common/clmsv/clmsv_enc_dec.c
> --- a/osaf/libs/common/clmsv/clmsv_enc_dec.c
> +++ b/osaf/libs/common/clmsv/clmsv_enc_dec.c
> @@ -36,11 +36,12 @@ uint32_t clmsv_decodeSaNameT(NCS_UBAID *
>   osafassert(0);
>   }
>   if(length >= SA_MAX_NAME_LENGTH) {
> - value = (char *)calloc(1, length + 1);
> + value = (char *)malloc(length + 1);
>   }
>   ncs_dec_skip_space(uba, 2);
>   total_bytes += 2;
>   ncs_decode_n_octets_from_uba(uba, (uint8_t *)value, (uint32_t)length);
> + value[length] = 0;
>   osaf_extended_name_lend(value, name);
>   total_bytes += length;
>   return total_bytes;
>
> --
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


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


Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V4

2016-08-16 Thread A V Mahesh
This patch still has the problem

Bring SC-2 as standby ( With this patch ) & Brint SC-1 Active ( With out 
this patch )

And run following test case on SC-2( With this patch node )

1) Init with general callback
2) Asynchrously opened ckpt



SC-1:/var/crash/opensaf # Aug 16 13:38:41 SC-1 osafimmnd[3583]: NO 
Implementer (applier) connected: 16 (@safAmfService2010f) <126, 2010f>
Aug 16 13:38:42 SC-1 osafimmnd[3583]: NO Implementer (applier) 
connected: 17 (@OpenSafImmReplicatorB) <170, 2010f>
Aug 16 13:38:42 SC-1 osafntfimcnd[3789]: NO Started
Aug 16 13:38:44 SC-1 osafamfd[3623]: NO Cold sync complete!
Aug 16 13:39:10 SC-1 osafimmnd[3583]: NO Ccb 2 COMMITTED (immcfg_PL-4_9452)
Aug 16 13:39:10 SC-1 osafimmnd[3583]: NO Ccb 3 COMMITTED (safImmService)
Aug 16 13:39:12 SC-1 sudo:  tet : TTY=unknown ; PWD=/tmp/03805aa ; 
USER=root ; COMMAND=/usr/bin/pkill -u root -P 1 mqsv_a
Aug 16 13:39:12 SC-1 osafckptd[3659]: hj_enc.c:311: 
decode_flatten_space: Assertion 'p8' failed.
Aug 16 13:39:12 SC-1 osafamfnd[3633]: NO 
'safComp=CPD,safSu=SC-1,safSg=2N,safApp=OpenSAF' faulted due to 
'avaDown' : Recovery is 'nodeFailfast'
Aug 16 13:39:12 SC-1 osafamfnd[3633]: ER 
safComp=CPD,safSu=SC-1,safSg=2N,safApp=OpenSAF Faulted due to:avaDown 
Recovery is:nodeFailfast
Aug 16 13:39:12 SC-1 osafamfnd[3633]: Rebooting OpenSAF NodeId = 131343 
EE Name = , Reason: Component faulted: recovery is node failfast, 
OwnNodeId = 131343, SupervisionTime = 60
Aug 16 13:39:12 SC-1 opensaf_reboot: Rebooting local node; timeout=60
Aug 16 13:39:13 SC-1 sudo:  tet : TTY=unknown ; PWD=/tmp/03805aa ; 
USER=root ; COMMA

=

-AVM

On 8/12/2016 11:41 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your help.
> I send the attached patch that fix missing in encode/decode function.
>
> Thank you and best regards,
> Hoang
>
> -----Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Friday, August 12, 2016 10:15 AM
> To: Vo Minh Hoang <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
> node [#1669] V4
>
> I will test for you send the patch.
>
> -AVM
>
>
> On 8/11/2016 3:38 PM, Vo Minh Hoang wrote:
>> Dear Mahesh,
>>
>> Would you please tell me the case that produce this error?
>> I review source code and found that encode/decode function missed 1
>> attribute.
>> But running test in our environment could not reproduce this problem.
>>
>> Thank you and best regards,
>> Hoang
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, August 9, 2016 4:35 PM
>> To: Hoang Vo <hoang.m...@dektech.com.au>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for
>> each node [#1669] V4
>>
>> Hi Hoang ,
>>
>> Please hold on pushing.
>>
>> On new node we have see some issue please check CPD enode and decode
>> once ( new patch node ) .
>>
>> Aug  9 14:23:01 SC-1 osafckptd[20478]: hj_enc.c:311:
>> decode_flatten_space: Assertion 'p8' failed.
>> Aug  9 14:23:01 SC-1 osafamfnd[20439]: NO
>> 'safComp=CPD,safSu=SC-1,safSg=2N,safApp=OpenSAF' faulted due to 'avaDown'
> :
>> Recovery is 'nodeFailfast'
>>
>> -AVM
>>
>>
>>
>> On 8/9/2016 2:09 PM, A V Mahesh wrote:
>>> ACK,
>>>
>>> -AVM
>>>
>>>
>>> On 8/3/2016 4:02 PM, Hoang Vo wrote:
>>>> osaf/libs/common/cpsv/include/cpd_cb.h |2 +
>>>> osaf/libs/common/cpsv/include/cpd_proc.h |3 +
>>>> osaf/libs/common/cpsv/include/cpd_red.h  |   13 ++
>>>> osaf/libs/common/cpsv/include/cpsv_evt.h |8 +
>>>> osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 ++-
>>>> osaf/services/saf/cpsv/cpd/cpd_evt.c |8 +
>>>> osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   96 ---
>>>> osaf/services/saf/cpsv/cpd/cpd_proc.c|  148
>>>> +++
>>>> osaf/services/saf/cpsv/cpd/cpd_red.c |   30 -
>>>> osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   57 +--
>>>> 10 files changed, 344 insertions(+), 35 deletions(-)
>>>>
>>>>
>>>> Problem:
>>>> ---
>>>> The saCkptCheckpointNumOpeners is not updated when a node which has
>>>> a

Re: [devel] [PATCH 1 of 1] cpd: handle BAD_HANDLE from saClmDispatch [#1822]

2016-08-16 Thread A V Mahesh
Hi Hoang,

ACK tested with normal configuration .

Note : not created error  SA_AIS_ERR_BAD_HANDLE.

-AVM


On 8/16/2016 12:15 PM, Hoang Vo wrote:
>   osaf/services/saf/cpsv/cpd/cpd_init.c |  67 
> ++-
>   1 files changed, 66 insertions(+), 1 deletions(-)
>
>
> Problem:
> ---
> cpd doesn't seem to currently recover from BAD_HANDLE when calling 
> saClmDispatch()
> This is important if a node is promoted to a controller.
>
> Solution:
> 
> Re-initialize CLM HANDLE
>
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_init.c 
> b/osaf/services/saf/cpsv/cpd/cpd_init.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_init.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_init.c
> @@ -61,6 +61,8 @@ static uint32_t cpd_lib_destroy(CPD_DEST
>   
>   static bool cpd_clear_mbx(NCSCONTEXT arg, NCSCONTEXT msg);
>   
> +static SaAisErrorT cpd_clm_init_bg(CPD_CB *cb);
> +
>   void cpd_main_process(CPD_CB *cb);
>   
>   
> /
> @@ -200,6 +202,63 @@ done:
>   }
>   
>   
> /
> + * Name  : cpd_clm_init_thread
> + *
> + * Description   : This function is thread function to initialize clm
> + *
> + * Arguments : -
> + *
> + * Return Values : -
> + *
> + * Notes : None.
> + 
> */
> +static void* cpd_clm_init_thread(void* arg)
> +{
> + CPD_CB *cb = (CPD_CB*)arg;
> +
> + TRACE_ENTER();
> +
> + SaAisErrorT rc = cpd_clm_init(cb);
> + if (rc != SA_AIS_OK) {
> + exit(EXIT_FAILURE);
> + }
> +
> + /* Notify main process to update clm select object */
> + ncs_sel_obj_ind((NCS_SEL_OBJ*)>clm_sel_obj);
> +
> + TRACE_LEAVE();
> + return NULL;
> +}
> +
> +/
> + * Name  : cpd_clm_init_bg
> + *
> + * Description   : This function is to start initialize clm thread
> + *
> + * Arguments : -
> + *
> + * Return Values : -
> + *
> + * Notes : None.
> + 
> */
> +static SaAisErrorT cpd_clm_init_bg(CPD_CB *cb)
> +{
> + pthread_t thread;
> + pthread_attr_t attr;
> + pthread_attr_init();
> + pthread_attr_setdetachstate(, PTHREAD_CREATE_DETACHED);
> +
> + if (pthread_create(, , cpd_clm_init_thread, cb) != 0) {
> + LOG_ER("pthread_create FAILED: %s", strerror(errno));
> + exit(EXIT_FAILURE);
> + }
> +
> + pthread_attr_destroy();
> +
> + return SA_AIS_OK;
> +}
> +
> +/
>* Name  : cpd_lib_init
>*
>* Description   : This is the function which initalize the CPD libarary.
> @@ -572,7 +631,13 @@ void cpd_main_process(CPD_CB *cb)
>   if (fds[FD_CLM].revents & POLLIN) {
>   /* dispatch all the CLM pending function */
>   error = saClmDispatch(cb->clm_hdl, SA_DISPATCH_ALL);
> - if (error != SA_AIS_OK) {
> + if (error == SA_AIS_ERR_BAD_HANDLE) {
> + LOG_NO("Bad CLM handle. Reinitializing.");
> + osaf_nanosleep();
> + cpd_clm_init_bg(cb);
> + /* Ignore the FD_CLM */
> + fds[FD_CLM].fd = -1;
> + } else if (error != SA_AIS_OK) {
>   LOG_ER("saClmDispatch failed: %u", error);
>   }
>   }


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


Re: [devel] osafclmna[5375]: ER Exiting

2016-08-16 Thread A V Mahesh

I was starting SC-2 as Active

-AVM


On 8/16/2016 12:07 PM, A V Mahesh wrote:
> Hi Zoran Milinkovic,
>
> It seems some problem with thees patches :
>
> Opensaf is not comingup with error  `SC-2 osafclmna[5375]: ER*SC-2m* 
> is not a configured node` & ` SC-2 osafclmna[5375]: ER Exiting`
>
> =
> changeset:   7855:bc669776cf7f
> tag: tip
> user:Zoran Milinkovic <zoran.milinko...@ericsson.com>
> date:Mon Aug 15 09:38:00 2016 +0530
> summary: clm: add support for long RDN [#1906]
>
> changeset:   7854:e9a1f9f7e1fb
> parent:  7851:6ba070e84429
> user:Zoran Milinkovic <zoran.milinko...@ericsson.com>
> date:Mon Aug 15 09:22:54 2016 +0530
> summary: clm: fix return error codes in IMM callbacks [#1917]
>
> changeset:   7853:b0aa865e70df
> branch:  opensaf-5.0.x
> parent:  7844:c603424ffe8d
> user:Zoran Milinkovic <zoran.milinko...@ericsson.com>
> date:Mon Aug 15 09:22:54 2016 +0530
> summary: clm: fix return error codes in IMM callbacks [#1917]
>
>
> =
>
>
> Configured Opensaf as follws :
>
>  ./bootstrap.sh ;./configure --enable-imm-pbe --enable-tests 
> --enable-tipc --enable-ntf-imcn
>
>
>
> Aug 16 12:00:09 SC-2 osafntfimcnd[5448]: NO Started
> Aug 16 12:00:09 SC-2 osafclmd[5455]: Started
> Aug 16 12:00:09 SC-2 osafimmnd[5414]: NO Implementer connected: 4 
> (safClmService) <21, 2020f>
> Aug 16 12:00:09 SC-2 osafimmnd[5414]: NO implementer for class 
> 'SaClmNode' is safClmService => class extent is safe.
> Aug 16 12:00:09 SC-2 osafimmnd[5414]: NO implementer for class 
> 'SaClmCluster' is safClmService => class extent is safe.
> Aug 16 12:00:09 SC-2 osafclmd[5455]: NO Node 'SC-2m' requests to join 
> the cluster but is unconfigured
> Aug 16 12:00:09 SC-2 osafclmna[5375]: ER SC-2m is not a configured node
> Aug 16 12:00:09 SC-2 osafclmna[5375]: ER Exiting
> Aug 16 12:00:10 SC-2 osafamfd[5465]: Started
> Aug 16 12:00:10 SC-2 osafimmnd[5414]: NO Implementer connected: 5 
> (safAmfService) <26, 2020f>
> Aug 16 12:00:10 SC-2 osafimmnd[5414]: NO implementer for class 
> 'SaAmfCompBaseType' is safAmfService => class extent is safe.
> Aug 16 12:00:10 SC-2 osafimmnd[5414]: NO implementer for class 
> 'SaAmfSUBaseType' is safAmfServ
>
> -AVM


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


[devel] osafclmna[5375]: ER Exiting

2016-08-16 Thread A V Mahesh
Hi Zoran Milinkovic,

It seems some problem with thees patches :

Opensaf is not comingup with error  `SC-2 osafclmna[5375]: ER*SC-2m* is 
not a configured node` & ` SC-2 osafclmna[5375]: ER Exiting`

=
changeset:   7855:bc669776cf7f
tag: tip
user:Zoran Milinkovic 
date:Mon Aug 15 09:38:00 2016 +0530
summary: clm: add support for long RDN [#1906]

changeset:   7854:e9a1f9f7e1fb
parent:  7851:6ba070e84429
user:Zoran Milinkovic 
date:Mon Aug 15 09:22:54 2016 +0530
summary: clm: fix return error codes in IMM callbacks [#1917]

changeset:   7853:b0aa865e70df
branch:  opensaf-5.0.x
parent:  7844:c603424ffe8d
user:Zoran Milinkovic 
date:Mon Aug 15 09:22:54 2016 +0530
summary: clm: fix return error codes in IMM callbacks [#1917]


=


Configured Opensaf as follws :

  ./bootstrap.sh ;./configure --enable-imm-pbe --enable-tests 
--enable-tipc --enable-ntf-imcn



Aug 16 12:00:09 SC-2 osafntfimcnd[5448]: NO Started
Aug 16 12:00:09 SC-2 osafclmd[5455]: Started
Aug 16 12:00:09 SC-2 osafimmnd[5414]: NO Implementer connected: 4 
(safClmService) <21, 2020f>
Aug 16 12:00:09 SC-2 osafimmnd[5414]: NO implementer for class 
'SaClmNode' is safClmService => class extent is safe.
Aug 16 12:00:09 SC-2 osafimmnd[5414]: NO implementer for class 
'SaClmCluster' is safClmService => class extent is safe.
Aug 16 12:00:09 SC-2 osafclmd[5455]: NO Node 'SC-2m' requests to join 
the cluster but is unconfigured
Aug 16 12:00:09 SC-2 osafclmna[5375]: ER SC-2m is not a configured node
Aug 16 12:00:09 SC-2 osafclmna[5375]: ER Exiting
Aug 16 12:00:10 SC-2 osafamfd[5465]: Started
Aug 16 12:00:10 SC-2 osafimmnd[5414]: NO Implementer connected: 5 
(safAmfService) <26, 2020f>
Aug 16 12:00:10 SC-2 osafimmnd[5414]: NO implementer for class 
'SaAmfCompBaseType' is safAmfService => class extent is safe.
Aug 16 12:00:10 SC-2 osafimmnd[5414]: NO implementer for class 
'SaAmfSUBaseType' is safAmfServ

-AVM

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


Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]

2016-08-15 Thread A V Mahesh
Hi Hoang,

Please find my responses as [AVM].

-AVM

On 8/15/2016 8:16 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your review.
> I would like to answer to your concern.
>
> The solution of adding new messages instead of updating old one mostly
> because Long DN function has been working in current system (other modules
> already support long DN).
[AVM]  Long DN  is being introduced in this release in all services 
opensaf-5.1.x ,
so Opensaf rule is that any newly introduce enhancement/feature
functionality can be used once Cluster is completely upgraded to new
version ( all nodes with opensaf-5.1.x )  , so while upgrading 
(in-service ) the  SA_ENABLE_EXTENDED_NAMES  will
be false , so their is no way that other modules already support long DN.
So their is not possibility  of  Creating New Long DN  checkpoint while 
Upgrading.

>   So if we do not handle this, there are cases that
> CKPT is in-service update in Long DN enabling nodes and run with Long DN
> function immediately (Old checkpoint still short DN when previous CKPT
> version does not support Long DN, just other service) and new updated CKPT
> will send same message with different format to old CKPT cause strangle
> behavior.
[AVM]  Accommodating existing checkpoint with Short DN  on newly 
upgrading/upgraded  cluster
checkpoint code  logic will be the aim of this path ( please remember  
while upgrading
SA_ENABLE_EXTENDED_NAMES  will be false). The new logic Long DN 
variables is higher and will
all ways accommodate Short DN existing checkpoint information.

This patch case we don't need to handle message that will come  LONG DN 
, this path only need to take care of
accommodating the existing short DN name checkpoint names in a new data 
structures locally.

General comment : Even for each case of supporting servicemen upgrade, 
if we were go on adding new event , by this time
opensaf might be having thousands of new event ,you can find some  
old patches of that handle in-service upgrade
with out adding new event.

-AVM

> Please consider about it.
>
> Thank you and best regards,
> Hoang
>
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Friday, August 12, 2016 12:49 PM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 6 of 8] cpsv: Apply new messages supporting extended
> SaNameT to CPD, CPND, and CPA v1 [#1574]
>
> Hi Hoang,
>
> We don't required any new event like CPND_EVT_D2ND_CKPT_CREATE_2 even though
> NEW CPND might might be sending event to OLD CPD.
>
> In general Opensaf rule is that any newly introduce enhancement/feature
> functionality can be used once Cluster is completely upgraded to new
> version.So while upgrading (in-service ) the  SA_ENABLE_EXTENDED_NAMES  will
> be false  ( longDnsAllowed=0 of opensafImm=opensafImm,safApp=safImmService)
> , once clusters upgraded to new version then only ongDnsAllowed set to 1,
> ("immcfg -o safImmService -m opensafImm=opensafImm,safApp=safImmService -a
> longDnsAllowed=1") so remove new event merge the content in to a single
> exist old event , and do additionl functonality  based on the state of
> longDnsAllowed=1 or 0
>
> -AVM
>
> On 7/21/2016 3:04 PM, Hoang Vo wrote:
>>osaf/libs/agents/saf/cpa/cpa_api.c  |  12 +---
>>osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>>osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>>osaf/services/saf/cpsv/cpd/cpd_evt.c|  10 +++---
>>osaf/services/saf/cpsv/cpd/cpd_mds.c|   3 ++-
>>osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>>osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  26 --
>>osaf/services/saf/cpsv/cpnd/cpnd_mds.c  |   4 ++--
>>osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   6 +++---
>>9 files changed, 42 insertions(+), 24 deletions(-)
>>
>>
>> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c
> b/osaf/libs/agents/saf/cpa/cpa_api.c
>> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
>> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
>> @@ -880,6 +880,8 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>>  }
>>
>>  ckpt_name = osaf_extended_name_borrow(checkpointName);
>> +if (strlen(ckpt_name) >= kOsafMaxDnLength)
>> +return SA_AIS_ERR_INVALID_PARAM;
>>
>>  /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>>   Section 3.6.1 saCkptCheckpointOpen() and
> saCkptCheckpointOpenAsync(), Return Values */
>> @@ -981,7 +983,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>>  /* Populate & Send the Open Event to CPND */
>>  memset(, 0, sizeof(CPSV_EVT));
>>  evt.type = 

Re: [devel] [PATCH 0 of 1] Review Request for log: improve test cases for log service [#1913]

2016-08-12 Thread A V Mahesh
Hi Canh Van Truong,


On 8/11/2016 11:50 AM, Canh Van Truong wrote:
> 2) Remove abort (safassert) in test case and handle it as test case failed.

Still seeing abort (safassert)



Suite 2: Log Service Operations
 1  PASSED   saLogStreamOpen_2() system stream OK;
 2  PASSED   saLogStreamOpen_2() notification stream OK;
 3  PASSED   saLogStreamOpen_2() alarm stream OK;
 4  PASSED   Create app stream OK;
 5  PASSED   Create and open app stream;
 
47  PASSED   saLogStreamOpen_2 with invalid filename;
48  PASSED   saLogStreamOpen_2 with maxLogRecordSize > MAX_RECSIZE, ERR;
49  PASSED   saLogStreamOpen_2 with maxLogRecordSize < 150, ERR;
50  PASSED   saLogStreamOpen_2 with stream number out of the 
limitation, ERR;
51  PASSED   logInitialize then logFinalize multiple times. keep MDS 
connection, OK;
error: in tet_saLogStreamOpen_2.c at 919: SA_AIS_ERR_ACCESS (11), 
expected OUT_OF_RANGE - exiting



-AVM

On 8/11/2016 11:50 AM, Canh Van Truong wrote:
> Summary: log: improve test cases for log service [#1913]
> Review request for Trac Ticket(s): #1913
> Peer Reviewer(s): Vu, Mahesh, Lennart
> 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 servicesy
>   OpenSAF servicesn
>   Core libraries  n
>   Samples n
>   Tests   n
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
>   <>
>
> changeset 66ce76934620ec6230cfc90da3082167d72392b6
> Author:   Canh Van Truong 
> Date: Fri, 05 Aug 2016 15:21:55 +0700
>
>   log: improve test cases for log service [#1913]
>
>   The patch fixes to improve following cases:
>
>   1) The APIs may return TRY_AGAIN, this may not be a fault. Writing some
>   wrapper functions here to handle TRY_AGAIN case for log API.
>
>   2) Remove abort (safassert) in test case and handle it as test case 
> failed.
>
>   3) Some test cases (in testsuite 4) have dependence on other test cases.
>   Make them independency.
>
>   4) Some test cases (in testsuite 4, 5, 6) change setting such as IMM
>   attributes values and don't restore them back to previous. Get the
>   attributes values before changing attributes, then restore its to 
> previous
>   values at end of test cases.
>
>   5) Some test cases in testsuite 6 change attributes base on the present
>   value of logMaxLogrecsize without read the present value of its. They 
> use
>   constanst values (=1024). Changing to read logMaxLogrecsize value and 
> use
>   it.
>
>
> Complete diffstat:
> --
>   tests/logsv/logtest.c |89 +++-
>   tests/logsv/logtest.h |89 +++-
>   tests/logsv/tet_LogOiOps.c|  2163 
> 
>   tests/logsv/tet_Log_recov.c   |95 +--
>   tests/logsv/tet_log_longDN.c  | 1 -
>   tests/logsv/tet_saLogDispatch.c   | 9 +-
>   tests/logsv/tet_saLogFinalize.c   |11 +-
>   tests/logsv/tet_saLogInitialize.c |26 +-
>   tests/logsv/tet_saLogLimitGet.c   |19 +-
>   tests/logsv/tet_saLogSelectionObjectGet.c |13 +-
>   tests/logsv/tet_saLogStreamClose.c|24 +-
>   tests/logsv/tet_saLogStreamOpenAsync_2.c  |15 +-
>   tests/logsv/tet_saLogStreamOpen_2.c   |   546 +---
>   tests/logsv/tet_saLogWriteLog.c   |23 +-
>   tests/logsv/tet_saLogWriteLogAsync.c  |   461 -
>   tests/logsv/tet_saLogWriteLogCallbackT.c  |   110 +++-
>   16 files changed, 2266 insertions(+), 1428 deletions(-)
>
>
> Testing Commands:
> -
> Run all test cases.
>
>
> Testing, Expected Results:
> --
> All test case passed.
>
>
> 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):
>

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]

2016-08-11 Thread A V Mahesh
Hi Hoang,

We don't required any new event like CPND_EVT_D2ND_CKPT_CREATE_2
even though NEW CPND might might be sending event to OLD CPD.

In general Opensaf rule is that any newly introduce enhancement/feature 
functionality can be used
once Cluster is completely upgraded to new  version.So while upgrading 
(in-service )
the  SA_ENABLE_EXTENDED_NAMES  will be false  ( longDnsAllowed=0
of opensafImm=opensafImm,safApp=safImmService)  , once clusters upgraded 
to new version then only
ongDnsAllowed set to 1, ("immcfg -o safImmService -m 
opensafImm=opensafImm,safApp=safImmService -a longDnsAllowed=1")
so remove new event merge the content in to a single  exist old event , 
and do additionl functonality  based on the state of longDnsAllowed=1 or 0

-AVM

On 7/21/2016 3:04 PM, Hoang Vo wrote:
>   osaf/libs/agents/saf/cpa/cpa_api.c  |  12 +---
>   osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>   osaf/services/saf/cpsv/cpd/cpd_evt.c|  10 +++---
>   osaf/services/saf/cpsv/cpd/cpd_mds.c|   3 ++-
>   osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  26 --
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c  |   4 ++--
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   6 +++---
>   9 files changed, 42 insertions(+), 24 deletions(-)
>
>
> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c 
> b/osaf/libs/agents/saf/cpa/cpa_api.c
> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
> @@ -880,6 +880,8 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -981,7 +983,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1192,6 +1194,8 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -1277,7 +1281,7 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1597,6 +1601,8 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* retrieve CPA CB */
>   m_CPA_RETRIEVE_CB(cb);
> @@ -1635,7 +1641,7 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   /* Populate evt.info.cpnd.info.unlinkReq & Call MDS sync Send */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK_2;
>   
>   osaf_extended_name_lend(ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c 
> b/osaf/libs/agents/saf/cpa/cpa_mds.c
> --- a/osaf/libs/agents/saf/cpa/cpa_mds.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c
> @@ -515,7 +515,7 @@ static uint32_t cpa_mds_svc_evt(CPA_CB *
>  /* Populate & Send the Open Event to CPND */
>  memset(, 0, sizeof(CPSV_EVT));
>  evt.type = CPSV_EVT_TYPE_CPND;
> -evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
> +evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE_2;
>  evt.info.cpnd.info.ckptListUpdate.client_hdl = 
> lc_node->cl_hdl;
>  osaf_extended_name_lend(lc_node->ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -2414,6 +2414,7 @@ uint32_t cpsv_encode_extended_name(NCS_U
>   if(!osaf_is_an_extended_name(name))
>  

Re: [devel] [PATCH 4 of 8] cpsv: Add new message to support extended SaNameT v1 [#1574]

2016-08-11 Thread A V Mahesh
Hi Hoang,

I completed the testing most of the in service & normal test case are 
working fine ,
so I stated reviewing code now can please answer below :

1)
This patch introduced multiple new event  between  Agent to ND which are 
always
local to the node (  in a new version software  cpa & cpnd will always 
co-exist )
their no concept OLD CPA communicating with NEW CPND , so it is not 
required introduce new event
we can alwasy make exist event compatible with new support extended 
SaNameT ,
so remove new event merge the content in to a single  exist old event .

=

/* Events support extended SaNameT */
CPND_EVT_A2ND_CKPT_OPEN_2,/* Checkpoint Open Request */
CPND_EVT_A2ND_CKPT_UNLINK_2,/* Checkpoint Unlink Call */
CPND_EVT_A2ND_CKPT_LIST_UPDATE_2,/* Checkpoint ckpt list update Call */
CPND_EVT_D2ND_CKPT_CREATE_2,/* ckpt create evt for Non-collocated */

=

-AVM

On 7/21/2016 3:04 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/cpsv_evt.c |  504 
> ++-
>   osaf/libs/common/cpsv/include/cpsv_evt.h |   24 +
>   osaf/services/saf/cpsv/cpd/cpd_mds.c |   84 -
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c   |   84 -
>   4 files changed, 668 insertions(+), 28 deletions(-)
>
>
> New messages supporting extended SaNameT are introduce. Encoding and decoding 
> funtions for them are also included.
>
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -30,11 +30,14 @@
>   
>   #include "cpsv.h"
>   #include "cpa_tmr.h"
> +#include "osaf_extended_name.h"
>   
>   FUNC_DECLARATION(CPSV_CKPT_DATA);
>   static SaCkptSectionIdT *cpsv_evt_dec_sec_id(NCS_UBAID *i_ub, uint32_t 
> svc_id);
>   static uint32_t cpsv_evt_enc_sec_id(NCS_UBAID *o_ub, SaCkptSectionIdT 
> *sec_id);
>   static void cpsv_convert_sec_id_to_string(char *sec_id_str, 
> SaCkptSectionIdT *section_id);
> +static uint32_t cpsv_encode_extended_name_flat(NCS_UBAID *uba, SaNameT 
> *name);
> +static uint32_t cpsv_decode_extended_name_flat(NCS_UBAID *uba, SaNameT 
> *name);
>   
>   const char *cpa_evt_str[] = {
>   "STRING_0",
> @@ -258,6 +261,13 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   info->client_hdl, info->ckpt_name.value);
>   break;
>   }
> + case CPND_EVT_A2ND_CKPT_OPEN_2:
> + {
> + CPSV_A2ND_OPEN_REQ *info = >info.cpnd.info.openReq;
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_OPEN_2(hdl=%llu, %s)",
> + info->client_hdl, 
> osaf_extended_name_borrow(>ckpt_name));
> + break;
> + }
>   case CPND_EVT_A2ND_CKPT_CLOSE:
>   {
>   CPSV_A2ND_CKPT_CLOSE *info = 
> >info.cpnd.info.closeReq;
> @@ -271,6 +281,12 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_UNLINK(%s)", info->ckpt_name.value);
>   break;
>   }
> + case CPND_EVT_A2ND_CKPT_UNLINK_2:
> + {
> + CPSV_A2ND_CKPT_UNLINK *info = 
> >info.cpnd.info.ulinkReq;
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_UNLINK_2(%s)", 
> osaf_extended_name_borrow(>ckpt_name));
> + break;
> + }
>   case CPND_EVT_A2ND_CKPT_RDSET:
>   {
>   CPSV_A2ND_RDSET *info = >info.cpnd.info.rdsetReq;
> @@ -513,12 +529,33 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   case CPND_EVT_D2ND_CKPT_CREATE:
>   {
>   CPSV_D2ND_CKPT_CREATE *info = 
> >info.cpnd.info.ckpt_create;
> - snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, active=0x%X)",
> - info->ckpt_info.ckpt_id, info->ckpt_name.value,
> + snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, is_act=%s, active=0x%X, 
> dest_cnt=%d)",
> + info->ckpt_info.ckpt_id, 
> osaf_extended_name_borrow(>ckpt_name),
>   info->ckpt_info.ckpt_rep_create ? "true" : 
> "false",
> - 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest));
> + info->ckpt_info.is_active_exists ? "true" : 
> "false",
> + 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest),
> + info->ckpt_info.dest_cnt);
>   break;
>   }
> + case CPND_EVT_D2ND_CKPT_CREATE_2:
> + {
> + CPSV_D2ND_CKPT_CREATE 

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V4

2016-08-11 Thread A V Mahesh
I will test for you send the patch.

-AVM


On 8/11/2016 3:38 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Would you please tell me the case that produce this error?
> I review source code and found that encode/decode function missed 1
> attribute.
> But running test in our environment could not reproduce this problem.
>
> Thank you and best regards,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Tuesday, August 9, 2016 4:35 PM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
> node [#1669] V4
>
> Hi Hoang ,
>
> Please hold on pushing.
>
> On new node we have see some issue please check CPD enode and decode once (
> new patch node ) .
>
> Aug  9 14:23:01 SC-1 osafckptd[20478]: hj_enc.c:311:
> decode_flatten_space: Assertion 'p8' failed.
> Aug  9 14:23:01 SC-1 osafamfnd[20439]: NO
> 'safComp=CPD,safSu=SC-1,safSg=2N,safApp=OpenSAF' faulted due to 'avaDown' :
> Recovery is 'nodeFailfast'
>
> -AVM
>
>
>
> On 8/9/2016 2:09 PM, A V Mahesh wrote:
>> ACK,
>>
>> -AVM
>>
>>
>> On 8/3/2016 4:02 PM, Hoang Vo wrote:
>>>osaf/libs/common/cpsv/include/cpd_cb.h |2 +
>>>osaf/libs/common/cpsv/include/cpd_proc.h |3 +
>>>osaf/libs/common/cpsv/include/cpd_red.h  |   13 ++
>>>osaf/libs/common/cpsv/include/cpsv_evt.h |8 +
>>>osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 ++-
>>>osaf/services/saf/cpsv/cpd/cpd_evt.c |8 +
>>>osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   96 ---
>>>osaf/services/saf/cpsv/cpd/cpd_proc.c|  148
>>> +++
>>>osaf/services/saf/cpsv/cpd/cpd_red.c |   30 -
>>>osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   57 +--
>>>10 files changed, 344 insertions(+), 35 deletions(-)
>>>
>>>
>>> Problem:
>>> ---
>>> The saCkptCheckpointNumOpeners is not updated when a node which has a
>>> checkpoint client restarts.
>>>
>>> Solution:
>>> 
>>> Currently CPD doesn't store number of user on each node. This patch
>>> updates CPD to update information about users on each node for each
>>> checkpoint. When a node restarts, the CPD update the total number of
>>> users for a checkpoint accordingly. This is reflected on
>>> saCkptCheckpointNumOpeners attribute correctly.
>>>
>>> diff --git a/osaf/libs/common/cpsv/include/cpd_cb.h
>>> b/osaf/libs/common/cpsv/include/cpd_cb.h
>>> --- a/osaf/libs/common/cpsv/include/cpd_cb.h
>>> +++ b/osaf/libs/common/cpsv/include/cpd_cb.h
>>> @@ -92,6 +92,8 @@ typedef struct cpd_ckpt_info_node {
>>>uint32_t num_users;
>>>uint32_t num_readers;
>>>uint32_t num_writers;
>>> +uint32_t node_users_cnt;
>>> +CPD_NODE_USER_INFO *node_users;
>>>  /* for imm */
>>>SaUint32T ckpt_used_size;
>>> diff --git a/osaf/libs/common/cpsv/include/cpd_proc.h
>>> b/osaf/libs/common/cpsv/include/cpd_proc.h
>>> --- a/osaf/libs/common/cpsv/include/cpd_proc.h
>>> +++ b/osaf/libs/common/cpsv/include/cpd_proc.h
>>> @@ -108,5 +108,8 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_
>>>uint32_t cpd_mbcsv_close(CPD_CB *cb);
>>>bool cpd_is_noncollocated_replica_present_on_payload(CPD_CB *cb,
>>> CPD_CKPT_INFO_NODE *ckpt_node);
>>>uint32_t cpd_ckpt_reploc_imm_object_delete(CPD_CB *cb,
>>> CPD_CKPT_REPLOC_INFO *ckpt_reploc_node ,bool is_unlink_set);
>>> +void cpd_proc_increase_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node,
>>> MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
>>> +void cpd_proc_decrease_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node,
>>> MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
>>> +void cpd_proc_update_user_info_when_node_down(CPD_CB *cb, NODE_ID
>>> node_id);
>>>uint32_t cpd_proc_ckpt_update_post(CPD_CB *cb);
>>>#endif
>>> diff --git a/osaf/libs/common/cpsv/include/cpd_red.h
>>> b/osaf/libs/common/cpsv/include/cpd_red.h
>>> --- a/osaf/libs/common/cpsv/include/cpd_red.h
>>> +++ b/osaf/libs/common/cpsv/include/cpd_red.h
>>> @@ -64,6 +64,18 @@ typedef struct cpd_a2s_ckpt_usr_info {
>>>  } CPD_A2S_CKPT_USR_INFO;
>>>+typedef struct cpd_a2s_ckpt_usr_info_2 {
>>> +SaCkptCheckpointHandleT ckpt_id;
>>>

Re: [devel] [PATCH 1 of 1] dtm: When IPv4 broadcast address is not configured, derive it from IP and netmask [#1930]

2016-08-11 Thread A V Mahesh
Hi Anders Widell,

ACK with assumption, that  In Container environments IV6 not being 
used/issue doesn't observed.

-AVM


On 8/4/2016 2:22 PM, Anders Widell wrote:
>   osaf/services/infrastructure/dtms/dtm/dtm_read_config.c |  36 
> +++-
>   1 files changed, 32 insertions(+), 4 deletions(-)
>
>
> The IPv4 broadcast address is sometimes not configured when running in some
> container environments (e.g. docker). In these cases, derive the broadcast
> address from the IPv4 address and netmask.
>
> diff --git a/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c 
> b/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
> --- a/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
> +++ b/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
> @@ -15,10 +15,15 @@
>*
>*/
>   
> +#include 
> +#include 
> +#include 
>   #include 
> -#include 
> +#include 
> +#include 
> +#include 
>   #include 
> -#include 
> +#include "logtrace.h"
>   #include "ncs_main_papi.h"
>   #include "dtm.h"
>   #include "dtm_socket.h"
> @@ -162,8 +167,31 @@ char *dtm_validate_listening_ip_addr(DTM
>   
>   //Bcast  Address
>   if (if_addr->ifa_addr->sa_family == AF_INET) {
> - tmp = &((struct sockaddr_in 
> *)if_addr->ifa_broadaddr)->sin_addr;
> - inet_ntop(if_addr->ifa_addr->sa_family, 
> tmp, config->bcast_addr,sizeof(buf));
> + struct in_addr addr =
> + ((struct sockaddr_in*) if_addr->
> +  ifa_addr)->sin_addr;
> + struct in_addr netmask =
> + ((struct sockaddr_in*) if_addr->
> +  ifa_netmask)->sin_addr;
> + struct in_addr broadaddr =
> + ((struct sockaddr_in*) if_addr->
> +  ifa_broadaddr)->sin_addr;
> + TRACE("DTM: addr=0x%" PRIx32,
> +   ntohl(addr.s_addr));
> + TRACE("DTM: netmask=0x%" PRIx32,
> +   ntohl(netmask.s_addr));
> + TRACE("DTM: broadaddr=0x%" PRIx32,
> +   ntohl(broadaddr.s_addr));
> + if (broadaddr.s_addr == addr.s_addr ||
> + broadaddr.s_addr ==
> + htonl(INADDR_ANY)) {
> + broadaddr.s_addr = addr.s_addr |
> + ~netmask.s_addr;
> + }
> + inet_ntop(if_addr->ifa_addr->sa_family,
> +   ,
> +   config->bcast_addr,
> +   sizeof(buf));
>   } else if (if_addr->ifa_addr->sa_family == 
> AF_INET6) {
>   struct sockaddr_in6 *addr = (struct 
> sockaddr_in6 *)if_addr->ifa_addr;
>   memset(config->bcast_addr, 0, 
> INET6_ADDRSTRLEN);


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 4 of 8] cpsv: Add new message to support extended SaNameT v1 [#1574]

2016-08-10 Thread A V Mahesh
Hi Hoang,

Ok , I will  check and start testing & reviewing the patch.

-AVM


On 8/11/2016 10:11 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Encode and decode for new messages are implemented in separate functions
> like *_encode() and *_decode() so they do not exist in *_edu.c file.
>
> I find only MDS_CLIENT_MSG_FORMAT_VER and I think that I should not update
> this each time adding new message. I am sorry if it is wrong.
>
> Thank you very much for your review.
> Best regards,
> Hoang
>
> -----Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Wednesday, August 10, 2016 6:37 PM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 4 of 8] cpsv: Add new message to support extended
> SaNameT v1 [#1574]
>
> Hi Hoang,
>
> I am seeing new encode decodes done between  D to ND ,  in this patch  ( old
> cpd to new cpnd  & old cpnd to new cpd ) but not able find edu rules ,
> please confirm.
>
> Otherwise it will take unnecessary  testing effort.
>
> If not handled please refer `osaf/libs/common/cpsv/cpsv_edu.c ` file for
> MSG_FORMAT_VER handling or any old patches
>
> -AVM
>
>
> On 8/2/2016 2:14 PM, Hoang Vo wrote:
>>osaf/libs/common/cpsv/cpsv_evt.c |  504
> ++-
>>osaf/libs/common/cpsv/include/cpsv_evt.h |   24 +
>>osaf/services/saf/cpsv/cpd/cpd_mds.c |   84 -
>>osaf/services/saf/cpsv/cpnd/cpnd_mds.c   |   84 -
>>4 files changed, 668 insertions(+), 28 deletions(-)
>>
>>
>> New messages supporting extended SaNameT are introduce. Encoding and
> decoding funtions for them are also included.
>> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c
>> b/osaf/libs/common/cpsv/cpsv_evt.c
>> --- a/osaf/libs/common/cpsv/cpsv_evt.c
>> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
>> @@ -30,11 +30,14 @@
>>
>>#include "cpsv.h"
>>#include "cpa_tmr.h"
>> +#include "osaf_extended_name.h"
>>
>>FUNC_DECLARATION(CPSV_CKPT_DATA);
>>static SaCkptSectionIdT *cpsv_evt_dec_sec_id(NCS_UBAID *i_ub, uint32_t
> svc_id);
>>static uint32_t cpsv_evt_enc_sec_id(NCS_UBAID *o_ub, SaCkptSectionIdT
> *sec_id);
>>static void cpsv_convert_sec_id_to_string(char *sec_id_str,
>> SaCkptSectionIdT *section_id);
>> +static uint32_t cpsv_encode_extended_name_flat(NCS_UBAID *uba,
>> +SaNameT *name); static uint32_t
>> +cpsv_decode_extended_name_flat(NCS_UBAID *uba, SaNameT *name);
>>
>>const char *cpa_evt_str[] = {
>>  "STRING_0",
>> @@ -258,6 +261,13 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>>  info->client_hdl, info->ckpt_name.value);
>>  break;
>>  }
>> +case CPND_EVT_A2ND_CKPT_OPEN_2:
>> +{
>> +CPSV_A2ND_OPEN_REQ *info =
> >info.cpnd.info.openReq;
>> +snprintf(o_evt_str, len,
> "CPND_EVT_A2ND_CKPT_OPEN_2(hdl=%llu, %s)",
>> +info->client_hdl,
> osaf_extended_name_borrow(>ckpt_name));
>> +break;
>> +}
>>  case CPND_EVT_A2ND_CKPT_CLOSE:
>>  {
>>  CPSV_A2ND_CKPT_CLOSE *info =
> >info.cpnd.info.closeReq; @@
>> -271,6 +281,12 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>>  snprintf(o_evt_str, len,
> "CPND_EVT_A2ND_CKPT_UNLINK(%s)", info->ckpt_name.value);
>>  break;
>>  }
>> +case CPND_EVT_A2ND_CKPT_UNLINK_2:
>> +{
>> +CPSV_A2ND_CKPT_UNLINK *info =
> >info.cpnd.info.ulinkReq;
>> +snprintf(o_evt_str, len,
> "CPND_EVT_A2ND_CKPT_UNLINK_2(%s)",
> osaf_extended_name_borrow(>ckpt_name));
>> +break;
>> +}
>>  case CPND_EVT_A2ND_CKPT_RDSET:
>>  {
>>  CPSV_A2ND_RDSET *info =
> >info.cpnd.info.rdsetReq; @@ -513,12
>> +529,33 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>>  case CPND_EVT_D2ND_CKPT_CREATE:
>>  {
>>  CPSV_D2ND_CKPT_CREATE *info =
> >info.cpnd.info.ckpt_create;
>> -snprintf(o_evt_str, len, "[%llu]
> CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, active=0x%X)",
>> -info->ckpt_info.ckpt_id,
> info-

Re: [devel] [PATCH 4 of 8] cpsv: Add new message to support extended SaNameT v1 [#1574]

2016-08-10 Thread A V Mahesh
Hi Hoang,

I am seeing new encode decodes done between  D to ND ,  in this patch  ( 
old cpd to new cpnd  & old cpnd to new cpd )
but not able find edu rules ,  please confirm.

Otherwise it will take unnecessary  testing effort.

If not handled please refer `osaf/libs/common/cpsv/cpsv_edu.c ` file for 
MSG_FORMAT_VER handling or any old patches

-AVM


On 8/2/2016 2:14 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/cpsv_evt.c |  504 
> ++-
>   osaf/libs/common/cpsv/include/cpsv_evt.h |   24 +
>   osaf/services/saf/cpsv/cpd/cpd_mds.c |   84 -
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c   |   84 -
>   4 files changed, 668 insertions(+), 28 deletions(-)
>
>
> New messages supporting extended SaNameT are introduce. Encoding and decoding 
> funtions for them are also included.
>
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -30,11 +30,14 @@
>   
>   #include "cpsv.h"
>   #include "cpa_tmr.h"
> +#include "osaf_extended_name.h"
>   
>   FUNC_DECLARATION(CPSV_CKPT_DATA);
>   static SaCkptSectionIdT *cpsv_evt_dec_sec_id(NCS_UBAID *i_ub, uint32_t 
> svc_id);
>   static uint32_t cpsv_evt_enc_sec_id(NCS_UBAID *o_ub, SaCkptSectionIdT 
> *sec_id);
>   static void cpsv_convert_sec_id_to_string(char *sec_id_str, 
> SaCkptSectionIdT *section_id);
> +static uint32_t cpsv_encode_extended_name_flat(NCS_UBAID *uba, SaNameT 
> *name);
> +static uint32_t cpsv_decode_extended_name_flat(NCS_UBAID *uba, SaNameT 
> *name);
>   
>   const char *cpa_evt_str[] = {
>   "STRING_0",
> @@ -258,6 +261,13 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   info->client_hdl, info->ckpt_name.value);
>   break;
>   }
> + case CPND_EVT_A2ND_CKPT_OPEN_2:
> + {
> + CPSV_A2ND_OPEN_REQ *info = >info.cpnd.info.openReq;
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_OPEN_2(hdl=%llu, %s)",
> + info->client_hdl, 
> osaf_extended_name_borrow(>ckpt_name));
> + break;
> + }
>   case CPND_EVT_A2ND_CKPT_CLOSE:
>   {
>   CPSV_A2ND_CKPT_CLOSE *info = 
> >info.cpnd.info.closeReq;
> @@ -271,6 +281,12 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_UNLINK(%s)", info->ckpt_name.value);
>   break;
>   }
> + case CPND_EVT_A2ND_CKPT_UNLINK_2:
> + {
> + CPSV_A2ND_CKPT_UNLINK *info = 
> >info.cpnd.info.ulinkReq;
> + snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_CKPT_UNLINK_2(%s)", 
> osaf_extended_name_borrow(>ckpt_name));
> + break;
> + }
>   case CPND_EVT_A2ND_CKPT_RDSET:
>   {
>   CPSV_A2ND_RDSET *info = >info.cpnd.info.rdsetReq;
> @@ -513,12 +529,33 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   case CPND_EVT_D2ND_CKPT_CREATE:
>   {
>   CPSV_D2ND_CKPT_CREATE *info = 
> >info.cpnd.info.ckpt_create;
> - snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, active=0x%X)",
> - info->ckpt_info.ckpt_id, info->ckpt_name.value,
> + snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, is_act=%s, active=0x%X, 
> dest_cnt=%d)",
> + info->ckpt_info.ckpt_id, 
> osaf_extended_name_borrow(>ckpt_name),
>   info->ckpt_info.ckpt_rep_create ? "true" : 
> "false",
> - 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest));
> + info->ckpt_info.is_active_exists ? "true" : 
> "false",
> + 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest),
> + info->ckpt_info.dest_cnt);
>   break;
>   }
> + case CPND_EVT_D2ND_CKPT_CREATE_2:
> + {
> + CPSV_D2ND_CKPT_CREATE *info = 
> >info.cpnd.info.ckpt_create;
> + snprintf(o_evt_str, len, "[%llu] 
> CPND_EVT_D2ND_CKPT_CREATE_2(%s, create_rep=%s, is_act=%s, active=0x%X, 
> dest_cnt=%d)",
> + info->ckpt_info.ckpt_id, 
> osaf_extended_name_borrow(>ckpt_name),
> + info->ckpt_info.ckpt_rep_create ? "true" : 
> "false",
> + info->ckpt_info.is_active_exists ? "true" : 
> "false",
> + 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest),
> + info->ckpt_info.dest_cnt);
> +
> + SaCkptCheckpointCreationAttributesT *attr = 
> 

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]

2016-08-10 Thread A V Mahesh
Hi Hoan,

I hope the patch  published On 8/2/2016 2:14 PM is the New version  V2

If you are sending new version please update   V1 to V2 , form next time 
on-words

-AVM


On 8/2/2016 2:17 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> I have just submitted the V3 patch fixing source code following your
> comment.
> I also update readme file that is attached to this email.
> Please tell me if you have any further inquiry.
>
> Thank you and best regards,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Friday, July 29, 2016 1:27 PM
> To: Vo Minh Hoang <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 6 of 8] cpsv: Apply new messages supporting extended
> SaNameT to CPD, CPND, and CPA v1 [#1574]
>
> Hi ,
>
> I have proved some code related minor comment in 4 of 8 , 6 of 8 & 8 of
> 8 , please  address them also in new patch(s).
>
> Reading testing :
>
> On 7/29/2016 7:49 AM, Vo Minh Hoang wrote:
>> We do not have specific test case and environment for in-service update.
>> So my test work is based on osaftest cases.
>>
>> I tested with old d - new nd and new d - old nd cases.
> I started basic testing with  one new Controller  & one old Controller and
> tow Old payload setup.
> I observed some encode/decode issue  by running simple  ` /usr/bin/ckpttest`
>
> Even I was not able to proceed with other testing which not related to LONG
> DN)( continuously receiving SA_AIS_ERR_TRY_AGAIN) Please re-visit the all
> encode & decode function that you have introduced run  the basic testing
> with the above setup running application on ( old nodes/application  and new
> nodes/application )
>
> traces On Old Node ( with out patch )
>
> 
> 
>
> Jul 29 11:34:16 SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29
> 11:34:16 SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:26
> SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:27 SC-2
> osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:27 SC-2
> osafckptnd[5233]: ER cpnd mds decode failed
>
> 
> ==
>
> Jul 29 11:34:04.216980 osafckptnd [5233:cpnd_mds.c:0225] >>
> cpnd_mds_callback Jul 29 11:34:04.217086 osafckptnd [5233:cpnd_mds.c:0267]
> << cpnd_mds_callback Jul 29 11:34:04.217100 osafckptnd
> [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.217129
> osafckptnd [5233:cpnd_mds.c:0729] << cpnd_mds_rcv Jul 29 11:34:04.217175
> osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback Jul 29
> 11:34:04.217240 osafckptnd [5233:cpsv_evt.c:2219] TR cpnd <<== [9]
> CPSV_EVT_ND2ND_CKPT_SECT_CREATE_REQ(sec_id=0x0B15) from node 0x2010F Jul 29
> 11:34:04.217254 osafckptnd [5233:cpnd_evt.c:2626] >>
> cpnd_evt_proc_nd2nd_ckpt_sect_create
> Jul 29 11:34:04.217264 osafckptnd [5233:cpnd_evt.c:2632] T4 cpnd ckpt node
> get failed for ckpt_id:9 Jul 29 11:34:04.217272 osafckptnd
> [5233:cpnd_mds.c:1004] >> cpnd_mds_send_rsp Jul 29 11:34:04.217282
> osafckptnd [5233:cpsv_evt.c:2213] TR cpnd ==>> [0]
> CPSV_EVT_ND2ND_CKPT_SECT_ACTIVE_CREATE_RSP(err=6) to node 0x2010F Jul 29
> 11:34:04.217301 osafckptnd [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul
> 29 11:34:04.217310 osafckptnd [5233:cpnd_mds.c:0291] >> cpnd_mds_enc Jul 29
> 11:34:04.217331 osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback Jul
> 29 11:34:04.217464 osafckptnd [5233:cpnd_mds.c:1028] << cpnd_mds_send_rsp
> Jul 29 11:34:04.217483 osafckptnd [5233:cpnd_evt.c:2740] <<
> cpnd_evt_proc_nd2nd_ckpt_sect_create
> Jul 29 11:34:04.217493 osafckptnd [5233:cpnd_evt.c:4433] >> cpnd_evt_destroy
> Jul 29 11:34:04.217503 osafckptnd [5233:cpnd_evt.c:4619] << cpnd_evt_destroy
> Jul 29 11:34:04.719653 osafckptnd [5233:cpnd_mds.c:0225] >>
> cpnd_mds_callback Jul 29 11:34:04.719758 osafckptnd [5233:cpnd_mds.c:0267]
> << cpnd_mds_callback Jul 29 11:34:04.719772 osafckptnd
> [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.719801
> osafckptnd [5233:cpnd_mds.c:0729] << cpnd_mds_rcv Jul 29 11:34:04.719812
> osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback
>
> 
> =
>
> 520|0 88 03703659 1 10|
> 520|0 88 03703659 1 11| SUCCESS   : ckpt with all flags on created
> 520|0 88 03703659 1 12| Return Value  : SA_AIS_OK
> 520|0 88 03703659 1 13|
> 520|0 88 03703659 1 14| SUCCESS   : Unlinked ckpt

Re: [devel] [PATCH 2 of 4] lgs: director Cluster Membership (CLM) integration [#1638] V4

2016-08-10 Thread A V Mahesh
Hi Lennar,

On 8/8/2016 7:06 PM, Lennart Lund wrote:
>> +/**
>> >+ * Name : lgs_clm_node_map_init
>> >+ * Description   : This routine is used to initialize the clm_node_map
>> >+ * Arguments : lgs_cb - pointer to the lgs Control Block
>> >+ * Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
>> >+ * Notes: None
>> >+ */
> [Lennart] NOTE: This function is not a NCS function and should therefore not 
> use NCS error codes. Unfortunate this is commonly done all over the code but 
> it would be good not to add more of this!
>
[AVM]  their is #1607 Ticket which is related ERROR handling related 
enhancement, so I just added your comment as well in that  tickets #1607
  to replace  NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE with alternate macro, if 
we change now with different macros or digit , these change will remain 
UN-uniform ,
  so for now I planing to keep as it is , so that while #1607 
addressing  can easily find them .

-AVM

On 8/8/2016 7:06 PM, Lennart Lund wrote:
> Hi Mahesh
>
> Ack for this part but with comments I really think should be fixed. See 
> comments inline [Lennart]
>
> Thanks
> Lennart
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: den 5 augusti 2016 14:58
>> To: Lennart Lund ; Vu Minh Nguyen
>> ; Anders Widell
>> 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 2 of 4] lgs: director Cluster Membership (CLM) integration
>> [#1638] V4
>>
>>   osaf/services/saf/logsv/lgs/Makefile.am |7 +-
>>   osaf/services/saf/logsv/lgs/lgs_cb.h|4 +
>>   osaf/services/saf/logsv/lgs/lgs_clm.cc  |  395
>> 
>>   osaf/services/saf/logsv/lgs/lgs_clm.h   |   39 +++
>>   osaf/services/saf/logsv/lgs/lgs_evt.cc  |   15 +
>>   osaf/services/saf/logsv/lgs/lgs_main.cc |   28 ++
>>   osaf/services/saf/logsv/lgs/lgs_mds.cc  |   38 ++-
>>   7 files changed, 523 insertions(+), 3 deletions(-)
>>
>>
>> diff --git a/osaf/services/saf/logsv/lgs/Makefile.am
>> b/osaf/services/saf/logsv/lgs/Makefile.am
>> --- a/osaf/services/saf/logsv/lgs/Makefile.am
>> +++ b/osaf/services/saf/logsv/lgs/Makefile.am
>> @@ -37,7 +37,8 @@ noinst_HEADERS = \
>>  lgs_mbcsv_v3.h \
>>  lgs_mbcsv_v5.h \
>>  lgs_recov.h \
>> -lgs_imm_gcfg.h
>> +lgs_imm_gcfg.h \
>> +lgs_clm.h
>>
>>   osaf_execbindir = $(pkglibdir)
>>   osaf_execbin_PROGRAMS = osaflogd
>> @@ -68,7 +69,8 @@ osaflogd_SOURCES = \
>>  lgs_mbcsv_v3.cc \
>>  lgs_mbcsv_v5.cc \
>>  lgs_recov.cc \
>> -lgs_imm_gcfg.cc
>> +lgs_imm_gcfg.cc \
>> +lgs_clm.cc
>>
>>   osaflogd_LDADD = \
>>  $(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
>> @@ -76,4 +78,5 @@ osaflogd_LDADD = \
>>  $(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
>> +$(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
>>  $(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> --- a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> +++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> @@ -21,6 +21,7 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>>   #include 
>>   #include 
>>
>> @@ -80,6 +81,8 @@ typedef struct lgs_cb {
>>  bool is_quiesced_set;
>>  SaImmOiHandleT immOiHandle; /* IMM OI handle
>> */
>>  SaSelectionObjectT immSelectionObject;  /* Selection Object to
>> wait for IMM events */
>> +SaSelectionObjectT clmSelectionObject;  /* Selection Object to wait
>> for clms events */
>> +SaClmHandleT clm_hdl;   /* CLM handle, obtained through CLM init
>> */
>>  SaAmfHAStateT ha_state; /* present AMF HA state of the
>> component */
>>  uint32_t last_client_id;/* Value of last client_id assigned 
>>  */
>>  uint32_t async_upd_cnt; /* Async Update Count for Warmsync
>> */
>> @@ -94,6 +97,7 @@ typedef struct lgs_cb {
>>  down events Processing 
>> */
>>  LGA_DOWN_LIST *lga_down_list_tail;
>>
>> +NCS_SEL_OBJ clm_init_sel_obj; /* Selection object for CLM
>> initialization.*/
>>  bool nid_started;   /**< true if started by NID */
>>  SaUint32T scAbsenceAllowed; /* OpenSAF global configuration for
>> recovery handling */
>>  lgs_state_t lgs_recovery_state; /* Indicate current recovery state for
>> the server */
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_clm.cc
>> b/osaf/services/saf/logsv/lgs/lgs_clm.cc
>> new file mode 100644
>> --- /dev/null
>> +++ b/osaf/services/saf/logsv/lgs/lgs_clm.cc
>> @@ -0,0 +1,395 @@
>> +/*  -*- OpenSAF -*-
>> + *
>> + * (C) Copyright 2016 The OpenSAF Foundation
>> + *
>> + * This program is distributed in the hope that it will be useful, but
>> + * WITHOUT ANY WARRANTY; without 

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V4

2016-08-09 Thread A V Mahesh
Hi Hoang,

The  new messages between old cpd to new cpd  (A to S) was not handled ,

please refer `osaf/libs/common/cpsv/cpsv_edu.c ` file for MSG_FORMAT_VER 
handling or any old patches


-AVM

On 8/9/2016 3:05 PM, A V Mahesh wrote:
> Hi Hoang ,
>
> Please hold on pushing.
>
> On new node we have see some issue please check CPD enode and decode 
> once ( new patch node ) .
>
> Aug  9 14:23:01 SC-1 osafckptd[20478]: hj_enc.c:311: 
> decode_flatten_space: Assertion 'p8' failed.
> Aug  9 14:23:01 SC-1 osafamfnd[20439]: NO 
> 'safComp=CPD,safSu=SC-1,safSg=2N,safApp=OpenSAF' faulted due to 
> 'avaDown' : Recovery is 'nodeFailfast'
>
> -AVM
>
>
>
> On 8/9/2016 2:09 PM, A V Mahesh wrote:
>> ACK,
>>
>> -AVM
>>
>>
>> On 8/3/2016 4:02 PM, Hoang Vo wrote:
>>>   osaf/libs/common/cpsv/include/cpd_cb.h |2 +
>>>   osaf/libs/common/cpsv/include/cpd_proc.h |3 +
>>>   osaf/libs/common/cpsv/include/cpd_red.h  |   13 ++
>>>   osaf/libs/common/cpsv/include/cpsv_evt.h |8 +
>>>   osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 ++-
>>>   osaf/services/saf/cpsv/cpd/cpd_evt.c |8 +
>>>   osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   96 ---
>>>   osaf/services/saf/cpsv/cpd/cpd_proc.c|  148 
>>> +++
>>>   osaf/services/saf/cpsv/cpd/cpd_red.c |   30 -
>>>   osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   57 +--
>>>   10 files changed, 344 insertions(+), 35 deletions(-)
>>>
>>>
>>> Problem:
>>> ---
>>> The saCkptCheckpointNumOpeners is not updated when a node which has 
>>> a checkpoint client restarts.
>>>
>>> Solution:
>>> 
>>> Currently CPD doesn't store number of user on each node. This patch 
>>> updates CPD to update information
>>> about users on each node for each checkpoint. When a node restarts, 
>>> the CPD update the total number of
>>> users for a checkpoint accordingly. This is reflected on 
>>> saCkptCheckpointNumOpeners attribute correctly.
>>>
>>> diff --git a/osaf/libs/common/cpsv/include/cpd_cb.h 
>>> b/osaf/libs/common/cpsv/include/cpd_cb.h
>>> --- a/osaf/libs/common/cpsv/include/cpd_cb.h
>>> +++ b/osaf/libs/common/cpsv/include/cpd_cb.h
>>> @@ -92,6 +92,8 @@ typedef struct cpd_ckpt_info_node {
>>>   uint32_t num_users;
>>>   uint32_t num_readers;
>>>   uint32_t num_writers;
>>> +uint32_t node_users_cnt;
>>> +CPD_NODE_USER_INFO *node_users;
>>> /* for imm */
>>>   SaUint32T ckpt_used_size;
>>> diff --git a/osaf/libs/common/cpsv/include/cpd_proc.h 
>>> b/osaf/libs/common/cpsv/include/cpd_proc.h
>>> --- a/osaf/libs/common/cpsv/include/cpd_proc.h
>>> +++ b/osaf/libs/common/cpsv/include/cpd_proc.h
>>> @@ -108,5 +108,8 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_
>>>   uint32_t cpd_mbcsv_close(CPD_CB *cb);
>>>   bool cpd_is_noncollocated_replica_present_on_payload(CPD_CB *cb, 
>>> CPD_CKPT_INFO_NODE *ckpt_node);
>>>   uint32_t cpd_ckpt_reploc_imm_object_delete(CPD_CB *cb, 
>>> CPD_CKPT_REPLOC_INFO *ckpt_reploc_node ,bool is_unlink_set);
>>> +void cpd_proc_increase_node_user_info(CPD_CKPT_INFO_NODE 
>>> *ckpt_node, MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
>>> +void cpd_proc_decrease_node_user_info(CPD_CKPT_INFO_NODE 
>>> *ckpt_node, MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
>>> +void cpd_proc_update_user_info_when_node_down(CPD_CB *cb, NODE_ID 
>>> node_id);
>>>   uint32_t cpd_proc_ckpt_update_post(CPD_CB *cb);
>>>   #endif
>>> diff --git a/osaf/libs/common/cpsv/include/cpd_red.h 
>>> b/osaf/libs/common/cpsv/include/cpd_red.h
>>> --- a/osaf/libs/common/cpsv/include/cpd_red.h
>>> +++ b/osaf/libs/common/cpsv/include/cpd_red.h
>>> @@ -64,6 +64,18 @@ typedef struct cpd_a2s_ckpt_usr_info {
>>> } CPD_A2S_CKPT_USR_INFO;
>>>   +typedef struct cpd_a2s_ckpt_usr_info_2 {
>>> +SaCkptCheckpointHandleT ckpt_id;
>>> +uint32_t num_user;
>>> +uint32_t num_writer;
>>> +uint32_t num_reader;
>>> +uint32_t num_sections;
>>> +uint32_t ckpt_on_scxb1;
>>> +uint32_t ckpt_on_scxb2;
>>> +uint32_t node_users_cnt;
>>> +CPD_NODE_USER_INFO *node_list;
>>> +} CPD_A2S_CKPT_USR_INFO_2;
>>> +
>>>   typedef struct cpd_mbcsv_msg {
>>>   CPD_MBCSV_MSG_TYPE type;
>>&

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V4

2016-08-09 Thread A V Mahesh
Hi Hoang ,

Please hold on pushing.

On new node we have see some issue please check CPD enode and decode 
once ( new patch node ) .

Aug  9 14:23:01 SC-1 osafckptd[20478]: hj_enc.c:311: 
decode_flatten_space: Assertion 'p8' failed.
Aug  9 14:23:01 SC-1 osafamfnd[20439]: NO 
'safComp=CPD,safSu=SC-1,safSg=2N,safApp=OpenSAF' faulted due to 
'avaDown' : Recovery is 'nodeFailfast'

-AVM



On 8/9/2016 2:09 PM, A V Mahesh wrote:
> ACK,
>
> -AVM
>
>
> On 8/3/2016 4:02 PM, Hoang Vo wrote:
>>   osaf/libs/common/cpsv/include/cpd_cb.h |2 +
>>   osaf/libs/common/cpsv/include/cpd_proc.h |3 +
>>   osaf/libs/common/cpsv/include/cpd_red.h  |   13 ++
>>   osaf/libs/common/cpsv/include/cpsv_evt.h |8 +
>>   osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 ++-
>>   osaf/services/saf/cpsv/cpd/cpd_evt.c |8 +
>>   osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   96 ---
>>   osaf/services/saf/cpsv/cpd/cpd_proc.c|  148 
>> +++
>>   osaf/services/saf/cpsv/cpd/cpd_red.c |   30 -
>>   osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   57 +--
>>   10 files changed, 344 insertions(+), 35 deletions(-)
>>
>>
>> Problem:
>> ---
>> The saCkptCheckpointNumOpeners is not updated when a node which has a 
>> checkpoint client restarts.
>>
>> Solution:
>> 
>> Currently CPD doesn't store number of user on each node. This patch 
>> updates CPD to update information
>> about users on each node for each checkpoint. When a node restarts, 
>> the CPD update the total number of
>> users for a checkpoint accordingly. This is reflected on 
>> saCkptCheckpointNumOpeners attribute correctly.
>>
>> diff --git a/osaf/libs/common/cpsv/include/cpd_cb.h 
>> b/osaf/libs/common/cpsv/include/cpd_cb.h
>> --- a/osaf/libs/common/cpsv/include/cpd_cb.h
>> +++ b/osaf/libs/common/cpsv/include/cpd_cb.h
>> @@ -92,6 +92,8 @@ typedef struct cpd_ckpt_info_node {
>>   uint32_t num_users;
>>   uint32_t num_readers;
>>   uint32_t num_writers;
>> +uint32_t node_users_cnt;
>> +CPD_NODE_USER_INFO *node_users;
>> /* for imm */
>>   SaUint32T ckpt_used_size;
>> diff --git a/osaf/libs/common/cpsv/include/cpd_proc.h 
>> b/osaf/libs/common/cpsv/include/cpd_proc.h
>> --- a/osaf/libs/common/cpsv/include/cpd_proc.h
>> +++ b/osaf/libs/common/cpsv/include/cpd_proc.h
>> @@ -108,5 +108,8 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_
>>   uint32_t cpd_mbcsv_close(CPD_CB *cb);
>>   bool cpd_is_noncollocated_replica_present_on_payload(CPD_CB *cb, 
>> CPD_CKPT_INFO_NODE *ckpt_node);
>>   uint32_t cpd_ckpt_reploc_imm_object_delete(CPD_CB *cb, 
>> CPD_CKPT_REPLOC_INFO *ckpt_reploc_node ,bool is_unlink_set);
>> +void cpd_proc_increase_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node, 
>> MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
>> +void cpd_proc_decrease_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node, 
>> MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
>> +void cpd_proc_update_user_info_when_node_down(CPD_CB *cb, NODE_ID 
>> node_id);
>>   uint32_t cpd_proc_ckpt_update_post(CPD_CB *cb);
>>   #endif
>> diff --git a/osaf/libs/common/cpsv/include/cpd_red.h 
>> b/osaf/libs/common/cpsv/include/cpd_red.h
>> --- a/osaf/libs/common/cpsv/include/cpd_red.h
>> +++ b/osaf/libs/common/cpsv/include/cpd_red.h
>> @@ -64,6 +64,18 @@ typedef struct cpd_a2s_ckpt_usr_info {
>> } CPD_A2S_CKPT_USR_INFO;
>>   +typedef struct cpd_a2s_ckpt_usr_info_2 {
>> +SaCkptCheckpointHandleT ckpt_id;
>> +uint32_t num_user;
>> +uint32_t num_writer;
>> +uint32_t num_reader;
>> +uint32_t num_sections;
>> +uint32_t ckpt_on_scxb1;
>> +uint32_t ckpt_on_scxb2;
>> +uint32_t node_users_cnt;
>> +CPD_NODE_USER_INFO *node_list;
>> +} CPD_A2S_CKPT_USR_INFO_2;
>> +
>>   typedef struct cpd_mbcsv_msg {
>>   CPD_MBCSV_MSG_TYPE type;
>>   union {
>> @@ -76,6 +88,7 @@ typedef struct cpd_mbcsv_msg {
>>   CPD_A2S_CKPT_UNLINK ckpt_ulink;
>>   CPD_A2S_CKPT_USR_INFO usr_info;
>>   CPSV_CKPT_DEST_INFO dest_down;
>> +CPD_A2S_CKPT_USR_INFO_2 usr_info_2;
>>   } info;
>>   } CPD_MBCSV_MSG;
>>   diff --git a/osaf/libs/common/cpsv/include/cpsv_evt.h 
>> b/osaf/libs/common/cpsv/include/cpsv_evt.h
>> --- a/osaf/libs/common/cpsv/include/cpsv_evt.h
>> +++ b/osaf/libs/common/cpsv/include/cpsv_evt.h
>> @@ -840,6 +840,14 @@ typedef struct cpd_tmr_info {
>>   } info;
>>   } CPD_TMR_

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V4

2016-08-09 Thread A V Mahesh
ACK,

-AVM


On 8/3/2016 4:02 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/include/cpd_cb.h   |2 +
>   osaf/libs/common/cpsv/include/cpd_proc.h |3 +
>   osaf/libs/common/cpsv/include/cpd_red.h  |   13 ++
>   osaf/libs/common/cpsv/include/cpsv_evt.h |8 +
>   osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 ++-
>   osaf/services/saf/cpsv/cpd/cpd_evt.c |8 +
>   osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   96 ---
>   osaf/services/saf/cpsv/cpd/cpd_proc.c|  148 
> +++
>   osaf/services/saf/cpsv/cpd/cpd_red.c |   30 -
>   osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   57 +--
>   10 files changed, 344 insertions(+), 35 deletions(-)
>
>
> Problem:
> ---
> The saCkptCheckpointNumOpeners is not updated when a node which has a 
> checkpoint client restarts.
>
> Solution:
> 
> Currently CPD doesn't store number of user on each node. This patch updates 
> CPD to update information
> about users on each node for each checkpoint. When a node restarts, the CPD 
> update the total number of
> users for a checkpoint accordingly. This is reflected on 
> saCkptCheckpointNumOpeners attribute correctly.
>
> diff --git a/osaf/libs/common/cpsv/include/cpd_cb.h 
> b/osaf/libs/common/cpsv/include/cpd_cb.h
> --- a/osaf/libs/common/cpsv/include/cpd_cb.h
> +++ b/osaf/libs/common/cpsv/include/cpd_cb.h
> @@ -92,6 +92,8 @@ typedef struct cpd_ckpt_info_node {
>   uint32_t num_users;
>   uint32_t num_readers;
>   uint32_t num_writers;
> + uint32_t node_users_cnt;
> + CPD_NODE_USER_INFO *node_users;
>   
>   /* for imm */
>   SaUint32T ckpt_used_size;
> diff --git a/osaf/libs/common/cpsv/include/cpd_proc.h 
> b/osaf/libs/common/cpsv/include/cpd_proc.h
> --- a/osaf/libs/common/cpsv/include/cpd_proc.h
> +++ b/osaf/libs/common/cpsv/include/cpd_proc.h
> @@ -108,5 +108,8 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_
>   uint32_t cpd_mbcsv_close(CPD_CB *cb);
>   bool cpd_is_noncollocated_replica_present_on_payload(CPD_CB *cb, 
> CPD_CKPT_INFO_NODE *ckpt_node);
>   uint32_t cpd_ckpt_reploc_imm_object_delete(CPD_CB *cb,  
> CPD_CKPT_REPLOC_INFO *ckpt_reploc_node ,bool is_unlink_set);
> +void cpd_proc_increase_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node, 
> MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
> +void cpd_proc_decrease_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node, 
> MDS_DEST cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
> +void cpd_proc_update_user_info_when_node_down(CPD_CB *cb, NODE_ID node_id);
>   uint32_t cpd_proc_ckpt_update_post(CPD_CB *cb);
>   #endif
> diff --git a/osaf/libs/common/cpsv/include/cpd_red.h 
> b/osaf/libs/common/cpsv/include/cpd_red.h
> --- a/osaf/libs/common/cpsv/include/cpd_red.h
> +++ b/osaf/libs/common/cpsv/include/cpd_red.h
> @@ -64,6 +64,18 @@ typedef struct cpd_a2s_ckpt_usr_info {
>   
>   } CPD_A2S_CKPT_USR_INFO;
>   
> +typedef struct cpd_a2s_ckpt_usr_info_2 {
> + SaCkptCheckpointHandleT ckpt_id;
> + uint32_t num_user;
> + uint32_t num_writer;
> + uint32_t num_reader;
> + uint32_t num_sections;
> + uint32_t ckpt_on_scxb1;
> + uint32_t ckpt_on_scxb2;
> + uint32_t node_users_cnt;
> + CPD_NODE_USER_INFO *node_list;
> +} CPD_A2S_CKPT_USR_INFO_2;
> +
>   typedef struct cpd_mbcsv_msg {
>   CPD_MBCSV_MSG_TYPE type;
>   union {
> @@ -76,6 +88,7 @@ typedef struct cpd_mbcsv_msg {
>   CPD_A2S_CKPT_UNLINK ckpt_ulink;
>   CPD_A2S_CKPT_USR_INFO usr_info;
>   CPSV_CKPT_DEST_INFO dest_down;
> + CPD_A2S_CKPT_USR_INFO_2 usr_info_2;
>   } info;
>   } CPD_MBCSV_MSG;
>   
> diff --git a/osaf/libs/common/cpsv/include/cpsv_evt.h 
> b/osaf/libs/common/cpsv/include/cpsv_evt.h
> --- a/osaf/libs/common/cpsv/include/cpsv_evt.h
> +++ b/osaf/libs/common/cpsv/include/cpsv_evt.h
> @@ -840,6 +840,14 @@ typedef struct cpd_tmr_info {
>   } info;
>   } CPD_TMR_INFO;
>   
> +typedef struct cpd_node_user_info {
> + MDS_DEST dest;
> + uint32_t num_users;
> + uint32_t num_writers;
> + uint32_t num_readers;
> + struct cpd_node_user_info *next;
> +} CPD_NODE_USER_INFO;
> +
>   
> /**
>CPD Event Data Structures
>
> **/
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_db.c 
> b/osaf/services/saf/cpsv/cpd/cpd_db.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_db.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_db.c
> @@ -137,6 +137,7 @@ uint32_t cpd_ckpt_node_delete(CPD_CB *cb
>   {
>   uint32_t rc = NCSCC_RC_SUCCESS;
>   CPD_NODE_REF_INFO *nref_info, *next_info;
> + CPD_NODE_USER_INFO *node_user, *next_node_user;
>   
>   TRACE_ENTER();
>   
> @@ -153,6 +154,13 @@ uint32_t cpd_ckpt_node_delete(CPD_CB *cb
>   nref_info = next_info;
>   }
>   
> + node_user = ckpt_node->node_users;
> + while (node_user) {
> +   

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-08-09 Thread A V Mahesh
Hi Hoang,

This patch looks more stable , I haven t found any issue in basic in 
service upgrade testing testing .

I am going to ACK the patch.

-AVM

On 8/3/2016 4:11 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> I have just submit a V4 patch that try to eliminate the possible error in
> communicating between old and new version.
>
> My testing shows OK result but when I cannot reproduce the problem exactly,
> I do not have high confident about it.
>
> Would you please help me review and check the result of this patch.
>
> Thank you and best regards,
> Hoang
>
> -----Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Wednesday, July 27, 2016 4:53 PM
> To: Vo Minh Hoang <hoang.m...@dektech.com.au>; 'Nhat Pham'
> <nhat.p...@dektech.com.au>; anders.wid...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
> node [#1669] V3
>
> Hi  Hoang,
>
> I still able to reproduce the problem , some time it increments two time of
> current readers ,
>
> some time it is getting  decremented to less then zero ( variable are set
> (0xfff6) )
>
> Unfortunately I don't have any specific steps order , but this issue occurs
> in cluster setup with  1new controller & 1 old controller  and  2 old
> payloads
>
> when tow  application opened & holded  on old payloads ( don't exist) , and
> try to do fail-overs of controllers and then exit the applications on both
> payloads,
>
> you will end up with error.
>
> I broad , I suggest you look at the new messages that are getting introduced
> in this patch are prevented with version check
>
> 
> ===
>
> PL-3:~ # immlist safCkpt=checkpoint_test77
> Name   Type Value(s)
> 
> safCkptSA_STRING_T
> safCkpt=checkpoint_test77
> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
> saCkptCheckpointSize   SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointRetDurationSA_TIME_T
> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
> saCkptCheckpointNumWriters SA_UINT32_T
> 4294967286 (0xfff6)
> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointNumReplicasSA_UINT32_T  2 (0x2)
> saCkptCheckpointNumReaders SA_UINT32_T
> 4294967286 (0xfff6)
> saCkptCheckpointNumOpeners SA_UINT32_T  0 (0x0)
> saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
> saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
> *saCkptCheckpointCreationTimestamp  SA_TIME_T
> 14696097540 (0x14651a48f19e8400, Wed Jul 27 14:25:54 2016)*
> saCkptCheckpointCreationFlags  SA_UINT32_T  2 (0x2)
> SaImmAttrImplementerName   SA_STRING_T
> safCheckPointService
> SaImmAttrClassName SA_STRING_T
> SaCkptCheckpoint
> SaImmAttrAdminOwnerNameSA_STRING_T 
>
>
>
> SC-2:~ # immlist safCkpt=checkpoint_test77
> Name   Type Value(s)
> 
> safCkptSA_STRING_T
> safCkpt=checkpoint_test77
> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
> saCkptCheckpointSize   SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointRetDurationSA_TIME_T
> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
> saCkptCheckpointNumWriters SA_UINT32_T  20 (0x14)
> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointNumReplicasSA_UINT32_T  2 (0x2)
> saCkptCheckpointNumReaders SA_UINT32_T  20 (0x14)
> saCkptCheckpointNumOpeners SA_UINT32_T  20 (0x14)
> saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
> saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointMaxSectionSize SA_UI

Re: [devel] [PATCH 1 of 1] log: client crashed due to not initialize the client_list pointer [#1933]

2016-08-09 Thread A V Mahesh
ACK,

-AVM


On 8/5/2016 1:16 PM, Vu Minh Nguyen wrote:
>   osaf/libs/agents/saf/lga/lga_api.c   |  3 ++-
>   osaf/libs/agents/saf/lga/lga_state.c |  2 +-
>   2 files changed, 3 insertions(+), 2 deletions(-)
>
>
> Not initilize the global pointer variable `client_list`.  It might refer to an
> invalid/unallocated memory. If it is the case, the application will be 
> crashed.
>
> This patch does initialize.
>
> diff --git a/osaf/libs/agents/saf/lga/lga_api.c 
> b/osaf/libs/agents/saf/lga/lga_api.c
> --- a/osaf/libs/agents/saf/lga/lga_api.c
> +++ b/osaf/libs/agents/saf/lga/lga_api.c
> @@ -42,7 +42,8 @@
>   /* The main controle block */
>   lga_cb_t lga_cb = {
>   .cb_lock = PTHREAD_MUTEX_INITIALIZER,
> - .lgs_state = LGS_START
> + .lgs_state = LGS_START,
> + .client_list = NULL
>   };
>   
>   static bool is_well_know_stream(const char* dn)
> diff --git a/osaf/libs/agents/saf/lga/lga_state.c 
> b/osaf/libs/agents/saf/lga/lga_state.c
> --- a/osaf/libs/agents/saf/lga/lga_state.c
> +++ b/osaf/libs/agents/saf/lga/lga_state.c
> @@ -359,7 +359,7 @@ static void *recovery2_thread(void *dumm
>   lga_client_hdl_rec_t *p_client;
>   p_client = lga_cb.client_list;
>   
> - while (p_client != NULL) {
> + while (p_client != NULL && p_client->recovered_flag == false) {
>   /* Exit if requested to */
>   rc = osaf_poll_one_fd(state2_terminate_sel_obj.rmv_obj, 0);
>   if (rc > 0) {


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] log: build saflogger tool failed on 32-bit machine [#1936]

2016-08-07 Thread A V Mahesh
Hi,

ACK.

-AVM


On 8/5/2016 5:04 PM, Vu Minh Nguyen wrote:
>   osaf/tools/saflog/saflogger/saf_logger.c |  2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> Fix build saflogger failed on 32-bit machine.
>
> Using format "%zu" instead of "%lu" for data type size_t.
>
> diff --git a/osaf/tools/saflog/saflogger/saf_logger.c 
> b/osaf/tools/saflog/saflogger/saf_logger.c
> --- a/osaf/tools/saflog/saflogger/saf_logger.c
> +++ b/osaf/tools/saflog/saflogger/saf_logger.c
> @@ -330,7 +330,7 @@ int main(int argc, char *argv[])
>   snprintf(tmpDn, sizeof(tmpDn), "safLgStr=%s", 
> optarg);
>   
>   if (strlen(tmpDn) > kOsafMaxDnLength) {
> - fprintf(stderr, "Application stream DN is so 
> long (%lu). Max: %d \n",
> + fprintf(stderr, "Application stream DN is so 
> long (%zu). Max: %d \n",
>   strlen(optarg), kOsafMaxDnLength);
>   fprintf(stderr, "Shut down app. \n");
>   exit(EXIT_FAILURE);


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


Re: [devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638] V3

2016-08-05 Thread A V Mahesh
Hi Vu,

I Incorporated most of your review comments please review  `lgs: 
director Cluster Membership (CLM) integration [#1638] V4`.

-AVM

On 8/5/2016 10:26 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> I have some comments [Vu].
>
> Regards, Vu
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: Thursday, August 4, 2016 6:13 PM
>> To: vu.m.ngu...@dektech.com.au; lennart.l...@ericsson.com;
>> anders.wid...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration
>> [#1638] V3
>>
>>   osaf/services/saf/logsv/lgs/Makefile.am |7 +-
>>   osaf/services/saf/logsv/lgs/lgs_cb.h|9 +
>>   osaf/services/saf/logsv/lgs/lgs_clm.cc  |  403
>> 
>>   osaf/services/saf/logsv/lgs/lgs_clm.h   |   39 +++
>>   osaf/services/saf/logsv/lgs/lgs_evt.cc  |   15 +
>>   osaf/services/saf/logsv/lgs/lgs_main.cc |   28 ++
>>   osaf/services/saf/logsv/lgs/lgs_mds.cc  |   38 ++-
>>   7 files changed, 536 insertions(+), 3 deletions(-)
>>
>>
>> diff --git a/osaf/services/saf/logsv/lgs/Makefile.am
>> b/osaf/services/saf/logsv/lgs/Makefile.am
>> --- a/osaf/services/saf/logsv/lgs/Makefile.am
>> +++ b/osaf/services/saf/logsv/lgs/Makefile.am
>> @@ -37,7 +37,8 @@ noinst_HEADERS = \
>>  lgs_mbcsv_v3.h \
>>  lgs_mbcsv_v5.h \
>>  lgs_recov.h \
>> -lgs_imm_gcfg.h
>> +lgs_imm_gcfg.h \
>> +lgs_clm.h
>>
>>   osaf_execbindir = $(pkglibdir)
>>   osaf_execbin_PROGRAMS = osaflogd
>> @@ -67,7 +68,8 @@ osaflogd_SOURCES = \
>>  lgs_mbcsv_v3.cc \
>>  lgs_mbcsv_v5.cc \
>>  lgs_recov.cc \
>> -lgs_imm_gcfg.cc
>> +lgs_imm_gcfg.cc \
>> +lgs_clm.cc
>>
>>   osaflogd_LDADD = \
>>  $(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
>> @@ -75,4 +77,5 @@ osaflogd_LDADD = \
>>  $(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
>> +$(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
>>  $(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> --- a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> +++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> @@ -21,6 +21,7 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>>   #include 
>>   #include 
>>
>> @@ -73,6 +74,7 @@ typedef struct lgs_cb {
>>  MDS_DEST vaddr; /* My identification in MDS
>> */
>>  SaVersionT log_version; /* The version currently supported
>> */
>>  NCS_PATRICIA_TREE client_tree;  /* LGA/Library/Client
>> instantiation pat. tree */
>> +void *clm_node_db;   /* used for C++ STL map */
>>  SaNameT comp_name;  /* Components's name LGS
> */
>>  SaAmfHandleT amf_hdl;   /* AMF handle, obtained thru AMF
>> init*/
>>  SaSelectionObjectT amfSelectionObject;  /* Selection Object
>> to wait for AMF events */
>> @@ -80,6 +82,9 @@ typedef struct lgs_cb {
>>  bool is_quiesced_set;
>>  SaImmOiHandleT immOiHandle; /* IMM OI handle
>> */
>>  SaSelectionObjectT immSelectionObject;  /* Selection Object
>> to wait for IMM events */
>> +SaSelectionObjectT clmSelectionObject;  /* Selection Object to wait
>> for clms events */
>> +SaClmHandleT clm_hdl;   /* CLM handle, obtained through CLM init
>> */
>> +//  bool clm_initialized; //For CLM init status;
>>  SaAmfHAStateT ha_state; /* present AMF HA state of the
>> component */
>>  uint32_t last_client_id;/* Value of last client_id assigned
> */
>>  uint32_t async_upd_cnt; /* Async Update Count for
>> Warmsync */
>> @@ -94,6 +99,7 @@ typedef struct lgs_cb {
>>  down events Processing
> */
>>  LGA_DOWN_LIST *lga_down_list_tail;
>>
>> +NCS_SEL_OBJ clm_init_sel_obj; /* Selection object for CLM
>> initialization.*/
>>  bool nid_started;   /**< true if started by NID */
>>  SaUint32T scAbsenceAllowed; /* OpenSAF global configuration for
>> recovery handling */
>>  lgs_state_t lgs_recovery_state; /* Indicate current recovery state
> for
>> the server */
>> @@ -106,5 +112,8 @@ typedef struct lgs_cb {
>>   extern uint32_t lgs_cb_init(lgs_cb_t *);
>>   extern void lgs_process_mbx(SYSF_MBX *mbx);
>>   extern uint32_t lgs_stream_add(lgs_cb_t *cb, log_stream_t *stream);
>> +extern uint32_t lgs_clm_node_del(NODE_ID node_id);
>> +extern uint32_t lgs_clm_node_add(NODE_ID node_id);
>> +extern uint32_t lgs_clm_node_find(NODE_ID node_id);
>>
>>   #endif
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_clm.cc
>> b/osaf/services/saf/logsv/lgs/lgs_clm.cc
>> new file mode 100644
>> --- /dev/null
>> +++ b/osaf/services/saf/logsv/lgs/lgs_clm.cc
>> @@ -0,0 +1,403 @@
>> +/*  -*- OpenSAF -*-
>> + *
>> + * (C) Copyright 2016 The OpenSAF Foundation
>> + *
>> + * This program is 

Re: [devel] [PATCH 3 of 3] logtest: change related to Cluster Membership (CLM) integration [#1638] V3

2016-08-05 Thread A V Mahesh
Hi Lennart,

Added test suite 14 , please review`logtest: change related to 
Cluster Membership (CLM) integration [#1638] V4  & tests: added missing 
saf_error strings [#1638] V4`,
also incorporated , the other review comments as well.

-AVM

On 8/4/2016 6:23 PM, Lennart Lund wrote:
> Hi Mahesh
>
> Please create UML test cases. In log service it is possible if needed to 
> create test cases that does not run as part of the legacy test suite (when 
> using command logtest without options or parameters). It is also possible to 
> create test cases where the tester is asked to do actions e.g. stop or start 
> a node. See tet_Log_recov.c (saLogRecov_req_node_start, 
> saLogRecov_req_node_stop, add_suite_nn...) as an example.
>
> Thanks
> Lennart
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: den 4 augusti 2016 13:13
>> To: Vu Minh Nguyen ; Lennart Lund
>> ; Anders Widell 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 3 of 3] logtest: change related to Cluster Membership (CLM)
>> integration [#1638] V3
>>
>>   tests/logsv/saflogtest.c |  2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>>
>> Test :
>>
>>#amf-adm lock safNode=PL-4,safCluster=myClmCluster
>>
>>   failed with code SA_AIS_ERR_UNAVAILABLE (31).
>>
>> #amf-adm unlock safNode=PL-4,safCluster=myClmCluster
>>
>>   failed with code SA_AIS_ERR_UNAVAILABLE (31).
>>
>>   #amf-adm lock safNode=PL-4,safCluster=myClmCluster  + (SC-1 & Sc-2
>> /etc/init.d/opensafd stop)
>>
>>   failed with code SA_AIS_ERR_UNAVAILABLE (31)
>>
>> # amf-adm lock safNode=PL-4,safCluster=myClmCluster  + ((SC-1 & Sc-2
>> /etc/init.d/opensafd stop)) +
>>((SC-1 & Sc-2 /etc/init.d/opensafd start) + amf-adm unlock safNode=PL-
>> 4,safCluster=myClmCluster
>>
>> failed with code SA_AIS_ERR_UNAVAILABLE (31)
>>
>>Expected  but currently The Imm APIs are NOT working
>>  error - saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2)
>>
>> diff --git a/tests/logsv/saflogtest.c b/tests/logsv/saflogtest.c
>> --- a/tests/logsv/saflogtest.c
>> +++ b/tests/logsv/saflogtest.c
>> @@ -86,7 +86,7 @@ static inline void time_meas_log(time_me
>>   static void logWriteLogCallbackT(SaInvocationT invocation, SaAisErrorT
>> error);
>>
>>   static SaLogCallbacksT logCallbacks = { 0, 0, logWriteLogCallbackT };
>> -static SaVersionT logVersion = { 'A', 2, 1 };
>> +static SaVersionT logVersion = { 'A', 2, 2 };
>>
>>   static char *progname = "saflogtest";
>>   static SaInvocationT cb_invocation;


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


Re: [devel] [PATCH 1 of 1] dtm: When IPv4 broadcast address is not configured, derive it from IP and netmask [#1930]

2016-08-04 Thread A V Mahesh
Hi Anders Widell,

Did you verified IP6 or you want me to test ?

-AVM


On 8/4/2016 2:22 PM, Anders Widell wrote:
>   osaf/services/infrastructure/dtms/dtm/dtm_read_config.c |  36 
> +++-
>   1 files changed, 32 insertions(+), 4 deletions(-)
>
>
> The IPv4 broadcast address is sometimes not configured when running in some
> container environments (e.g. docker). In these cases, derive the broadcast
> address from the IPv4 address and netmask.
>
> diff --git a/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c 
> b/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
> --- a/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
> +++ b/osaf/services/infrastructure/dtms/dtm/dtm_read_config.c
> @@ -15,10 +15,15 @@
>*
>*/
>   
> +#include 
> +#include 
> +#include 
>   #include 
> -#include 
> +#include 
> +#include 
> +#include 
>   #include 
> -#include 
> +#include "logtrace.h"
>   #include "ncs_main_papi.h"
>   #include "dtm.h"
>   #include "dtm_socket.h"
> @@ -162,8 +167,31 @@ char *dtm_validate_listening_ip_addr(DTM
>   
>   //Bcast  Address
>   if (if_addr->ifa_addr->sa_family == AF_INET) {
> - tmp = &((struct sockaddr_in 
> *)if_addr->ifa_broadaddr)->sin_addr;
> - inet_ntop(if_addr->ifa_addr->sa_family, 
> tmp, config->bcast_addr,sizeof(buf));
> + struct in_addr addr =
> + ((struct sockaddr_in*) if_addr->
> +  ifa_addr)->sin_addr;
> + struct in_addr netmask =
> + ((struct sockaddr_in*) if_addr->
> +  ifa_netmask)->sin_addr;
> + struct in_addr broadaddr =
> + ((struct sockaddr_in*) if_addr->
> +  ifa_broadaddr)->sin_addr;
> + TRACE("DTM: addr=0x%" PRIx32,
> +   ntohl(addr.s_addr));
> + TRACE("DTM: netmask=0x%" PRIx32,
> +   ntohl(netmask.s_addr));
> + TRACE("DTM: broadaddr=0x%" PRIx32,
> +   ntohl(broadaddr.s_addr));
> + if (broadaddr.s_addr == addr.s_addr ||
> + broadaddr.s_addr ==
> + htonl(INADDR_ANY)) {
> + broadaddr.s_addr = addr.s_addr |
> + ~netmask.s_addr;
> + }
> + inet_ntop(if_addr->ifa_addr->sa_family,
> +   ,
> +   config->bcast_addr,
> +   sizeof(buf));
>   } else if (if_addr->ifa_addr->sa_family == 
> AF_INET6) {
>   struct sockaddr_in6 *addr = (struct 
> sockaddr_in6 *)if_addr->ifa_addr;
>   memset(config->bcast_addr, 0, 
> INET6_ADDRSTRLEN);


--
___
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 lgsv: Log Service CLM integration [#1638] V2

2016-08-04 Thread A V Mahesh
/logsv/lgs/lgs_clm.cc:113:  Lines should be <= 80 
> characters long  [whitespace/line_length] [2]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:114:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:115:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:116:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:117:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:118:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:119:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:120:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:121:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:128:  { should almost always 
> be at the end of the previous line  [whitespace/braces] [4]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:129:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:130:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:131:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:133:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:134:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:136:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:137:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:138:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:139:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:140:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:141:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
>
> regards,
>
> Anders Widell
>
> On 08/02/2016 10:17 AM, mahesh.va...@oracle.com wrote:
>> Summary:lgsv: Log Service CLM integration [#1638] V2
>> Review request for Trac Ticket(s):  #1638
>> Peer Reviewer(s): Vu, Lennart,Anders Widell
>> Pull request to: <>
>> Affected branch(es): default
>> Development branch: defult
>>
>> 
>> 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 3dbef8972c5101149a4754c43557e72acda32833
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 02 Aug 2016 13:40:55 +0530
>>
>> lga: agent Cluster Membership (CLM) integration [#1638] V2
>>  V2 patch:
>>
>> Incorporated Anders Widell and Vu review comments , for more details
>> see the review comments posted on V1 patch. Description:
>>
>> Form CLM integration is supported from Log Service A.02.02.
>>
>> At-least a A.02.02 LGA client will check CLM membership status of 
>> client's
>> node. old LGA clients A.02.01 are always clm member.
>>
>> This patch enhanced the log service for Unavailability of the Log 
>> Service
>> API on a Non-Member Node which will fail with 
>> SA_AIS_ERR_UNAVAILABLE.
>>
>> After this patch the Log Service does not provide service to 
>> processes on
>> cluster nodes that are not in the cluster membership.
>>
>> If the node rejoins the cluster membership, processes executing 
>> on the node
>> will be able to reinitialize new library handles and use the 
>> entire set of
>> Log Service APIs that operate on these new handles; however, 
>> invocation of
>> APIs that operate on handles acquired by any process before the 
>> node left
>> the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE 
>&

Re: [devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638] V2

2016-08-04 Thread A V Mahesh
Hi Lennar,

I incorporated most of your review comments except
creating a LgsClm class in V3 patch please review.

-AVM


On 8/2/2016 6:30 PM, Lennart Lund wrote:
> Hi
>
> My comments for patch 2
>
> I have found some things that should be considered in order to get as clean 
> code as possible:
> 1.
> Functions for handling CLM can be found in several files. It is better to 
> collect all CLM handling in the lgs_clm file and just include function calls 
> in the rest of the code. Also all functions that shall be globally available 
> should have a prototype in the corresponding lgs_clm.h file
> 2.
> New global variables are added to the cb structure. Do not use global 
> variables try at least to keep the scope of state variables, flags and other 
> variables within the lgs_clm file. Implement setter and getter functions if 
> needed or even better functions that are using the variables e.g. like the 
> is_client_clm_member() function. This also makes it possible to make these 
> functions thread safe (do not use the global cb lock mutex). which means
> that this can be handled in one place instead of all over the code
> 3.
> Take advantage of C++ and make simpler handling of lists. It's no longer 
> needed to use patricia tree handling
> Maybe even create a LgsClm class?
>
> See also inline comments [Lennart]
>   
> Thanks
> Lennart
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: den 2 augusti 2016 10:18
>> To: Vu Minh Nguyen ; Lennart Lund
>> ; Anders Widell 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration
>> [#1638] V2
>>
>>   osaf/services/saf/logsv/lgs/Makefile.am |7 +-
>>   osaf/services/saf/logsv/lgs/lgs_cb.h|   15 +++
>>   osaf/services/saf/logsv/lgs/lgs_clm.cc  |  142
>> +++
>>   osaf/services/saf/logsv/lgs/lgs_clm.h   |   25 +
>>   osaf/services/saf/logsv/lgs/lgs_evt.cc  |  143
>> 
>>   osaf/services/saf/logsv/lgs/lgs_evt.h   |2 +
>>   osaf/services/saf/logsv/lgs/lgs_main.cc |   28 ++
>>   osaf/services/saf/logsv/lgs/lgs_mds.cc  |   38 -
>>   osaf/services/saf/logsv/lgs/lgs_util.cc |   83 ++
>>   9 files changed, 480 insertions(+), 3 deletions(-)
>>
>>
>> diff --git a/osaf/services/saf/logsv/lgs/Makefile.am
>> b/osaf/services/saf/logsv/lgs/Makefile.am
>> --- a/osaf/services/saf/logsv/lgs/Makefile.am
>> +++ b/osaf/services/saf/logsv/lgs/Makefile.am
>> @@ -37,7 +37,8 @@ noinst_HEADERS = \
>>  lgs_mbcsv_v3.h \
>>  lgs_mbcsv_v5.h \
>>  lgs_recov.h \
>> -lgs_imm_gcfg.h
>> +lgs_imm_gcfg.h \
>> +lgs_clm.h
>>
>>   osaf_execbindir = $(pkglibdir)
>>   osaf_execbin_PROGRAMS = osaflogd
>> @@ -67,7 +68,8 @@ osaflogd_SOURCES = \
>>  lgs_mbcsv_v3.cc \
>>  lgs_mbcsv_v5.cc \
>>  lgs_recov.cc \
>> -lgs_imm_gcfg.cc
>> +lgs_imm_gcfg.cc \
>> +lgs_clm.cc
>>
>>   osaflogd_LDADD = \
>>  $(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
>> @@ -75,4 +77,5 @@ osaflogd_LDADD = \
>>  $(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
>> +$(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
>>  $(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> --- a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> +++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> @@ -21,6 +21,7 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>>   #include 
>>   #include 
>>
>> @@ -55,6 +56,11 @@ typedef struct lgs_stream_list {
>>   } lgs_stream_list_t;
>>
>>   typedef struct {
>> +NCS_PATRICIA_NODE patnode;
>> +NODE_ID node_id;
>> +} lgs_clm_node_t;
>> +
> [Lennart] Would it be possible to not add new patricia node handling? Since 
> the log service is compiled as C++ code C++ list tools could be used instead?
> lgs_clm_node_find
>> +typedef struct {
>>  NCS_PATRICIA_NODE pat_node;
>>  uint32_t client_id;
>>  uint32_t client_id_net;
>> @@ -73,6 +79,7 @@ typedef struct lgs_cb {
>>  MDS_DEST vaddr; /* My identification in MDS
>> */
>>  SaVersionT log_version; /* The version currently supported
>> */
>>  NCS_PATRICIA_TREE client_tree;  /* LGA/Library/Client
>> instantiation pat. tree */
>> +NCS_PATRICIA_TREE clm_node_tree;  /* LGA/Library/Client
>> instantiation pat. tree */
>>  SaNameT comp_name;  /* Components's name LGS */
>>  SaAmfHandleT amf_hdl;   /* AMF handle, obtained thru AMF
>> init*/
>>  SaSelectionObjectT amfSelectionObject;  /* Selection Object to
>> wait for AMF events */
>> @@ -80,6 +87,9 @@ typedef struct lgs_cb {
>>  bool 

Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V2

2016-08-03 Thread A V Mahesh
af/logsv/lgs/lgs_clm.cc:112:  Should have a space 
> between // and comment  [whitespace/comments] [4]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:113:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:113:  Lines should be <= 80 
> characters long  [whitespace/line_length] [2]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:114:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:115:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:116:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:117:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:118:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:119:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:120:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:121:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:128:  { should almost always 
> be at the end of the previous line  [whitespace/braces] [4]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:129:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:130:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:131:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:133:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:134:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:136:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:137:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:138:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:139:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:140:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
> ./osaf/services/saf/logsv/lgs/lgs_clm.cc:141:  Tab found; better to 
> use spaces  [whitespace/tab] [1]
>
> regards,
>
> Anders Widell
>
> On 08/02/2016 10:17 AM, mahesh.va...@oracle.com wrote:
>> Summary:lgsv: Log Service CLM integration [#1638] V2
>> Review request for Trac Ticket(s):  #1638
>> Peer Reviewer(s): Vu, Lennart,Anders Widell
>> Pull request to: <>
>> Affected branch(es): default
>> Development branch: defult
>>
>> 
>> 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 3dbef8972c5101149a4754c43557e72acda32833
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 02 Aug 2016 13:40:55 +0530
>>
>> lga: agent Cluster Membership (CLM) integration [#1638] V2
>>  V2 patch:
>>
>> Incorporated Anders Widell and Vu review comments , for more details
>> see the review comments posted on V1 patch. Description:
>>
>> Form CLM integration is supported from Log Service A.02.02.
>>
>> At-least a A.02.02 LGA client will check CLM membership status of 
>> client's
>> node. old LGA clients A.02.01 are always clm member.
>>
>> This patch enhanced the log service for Unavailability of the Log 
>> Service
>> API on a Non-Member Node which will fail with 
>> SA_AIS_ERR_UNAVAILABLE.
>>
>> After this patch the Log Service does not provide service to 
>> processes on
>> cluster nodes that are not in the cluster membership.
>>
>> If the node rejoins the cluster membership, processes executing 
>> on the node
>> will be able to reinitialize new library handles and use the 
>> entire set of
>> Log Servi

Re: [devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638] V2

2016-08-03 Thread A V Mahesh
Hi Lennar,

I just incorporated possible comments based on the current code base,
This My fist patch for LOG :)  , so  I just followed how existing 
functions/variables organized like.

I will considered all other inputs while doing  complete refracting code 
to C++  in a separate ticket soon.

Please see also inline response [AVM]

-AVM

On 8/2/2016 6:30 PM, Lennart Lund wrote:
> Hi
>
> My comments for patch 2
>
> I have found some things that should be considered in order to get as clean 
> code as possible:
> 1.
> Functions for handling CLM can be found in several files. It is better to 
> collect all CLM handling in the lgs_clm file and just include function calls 
> in the rest of the code. Also all functions that shall be globally available 
> should have a prototype in the corresponding lgs_clm.h file
[AVM]  I will considered all your inputs while doing  complete 
refracting code to C++  in a separate ticket soon.
> 2.
> New global variables are added to the cb structure. Do not use global 
> variables try at least to keep the scope of state variables, flags and other 
> variables within the lgs_clm file. Implement setter and getter functions if 
> needed or even better functions that are using the variables e.g. like the 
> is_client_clm_member() function. This also makes it possible to make these 
> functions thread safe (do not use the global cb lock mutex). which means
> that this can be handled in one place instead of all over the code
[AVM]  I moved the stuff that is possible based on current code base of 
LOG service , i will take care of your suggestions while doing complete 
refracting code to C++  in a separate ticket soon.
> 3.
> Take advantage of C++ and make simpler handling of lists. It's no longer 
> needed to use patricia tree handling
> Maybe even create a LgsClm class?
[AVM] Same comment was give by Anders Widell as well.
I will do all NCS_PATRICIA_TREE conversion to std::map of 
Log service  in one go in a separate ticket soon.
>
> See also inline comments [Lennart]
>   
> Thanks
> Lennart
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: den 2 augusti 2016 10:18
>> To: Vu Minh Nguyen ; Lennart Lund
>> ; Anders Widell 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration
>> [#1638] V2
>>
>>   osaf/services/saf/logsv/lgs/Makefile.am |7 +-
>>   osaf/services/saf/logsv/lgs/lgs_cb.h|   15 +++
>>   osaf/services/saf/logsv/lgs/lgs_clm.cc  |  142
>> +++
>>   osaf/services/saf/logsv/lgs/lgs_clm.h   |   25 +
>>   osaf/services/saf/logsv/lgs/lgs_evt.cc  |  143
>> 
>>   osaf/services/saf/logsv/lgs/lgs_evt.h   |2 +
>>   osaf/services/saf/logsv/lgs/lgs_main.cc |   28 ++
>>   osaf/services/saf/logsv/lgs/lgs_mds.cc  |   38 -
>>   osaf/services/saf/logsv/lgs/lgs_util.cc |   83 ++
>>   9 files changed, 480 insertions(+), 3 deletions(-)
>>
>>
>> diff --git a/osaf/services/saf/logsv/lgs/Makefile.am
>> b/osaf/services/saf/logsv/lgs/Makefile.am
>> --- a/osaf/services/saf/logsv/lgs/Makefile.am
>> +++ b/osaf/services/saf/logsv/lgs/Makefile.am
>> @@ -37,7 +37,8 @@ noinst_HEADERS = \
>>  lgs_mbcsv_v3.h \
>>  lgs_mbcsv_v5.h \
>>  lgs_recov.h \
>> -lgs_imm_gcfg.h
>> +lgs_imm_gcfg.h \
>> +lgs_clm.h
>>
>>   osaf_execbindir = $(pkglibdir)
>>   osaf_execbin_PROGRAMS = osaflogd
>> @@ -67,7 +68,8 @@ osaflogd_SOURCES = \
>>  lgs_mbcsv_v3.cc \
>>  lgs_mbcsv_v5.cc \
>>  lgs_recov.cc \
>> -lgs_imm_gcfg.cc
>> +lgs_imm_gcfg.cc \
>> +lgs_clm.cc
>>
>>   osaflogd_LDADD = \
>>  $(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
>> @@ -75,4 +77,5 @@ osaflogd_LDADD = \
>>  $(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
>> +$(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
>>  $(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> --- a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> +++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> @@ -21,6 +21,7 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>>   #include 
>>   #include 
>>
>> @@ -55,6 +56,11 @@ typedef struct lgs_stream_list {
>>   } lgs_stream_list_t;
>>
>>   typedef struct {
>> +NCS_PATRICIA_NODE patnode;
>> +NODE_ID node_id;
>> +} lgs_clm_node_t;
>> +
> [Lennart] Would it be possible to not add new patricia node handling? Since 
> the log service is compiled as C++ code C++ list tools could be used instead?
> lgs_clm_node_find
[AVM] Same comment was give by Anders Widell as well.
I will do all NCS_PATRICIA_TREE conversion to 

Re: [devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638] V2

2016-08-02 Thread A V Mahesh
Hi Lennart,

Thanks for the comments.

One of your major comment is  `lga_hdl_rec->is_stale_client` &  
`cb->clm_node_state` is not protected in
lga_mds.c , but if you see the  lga_mds_rcv()  , lga_lgs_msg_proc() it 
self is protected , so all the chances in lga_lgs_msg_proc() are protected.
I understand that the existing code is little bit miss leading.

The other comments I will address in V3 Patch.
==
static uint32_t lga_mds_rcv(struct ncsmds_callback_info *mds_cb_info)
{
 lgsv_msg_t *lgsv_msg = (lgsv_msg_t 
*)mds_cb_info->info.receive.i_msg;
 uint32_t rc;

 osaf_mutex_lock_ordie(_cb.cb_lock);

 /* process the message */
 rc = lga_lgs_msg_proc(_cb, lgsv_msg, 
mds_cb_info->info.receive.i_priority);
 if (rc != NCSCC_RC_SUCCESS) {
 TRACE_2("lga_lgs_msg_proc returned: %d", rc);
 }

 osaf_mutex_unlock_ordie(_cb.cb_lock);

 return rc;
}
==

-AVM

On 8/2/2016 4:21 PM, Lennart Lund wrote:
> Hi
>
> My comments [Lennart]
>
> I will continue reviewing patch 2
>
> Thanks
> Lennart
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: den 2 augusti 2016 07:18
>> To: Vu Minh Nguyen ; Lennart Lund
>> ; Anders Widell 
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration
>> [#1638] V2
>>
>>   osaf/libs/agents/saf/lga/lga.h |   2 +
>>   osaf/libs/agents/saf/lga/lga_api.c |  47 
>>   osaf/libs/agents/saf/lga/lga_mds.c |  69
>> ++
>>   osaf/libs/agents/saf/lga/lga_util.c|   2 +
>>   osaf/libs/common/logsv/include/lgsv_defs.h |   6 ++-
>>   osaf/libs/common/logsv/include/lgsv_msg.h  |  17 +-
>>   6 files changed, 138 insertions(+), 5 deletions(-)
>>
>>
>> V2 patch:
>>
>> Incorporated Anders Widell  and   Vureview comments ,
>> for more details see the review comments posted on V1 patch.
>> Description:
>>
>> Form CLM integration is supported from Log Service A.02.02.
>>
>> At-least a A.02.02 LGA client will check CLM membership status of client's
>> node.
>>   old LGA clients A.02.01 are always clm member.
>>
>> This patch enhanced the log service for Unavailability of the Log Service API
>> on a
>> Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.
>>
>> After this patch the Log Service does not provide service to processes on
>> cluster nodes that are not
>> in the cluster membership.
>>
>> If the node rejoins the cluster membership, processes executing on the
>> node will be
>> able to reinitialize new library handles and use the entire set of Log 
>> Service
>> APIs that
>> operate on these new handles; however, invocation of APIs that operate on
>> handles
>> acquired by any process before the node left the membership will continue
>> to fail with
>> SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above
>> for
>> asynchronous calls) with the exception of saLogFinalize(), which is used to
>> free the
>> library handles and all resources associated with these handles. Hence, it is
>> recommended
>> for the processes to finalize the library handles as soon as the processes
>> detect that the node left the membership.
>>
>> Detailed README will be provide soon.
>>
>> Following are expected Log Service API behavior :
>>
>> Case1: On Non-Member Node,  Log Service API will fail with code
>> SA_AIS_ERR_UNAVAILABLE (31)
>> Case2: On Member Node after recovered from Non-Member Node, Log
>> Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)
>> Case3: Non-Member Node + (Headless) Log Service API will fail with code
>> SA_AIS_ERR_UNAVAILABLE (31)
>> Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API
>> will fail with code SA_AIS_ERR_UNAVAILABLE (31)
> [Lennart] I assume you will move this info about the implementation/feature 
> to the README file
[AVM] Ok , I will add these as expected as behavior to README.
>> diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h
>> --- a/osaf/libs/agents/saf/lga/lga.h
>> +++ b/osaf/libs/agents/saf/lga/lga.h
>> @@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec {
>>   * Set when client is initialized an all
>>   * streams are recovered
>>   */
>> +bool is_stale_client;  /* Status of client based on the CLM status of
>> node.*/
>>   } lga_client_hdl_rec_t;
>>
>>   /* States of the server */
>> @@ -118,6 +119,7 @@ typedef struct {
>>  /* LGS LGA sync params */
>>  int lgs_sync_awaited;
>>  NCS_SEL_OBJ lgs_sync_sel;
>> +SaClmClusterChangesT clm_node_state; /*Reflects CLM status of
>> this 

Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V2

2016-08-02 Thread A V Mahesh
Hi Anders Widell,

Sorry , I missed to do hg add of new file , will resend.

-AVM


On 8/2/2016 1:49 PM, Anders Widell wrote:
> Hi Mahesh!
>
> The files lgs_clm.cc and lgs_clm.h seem to be missing in these 
> patches. Could you please resend?
>
> thanks,
>
> Anders Widell
>
> On 08/02/2016 07:18 AM, mahesh.va...@oracle.com wrote:
>> Summary:lga: agent Cluster Membership (CLM) integration [#1638] V2
>> Review request for Trac Ticket(s): #1638
>> Peer Reviewer(s):Vu, Lennart,Anders Widell
>> 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):
>> -
>>   <>
>>
>> changeset d7c494e940160d474a89dbafbc2cbf058678
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 02 Aug 2016 10:41:21 +0530
>>
>> lga: agent Cluster Membership (CLM) integration [#1638] V2
>>  V2 patch:
>>
>> Incorporated Anders Widell and Vu review comments , for more details
>> see the review comments posted on V1 patch. Description:
>>
>> Form CLM integration is supported from Log Service A.02.02.
>>
>> At-least a A.02.02 LGA client will check CLM membership status of 
>> client's
>> node. old LGA clients A.02.01 are always clm member.
>>
>> This patch enhanced the log service for Unavailability of the Log 
>> Service
>> API on a Non-Member Node which will fail with 
>> SA_AIS_ERR_UNAVAILABLE.
>>
>> After this patch the Log Service does not provide service to 
>> processes on
>> cluster nodes that are not in the cluster membership.
>>
>> If the node rejoins the cluster membership, processes executing 
>> on the node
>> will be able to reinitialize new library handles and use the 
>> entire set of
>> Log Service APIs that operate on these new handles; however, 
>> invocation of
>> APIs that operate on handles acquired by any process before the 
>> node left
>> the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE 
>> (or with
>> the special treatment described above for asynchronous calls) 
>> with the
>> exception of saLogFinalize(), which is used to free the library 
>> handles and
>> all resources associated with these handles. Hence, it is 
>> recommended for
>> the processes to finalize the library handles as soon as the 
>> processes
>> detect that the node left the membership.
>>
>> Detailed README will be provide soon.
>>
>> Following are expected Log Service API behavior :
>>
>> Case1: On Non-Member Node, Log Service API will fail with code
>> SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered 
>> from Non-
>> Member Node, Log Service API will fail with code 
>> SA_AIS_ERR_UNAVAILABLE (31)
>> Case3: Non-Member Node + (Headless) Log Service API will fail 
>> with code
>> SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + 
>> (Headless) + (Head
>> Joined) Log Service API will fail with code 
>> SA_AIS_ERR_UNAVAILABLE (31)
>>
>> changeset dc881a3c478480e44bb163e75a463baaa9430482
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 02 Aug 2016 10:42:11 +0530
>>
>> lgs: director Cluster Membership (CLM) integration [#1638] V2
>>
>> changeset 1742284de46e241c2785744399830017b64ba3df
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 02 Aug 2016 10:42:58 +0530
>>
>> logtest: change related to Cluster Membership (CLM) integration 
>> [#1638] V2
>> Test :
>>
>>  #amf-adm lock safNode=PL-4,safCluster=myClmCluster
>>
>>   failed with code SA_AIS_ERR_UNAVAILABLE (31).
>>
>> #amf-adm unlock safNode=PL-4,safCluster=myClmCluster
>>
>>   failed with code SA_AIS_ERR_UNAVAILABLE (31).
>>

Re: [devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638] V1

2016-08-01 Thread A V Mahesh
Hi Vu,

I incorporated most of your  comments ,
please find my response with [AVM]   &  code change in  V2 patch ( lga: 
agent Cluster Membership (CLM) integration [#1638] V2)

-AVM

On 7/29/2016 9:20 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> I have few comments, started with [Vu]:
>
> General: some places use tabs, some other places use spaces.
>
> Regards, Vu
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, July 26, 2016 3:43 PM
>> To: vu.m.ngu...@dektech.com.au; lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration
>> [#1638] V1
>>
>>   osaf/libs/agents/saf/lga/lga.h |   2 +
>>   osaf/libs/agents/saf/lga/lga_api.c |  37 ++
>>   osaf/libs/agents/saf/lga/lga_mds.c |  75
>> ++
>>   osaf/libs/agents/saf/lga/lga_util.c|   2 +
>>   osaf/libs/common/logsv/include/lgsv_defs.h |   6 ++-
>>   osaf/libs/common/logsv/include/lgsv_msg.h  |  17 +-
>>   6 files changed, 134 insertions(+), 5 deletions(-)
>>
>>
>> Description:
>>
>> Form CLM integration is supported from Log Service A.02.02.
>>
>> At-least a A.02.02 LGA client will check CLM membership status of client's
>> node.
>>   old LGA clients A.02.01 are always clm member.
>>
>> This patch enhanced the log service for Unavailability of the Log Service
> API
>> on a
>> Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.
>>
>> After this patch the Log Service does not provide service to processes on
>> cluster nodes that are not
>> in the cluster membership.
>>
>> If the node rejoins the cluster membership, processes executing on the
> node
>> will be
>> able to reinitialize new library handles and use the entire set of Log
> Service
>> APIs that
>> operate on these new handles; however, invocation of APIs that operate on
>> handles
>> acquired by any process before the node left the membership will continue
>> to fail with
>> SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above
>> for
>> asynchronous calls) with the exception of saLogFinalize(), which is used
> to
>> free the
>> library handles and all resources associated with these handles. Hence, it
> is
>> recommended
>> for the processes to finalize the library handles as soon as the processes
>> detect that the node left the membership.
>>
>> Detailed README will be provide soon.
>>
>> Following are expected Log Service API behavior :
>>
>> Case1: On Non-Member Node,  Log Service API will fail with code
>> SA_AIS_ERR_UNAVAILABLE (31)
>> Case2: On Member Node after recovered from Non-Member Node, Log
>> Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)
>> Case3: Non-Member Node + (Headless) Log Service API will fail with code
>> SA_AIS_ERR_UNAVAILABLE (31)
>> Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API
>> will fail with code SA_AIS_ERR_UNAVAILABLE (31)
>>
>> diff --git a/osaf/libs/agents/saf/lga/lga.h
> b/osaf/libs/agents/saf/lga/lga.h
>> --- a/osaf/libs/agents/saf/lga/lga.h
>> +++ b/osaf/libs/agents/saf/lga/lga.h
>> @@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec {
>>   * Set when client is initialized an all
>>   * streams are recovered
>>   */
>> +bool is_stale_client;  /* Status of client based on the CLM status
> of
>> node.*/
>>   } lga_client_hdl_rec_t;
>>
>>   /* States of the server */
>> @@ -118,6 +119,7 @@ typedef struct {
>>  /* LGS LGA sync params */
>>  int lgs_sync_awaited;
>>  NCS_SEL_OBJ lgs_sync_sel;
>> +SaClmClusterChangesT clm_node_state; /*Reflects CLM status of
>> this node(for future use).*/
>>   } lga_cb_t;
>>
>>   /* lga_saf_api.c */
>> diff --git a/osaf/libs/agents/saf/lga/lga_api.c
>> b/osaf/libs/agents/saf/lga/lga_api.c
>> --- a/osaf/libs/agents/saf/lga/lga_api.c
>> +++ b/osaf/libs/agents/saf/lga/lga_api.c
>> @@ -325,6 +325,14 @@ SaAisErrorT saLogSelectionObjectGet(SaLo
>>  goto done;
>>  }
>>
>> +/*Check CLM membership of node.*/
>> +if (hdl_rec->is_stale_client == true) {
>> +TRACE("Node not CLM member or stale client");
>> +ncshm_give_hdl(logHandle);
>> +rc = SA_AIS_ERR_UNAVAILABLE;
>> +goto done;
>> +}
>> +
>>  /* Obtain the selection object from the IPC queue */
>>  sel_obj = m_NCS_IPC_GET_SEL_OBJ(_rec->mbx);
>>
>> @@ -381,6 +389,14 @@ SaAisErrorT saLogDispatch(SaLogHandleT l
>>  goto done;
>>  }
>>
>> +/*Check CLM membership of node.*/
>> + if (hdl_rec->is_stale_client == true) {
>> + TRACE("Node not CLM member or stale client");
>> + ncshm_give_hdl(logHandle);
>> + rc = SA_AIS_ERR_UNAVAILABLE;
>> + goto done;
>> +}
>> +
>>  if ((rc = lga_hdl_cbk_dispatch(_cb, 

Re: [devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638] V1

2016-08-01 Thread A V Mahesh
Hi Vu,

I incorporated most of your  comments ,
please find my response with [AVM]  & code changes V2 patch (lgs: 
director Cluster Membership (CLM) integration [#1638] V2)

-AVM

On 7/29/2016 9:34 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> See my comments inline, started with [Vu].
>
> Regards, Vu
>
>> -Original Message-
>> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, July 26, 2016 3:43 PM
>> To: vu.m.ngu...@dektech.com.au; lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration
>> [#1638] V1
>>
>>   osaf/services/saf/logsv/lgs/Makefile.am |4 +-
>>   osaf/services/saf/logsv/lgs/lgs.h   |5 +
>>   osaf/services/saf/logsv/lgs/lgs_cb.h|   15 +++
>>   osaf/services/saf/logsv/lgs/lgs_clm.cc  |  143
>> 
>>   osaf/services/saf/logsv/lgs/lgs_evt.cc  |  142
>> +++
>>   osaf/services/saf/logsv/lgs/lgs_evt.h   |1 +
>>   osaf/services/saf/logsv/lgs/lgs_main.cc |   29 ++
>>   osaf/services/saf/logsv/lgs/lgs_mds.cc  |   41 -
>>   osaf/services/saf/logsv/lgs/lgs_util.cc |   83 ++
>>   9 files changed, 460 insertions(+), 3 deletions(-)
>>
>>
>> diff --git a/osaf/services/saf/logsv/lgs/Makefile.am
>> b/osaf/services/saf/logsv/lgs/Makefile.am
>> --- a/osaf/services/saf/logsv/lgs/Makefile.am
>> +++ b/osaf/services/saf/logsv/lgs/Makefile.am
>> @@ -67,7 +67,8 @@ osaflogd_SOURCES = \
>>  lgs_mbcsv_v3.cc \
>>  lgs_mbcsv_v5.cc \
>>  lgs_recov.cc \
>> -lgs_imm_gcfg.cc
>> +lgs_imm_gcfg.cc \
>> +lgs_clm.cc
>>
>>   osaflogd_LDADD = \
>>  $(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
>> @@ -75,4 +76,5 @@ osaflogd_LDADD = \
>>  $(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
>>  $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
>> +$(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
>>  $(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
>> diff --git a/osaf/services/saf/logsv/lgs/lgs.h
>> b/osaf/services/saf/logsv/lgs/lgs.h
>> --- a/osaf/services/saf/logsv/lgs/lgs.h
>> +++ b/osaf/services/saf/logsv/lgs/lgs.h
>> @@ -33,6 +33,7 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>>   #include "saAmf.h"
>>
>>   /* LGS files */
>> @@ -78,6 +79,7 @@
>>   #define LGS_LOG_SHARED_FILESYSTEM 1/* Use shared
>> filesystem. Default */
>>   #define LGS_LOG_SPLIT_FILESYSTEM  2 /* Store logs on local file
> system
>> on
>>  each node */
>> +#define m_LGS_GET_NODE_ID_FROM_ADEST(adest) (NODE_ID)
>> ((uint64_t)adest >> 32)
>>
>>   /*
>> ==
>> ==
>>*   DATA DECLARATIONS
>> @@ -131,4 +133,7 @@ int lgs_get_streamobj_attr(SaImmAttrValu
>> SaImmHandleT *immOmHandle);
>>   int lgs_free_streamobj_attr(SaImmHandleT immHandle);
>>
>> +extern uint32_t send_clm_node_status_change(SaClmClusterChangesT
>> cluster_change, NODE_ID node_id);
>> +extern void lgs_init_with_clm(void);
>> +
>>   #endif   /* ifndef __LGS_H */
>> diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> --- a/osaf/services/saf/logsv/lgs/lgs_cb.h
>> +++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
>> @@ -21,6 +21,7 @@
>>   #include 
>>   #include 
>>   #include 
>> +#include 
>>   #include 
>>   #include 
>>
>> @@ -55,6 +56,11 @@ typedef struct lgs_stream_list {
>>   } lgs_stream_list_t;
>>
>>   typedef struct {
>> +NCS_PATRICIA_NODE patnode;
>> +NODE_ID node_id;
>> +} lgs_clm_node_t;
>> +
>> +typedef struct {
>>  NCS_PATRICIA_NODE pat_node;
>>  uint32_t client_id;
>>  uint32_t client_id_net;
>> @@ -73,6 +79,7 @@ typedef struct lgs_cb {
>>  MDS_DEST vaddr; /* My identification in MDS
>> */
>>  SaVersionT log_version; /* The version currently supported
>> */
>>  NCS_PATRICIA_TREE client_tree;  /* LGA/Library/Client
>> instantiation pat. tree */
>> +NCS_PATRICIA_TREE clm_node_tree;  /* LGA/Library/Client
>> instantiation pat. tree */
>>  SaNameT comp_name;  /* Components's name LGS
> */
>>  SaAmfHandleT amf_hdl;   /* AMF handle, obtained thru AMF
>> init*/
>>  SaSelectionObjectT amfSelectionObject;  /* Selection Object
>> to wait for AMF events */
>> @@ -80,6 +87,9 @@ typedef struct lgs_cb {
>>  bool is_quiesced_set;
>>  SaImmOiHandleT immOiHandle; /* IMM OI handle
>> */
>>  SaSelectionObjectT immSelectionObject;  /* Selection Object
>> to wait for IMM events */
>> +SaSelectionObjectT clmSelectionObject;  /* Selection Object to wait
>> for clms events */
>> +SaClmHandleT clm_hdl;   /* CLM handle, obtained through CLM init
>> */
>> +bool clm_initialized; //For CLM init status;
>>  SaAmfHAStateT ha_state; /* present AMF HA 

Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V1

2016-08-01 Thread A V Mahesh
Hi Anders Widell,

I incorporated most of your  comments except  NCS_PATRICIA_TREE 
refactoring to std::map.
Please find my response with [AVM]  & code changes V2 patch (lgs: 
director Cluster Membership (CLM) integration [#1638] V2)

-AVM

On 7/27/2016 6:54 PM, Anders Widell wrote:
> Hi!
>
> Some comments:
>
> 1) Have you considered using std::map instead of adding a new instance 
> of NCS_PATRICIA_TREE?
> 2) At least when adding completely new files (lgs_clm.cc in this 
> case), could you try to keep them "clean" from cppcheck and cpplint 
> warnings (i.e. make sure there are no warnings in newly added files)?
[AVM] I will do all NCS_PATRICIA_TREE conversion to std::map of Log 
service  in one in a separate ticket soon.

> 3) You have added the new file lgs_clm.cc, but there is no 
> corresponding lgs_clm.h header file. Could you also add the file 
> lgs_clm.h and put the public API of lgs_clm.cc in it?
[AVM] Done.

> 4) lgs_clm.cc has only one single #include statement, which includes 
> "lgs.h". But it uses many interfaces that are not declared in lgs.h. 
> You should not rely on header files being indirectly included from 
> other header files. lgs_clm.cc ought to include all headers that it 
> needs, for example: "saClm.h" for the CLM API,  for uint32_t 
> et.al., "logtrace.h" for the OpenSAF trace API,  for the 
> exit() function and the EXIT_FAILURE constant,  for the 
> pthreads API.
[AVM] Done.

> 5) Isn't the variable name usr2_sel_obj misleading? There is another 
> variable with the very similar name usr1_sel_obj, and it is a 
> selection object which is used when the process receives the SIGUSR1 
> signal. I would have expected that usr2_sel_obj would correspondingly 
> be used when the process receives the SIGUSR2 signal. However, it 
> seems that instead it is actually used to signal an MDS up event for 
> AMFD. I think it ought to be renamed to reflect this. Or maybe even 
> get rid of this selection object and instead post a message in the 
> mailbox when we get this MDS event?
[AVM] Replaced  `usr2_sel_obj`   with `clm_init_sel_obj`

> 6) Why is the usr2_sel_obj created only in the case the when the LOG 
> service is started by NID? This only makes sense for the usr1_sel_obj 
> which is used to signal AMF instantiation when the process has already 
> been started by NID. To me it looks like the code currently doesn't 
> work when it is not started by NID - in this case clmSelectionObject 
> will be initialized to -1 and stay that way forever.
[AVM]  Removed the  nid_started  dependency.

> 7) I suppose the whole reason for triggering CLM initalization after 
> MDS up event from AMFD, using this usr2_sel_obj variable, is to solve 
> some circular dependency problem. But is it at all needed when CLM 
> initialization is taken care of in a separate thread? Wouldn't it work 
> fine if you simply start this CLM initialization thread when you 
> receive an AMF assignment (i.e. start the thread from inside the 
> initialize_for_assignment() function)? Could you try it? :-)
[AVM]  LGS  will/can have  agents prior to AMF , so  spawning CLM 
initialization thread upon AMF assignment may unnecessarily delay the 
CLM member status  to those agent.

> 8) In C++, please use nullptr instead of NULL and 0 (when the type is 
> supposed to be a pointer). So e.g. clm_callbacks should have have 
> nullptr instead if 0 in its first position, and lgs_clm_init_thread 
> ought to return nullptr instead of NULL.

- AVM

>
> thanks,
> Anders Widell
>
> On 07/26/2016 10:42 AM, mahesh.va...@oracle.com wrote:
>> Summary:lgsv: Log Service CLM integration [#1638] V1
>> Review request for Trac Ticket(s): #1638
>> Peer Reviewer(s): Vu, Lennart
>> 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 servicesy
>>   OpenSAF services    n
>>   Core libraries  n
>>   Samples n
>>   Tests   n
>>   Other   n
>>
>>
>> Comments (indicate scope for each "y" above):
>> -
>>
>> changeset 0637f0bfc39b5173776b3cdca088cffd28425432
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 26 Jul 2016 14:07:35 +0530
>>
>> lga: agent Cluster Membership (CLM) integration [#1638] V1 
>> Description:
>>
&g

Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V1

2016-07-29 Thread A V Mahesh
Hi  Anders Widell,

Thank you very much for your comment.
I will get back to you after reviewing each comment.

-AVM


On 7/27/2016 6:54 PM, Anders Widell wrote:
> Hi!
>
> Some comments:
>
> 1) Have you considered using std::map instead of adding a new instance 
> of NCS_PATRICIA_TREE?
> 2) At least when adding completely new files (lgs_clm.cc in this 
> case), could you try to keep them "clean" from cppcheck and cpplint 
> warnings (i.e. make sure there are no warnings in newly added files)?
> 3) You have added the new file lgs_clm.cc, but there is no 
> corresponding lgs_clm.h header file. Could you also add the file 
> lgs_clm.h and put the public API of lgs_clm.cc in it?
> 4) lgs_clm.cc has only one single #include statement, which includes 
> "lgs.h". But it uses many interfaces that are not declared in lgs.h. 
> You should not rely on header files being indirectly included from 
> other header files. lgs_clm.cc ought to include all headers that it 
> needs, for example: "saClm.h" for the CLM API,  for uint32_t 
> et.al., "logtrace.h" for the OpenSAF trace API,  for the 
> exit() function and the EXIT_FAILURE constant,  for the 
> pthreads API.
> 5) Isn't the variable name usr2_sel_obj misleading? There is another 
> variable with the very similar name usr1_sel_obj, and it is a 
> selection object which is used when the process receives the SIGUSR1 
> signal. I would have expected that usr2_sel_obj would correspondingly 
> be used when the process receives the SIGUSR2 signal. However, it 
> seems that instead it is actually used to signal an MDS up event for 
> AMFD. I think it ought to be renamed to reflect this. Or maybe even 
> get rid of this selection object and instead post a message in the 
> mailbox when we get this MDS event?
> 6) Why is the usr2_sel_obj created only in the case the when the LOG 
> service is started by NID? This only makes sense for the usr1_sel_obj 
> which is used to signal AMF instantiation when the process has already 
> been started by NID. To me it looks like the code currently doesn't 
> work when it is not started by NID - in this case clmSelectionObject 
> will be initialized to -1 and stay that way forever.
> 7) I suppose the whole reason for triggering CLM initalization after 
> MDS up event from AMFD, using this usr2_sel_obj variable, is to solve 
> some circular dependency problem. But is it at all needed when CLM 
> initialization is taken care of in a separate thread? Wouldn't it work 
> fine if you simply start this CLM initialization thread when you 
> receive an AMF assignment (i.e. start the thread from inside the 
> initialize_for_assignment() function)? Could you try it? :-)
> 8) In C++, please use nullptr instead of NULL and 0 (when the type is 
> supposed to be a pointer). So e.g. clm_callbacks should have have 
> nullptr instead if 0 in its first position, and lgs_clm_init_thread 
> ought to return nullptr instead of NULL.
>
>
> thanks,
> Anders Widell
>
> On 07/26/2016 10:42 AM, mahesh.va...@oracle.com wrote:
>> Summary:lgsv: Log Service CLM integration [#1638] V1
>> Review request for Trac Ticket(s): #1638
>> Peer Reviewer(s): Vu, Lennart
>> 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 servicesy
>>   OpenSAF services    n
>>   Core libraries  n
>>   Samples n
>>   Tests   n
>>   Other   n
>>
>>
>> Comments (indicate scope for each "y" above):
>> -
>>
>> changeset 0637f0bfc39b5173776b3cdca088cffd28425432
>> Author:A V Mahesh <mahesh.va...@oracle.com>
>> Date:Tue, 26 Jul 2016 14:07:35 +0530
>>
>> lga: agent Cluster Membership (CLM) integration [#1638] V1 
>> Description:
>>
>> Form CLM integration is supported from Log Service A.02.02.
>>
>> At-least a A.02.02 LGA client will check CLM membership status of 
>> client's
>> node. old LGA clients A.02.01 are always clm member.
>>
>> This patch enhanced the log service for Unavailability of the Log 
>> Service
>> API on a Non-Member Node which will fail with 
>> SA_AIS_ERR_UNAVAILABLE.
>>
>> After this patch the Log Service does not provide service to 
>>

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]

2016-07-29 Thread A V Mahesh
Hi Hoang,

Minor comment

-AVM

On 7/21/2016 3:04 PM, Hoang Vo wrote:
>   osaf/libs/agents/saf/cpa/cpa_api.c  |  12 +---
>   osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>   osaf/services/saf/cpsv/cpd/cpd_evt.c|  10 +++---
>   osaf/services/saf/cpsv/cpd/cpd_mds.c|   3 ++-
>   osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  26 --
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c  |   4 ++--
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   6 +++---
>   9 files changed, 42 insertions(+), 24 deletions(-)
>
>
> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c 
> b/osaf/libs/agents/saf/cpa/cpa_api.c
> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
> @@ -880,6 +880,8 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
[AVM] Add   TRACE_LEAVE2  * TRACE
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -981,7 +983,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1192,6 +1194,8 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
[AVM] Add   TRACE_LEAVE2  * TRACE
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -1277,7 +1281,7 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1597,6 +1601,8 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
[AVM] Add   TRACE_LEAVE2  * TRACE
>   
>   /* retrieve CPA CB */
>   m_CPA_RETRIEVE_CB(cb);
> @@ -1635,7 +1641,7 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   /* Populate evt.info.cpnd.info.unlinkReq & Call MDS sync Send */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK_2;
>   
>   osaf_extended_name_lend(ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c 
> b/osaf/libs/agents/saf/cpa/cpa_mds.c
> --- a/osaf/libs/agents/saf/cpa/cpa_mds.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c
> @@ -515,7 +515,7 @@ static uint32_t cpa_mds_svc_evt(CPA_CB *
>  /* Populate & Send the Open Event to CPND */
>  memset(, 0, sizeof(CPSV_EVT));
>  evt.type = CPSV_EVT_TYPE_CPND;
> -evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
> +evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE_2;
>  evt.info.cpnd.info.ckptListUpdate.client_hdl = 
> lc_node->cl_hdl;
>  osaf_extended_name_lend(lc_node->ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -2414,6 +2414,7 @@ uint32_t cpsv_encode_extended_name(NCS_U
>   if(!osaf_is_an_extended_name(name))
>   return NCSCC_RC_SUCCESS;
>   
> + TRACE("length = %d", name->length);
>   SaConstStringT value = osaf_extended_name_borrow(name);
>   uint16_t length = osaf_extended_name_length(name);
>   
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
> b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> @@ -110,6 +110,7 @@ void cpd_process_evt(CPSV_EVT *evt)
>   (void)cpd_evt_proc_timer_expiry(cb, >info.cpd);
>   break;
>   case CPD_EVT_ND2D_CKPT_CREATE:
> + case CPD_EVT_ND2D_CKPT_CREATE_2:
>   

Re: [devel] [PATCH 8 of 8] imported patch 1574_cpnd_support_recover_shm_version_0_v3.patch

2016-07-29 Thread A V Mahesh
Hi Hoang,

Minor comment

-AVM

On 7/21/2016 3:04 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/include/cpsv_shm.h |   20 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c  |1 -
>   osaf/services/saf/cpsv/cpnd/cpnd_res.c   |  821 
> +++---
>   3 files changed, 634 insertions(+), 208 deletions(-)
>
>
> diff --git a/osaf/libs/common/cpsv/include/cpsv_shm.h 
> b/osaf/libs/common/cpsv/include/cpsv_shm.h
> --- a/osaf/libs/common/cpsv/include/cpsv_shm.h
> +++ b/osaf/libs/common/cpsv/include/cpsv_shm.h
> @@ -31,7 +31,7 @@
>   
>   typedef struct cpsv_ckpt_hdr {
>   SaCkptCheckpointHandleT ckpt_id;/* Index for identifying the 
> checkpoint */
> - char ckpt_name[kOsafMaxDnLength];
> +  SaNameT ckpt_name;
[AVM] why rollback of `char ckpt_name[kOsafMaxDnLength];`   to `SaNameT 
ckpt_name;` ?
>   SaCkptCheckpointCreationAttributesT create_attrib;
>   SaCkptCheckpointOpenFlagsT open_flags;
>   uint32_t ckpt_lcl_ref_cnt;
> @@ -74,6 +74,24 @@ typedef struct ckpt_info {
>   int32_t next;
>   } CKPT_INFO;
>   
> +typedef struct ckpt_info_v0 {
> + SaNameT ckpt_name;
> + SaCkptCheckpointHandleT ckpt_id;
> + uint32_t maxSections;
> + SaSizeT maxSecSize;
> + NODE_ID node_id;
> + int32_t offset;
> + uint32_t client_bitmap;
> + int32_t is_valid;
> + uint32_t bm_offset;
> + bool is_unlink;
> + bool is_close;
> + bool cpnd_rep_create;
> + bool is_first;
> + SaTimeT close_time;
> + int32_t next;
> +} CKPT_INFO_V0;
> +
>   typedef struct client_info {
>   SaCkptHandleT ckpt_app_hdl;
>   uint32_t ckpt_open_ref_cnt;
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_proc.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_proc.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_proc.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_proc.c
> @@ -1813,7 +1813,6 @@ uint32_t cpnd_ckpt_hdr_update(CPND_CKPT_
>   memset(_req, '\0', sizeof(write_req));
>   memset(_hdr, '\0', sizeof(CPSV_CKPT_HDR));
>   ckpt_hdr.ckpt_id = cp_node->ckpt_id;
> - strncpy(ckpt_hdr.ckpt_name, cp_node->ckpt_name, kOsafMaxDnLength);
>   ckpt_hdr.create_attrib = cp_node->create_attrib;
>   ckpt_hdr.open_flags = cp_node->open_flags;
>   ckpt_hdr.is_unlink = cp_node->is_unlink;
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_res.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_res.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_res.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_res.c
> @@ -40,6 +40,8 @@
>   
>   #define m_CPND_CKPTINFO_READ(ckpt_info,addr,offset) 
> memcpy(_info,addr+offset,sizeof(CKPT_INFO))
>   
> +#define m_CPND_CKPTINFO_V0_READ(ckpt_info,addr,offset) 
> memcpy(_info,addr+offset,sizeof(CKPT_INFO_V0))
> +
>   #define m_CPND_CKPTINFO_UPDATE(addr,ckpt_info,offset) 
> memcpy(addr+offset,_info,sizeof(CKPT_INFO))
>   
>   #define m_CPND_CKPTHDR_UPDATE(ckpt_hdr,offset)  
> memcpy(offset,_hdr,sizeof(CKPT_HDR))
> @@ -48,6 +50,13 @@ static uint32_t cpnd_res_ckpt_sec_add(CP
>   static bool cpnd_find_exact_ckptinfo(CPND_CB *cb, CKPT_INFO *ckpt_info, 
> uint32_t bitmap_offset,
>uint32_t *offset, uint32_t 
> *prev_offset);
>   static void cpnd_clear_ckpt_info(CPND_CB *cb, CPND_CKPT_NODE *cp_node, 
> uint32_t curr_offset, uint32_t prev_offset);
> +static uint32_t cpnd_restore_client_info(CPND_CB *cb, uint8_t *cli_addr);
> +static uint32_t cpnd_restore_ckpt_info_v1(CPND_CB *cb, uint8_t *ckpt_addr, 
> SaClmNodeIdT nodeid);
> +static uint32_t cpnd_restore_ckpt_info_v0(CPND_CB *cb, uint8_t *ckpt_addr, 
> SaClmNodeIdT nodeid);
> +static void cpnd_destroy_shm_cpnd_cp_info(NCS_OS_POSIX_SHM_REQ_OPEN_INFO 
> *open_req);
> +static void *cpnd_create_shm_cpnd_cp_info(NCS_OS_POSIX_SHM_REQ_INFO 
> *req_info);
> +static void cpnd_update_shm_cpnd_cp_info(CPND_CB *cb);
> +static void cpnd_convert_cp_info_v0(CKPT_INFO_V0 *cp_info_v0, CKPT_INFO 
> *cp_info);
>   
>   
> /***
>  *
>* Name   : cpnd_client_extract_bits
> @@ -315,24 +324,10 @@ void cpnd_restart_update_timer(CPND_CB *
>   
>   void *cpnd_restart_shm_create(NCS_OS_POSIX_SHM_REQ_INFO *cpnd_open_req, 
> CPND_CB *cb, SaClmNodeIdT nodeid)
>   {
> - uint32_t counter = 0, count, num_bitset = 0, n_clients, rc = 
> NCSCC_RC_SUCCESS, bit_position;
> - uint64_t i_offset;
> - int32_t next_offset;
> - CPND_CKPT_CLIENT_NODE *cl_node = NULL;
> - CPND_CKPT_NODE *cp_node = NULL;
> - CLIENT_INFO cl_info;
> - CLIENT_HDR cli_hdr;
> - CKPT_INFO cp_info, tmp_cp_info;
> - SaCkptHandleT client_hdl;
> + uint32_t rc = NCSCC_RC_SUCCESS;
>   char *buf = NULL, *buffer = NULL;
>   uint8_t size = 0, total_length;
>   GBL_SHM_PTR gbl_shm_addr = {0, 0, 0, 0, 0};
> - memset(_info, '\0', sizeof(CKPT_INFO));
> - NCS_OS_POSIX_SHM_REQ_INFO ckpt_rep_open;
> - SaTimeT presentTime, timeout = 0;
> - int64_t now, diff_time, giga_sec;
> - uint32_t max_client_hdl = 

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]

2016-07-28 Thread A V Mahesh
Hi Hoang,

I just started reviewing please share following :

I hope this Long DN should support In-service upgrade ,  if so,

please share the test case that you run , it will help me in reviewing

and  in test uncovered  use/test cases.

-AVM


On 7/21/2016 3:04 PM, Hoang Vo wrote:
>   osaf/libs/agents/saf/cpa/cpa_api.c  |  12 +---
>   osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>   osaf/services/saf/cpsv/cpd/cpd_evt.c|  10 +++---
>   osaf/services/saf/cpsv/cpd/cpd_mds.c|   3 ++-
>   osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  26 --
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c  |   4 ++--
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   6 +++---
>   9 files changed, 42 insertions(+), 24 deletions(-)
>
>
> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c 
> b/osaf/libs/agents/saf/cpa/cpa_api.c
> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
> @@ -880,6 +880,8 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -981,7 +983,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1192,6 +1194,8 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -1277,7 +1281,7 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1597,6 +1601,8 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* retrieve CPA CB */
>   m_CPA_RETRIEVE_CB(cb);
> @@ -1635,7 +1641,7 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   /* Populate evt.info.cpnd.info.unlinkReq & Call MDS sync Send */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK_2;
>   
>   osaf_extended_name_lend(ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c 
> b/osaf/libs/agents/saf/cpa/cpa_mds.c
> --- a/osaf/libs/agents/saf/cpa/cpa_mds.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c
> @@ -515,7 +515,7 @@ static uint32_t cpa_mds_svc_evt(CPA_CB *
>  /* Populate & Send the Open Event to CPND */
>  memset(, 0, sizeof(CPSV_EVT));
>  evt.type = CPSV_EVT_TYPE_CPND;
> -evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
> +evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE_2;
>  evt.info.cpnd.info.ckptListUpdate.client_hdl = 
> lc_node->cl_hdl;
>  osaf_extended_name_lend(lc_node->ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -2414,6 +2414,7 @@ uint32_t cpsv_encode_extended_name(NCS_U
>   if(!osaf_is_an_extended_name(name))
>   return NCSCC_RC_SUCCESS;
>   
> + TRACE("length = %d", name->length);
>   SaConstStringT value = osaf_extended_name_borrow(name);
>   uint16_t length = osaf_extended_name_length(name);
>   
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
> b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> @@ -110,6 +110,7 @@ void cpd_process_evt(CPSV_EVT *evt)
>   (void)cpd_evt_proc_timer_expiry(cb, >info.cpd);
> 

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-07-27 Thread A V Mahesh
fferent here, in you error
> log, why sharemem is different between SC-1 and SC-2? In my opinion sharemem
> should be one.
> 9. immlist to check information
>
> Please tell us if I miss something.
> I am sorry for any inconvenient.
>
> Thank you and best regards.
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Friday, July 15, 2016 10:26 AM
> To: Nhat Pham <nhat.p...@dektech.com.au>; anders.wid...@ericsson.com; Nhat
> Pham <nhat.p...@dektech.com.au>; Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
> node [#1669] V3
>
> Hi  Hoang /Nhat Pham,
>
>
> The basic testing with in-service upgrade(one old  controller with
> out patch and one new  controller with patch ) is corrupting the
> Writers/Readers/Openers  DB,
>
> please verify in-service upgrade test with collocated & no-collocated ckpts
> and address new issue and publish V4 patch.
>
> SC-1:/avm/opensaf_app/cpsv_applications/virtualaddr # immlist
> safCkpt=checkpoint_test77
> Name   Type Value(s)
> 
> safCkptSA_STRING_T
> safCkpt=checkpoint_test77
> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
> saCkptCheckpointSize   SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointRetDurationSA_TIME_T
> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
> saCkptCheckpointNumWriters SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointNumReplicasSA_UINT32_T  4 (0x4)
> saCkptCheckpointNumReaders SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumOpeners SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
> saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
> saCkptCheckpointCreationTimestamp  SA_TIME_T
> 14685525530 (0x146158c4278eda00, Fri Jul 15 08:45:53 2016)
> saCkptCheckpointCreationFlags  SA_UINT32_T  2 (0x2)
> SaImmAttrImplementerName       SA_STRING_T
> safCheckPointService
> SaImmAttrClassName SA_STRING_T
> SaCkptCheckpoint
> SaImmAttrAdminOwnerNameSA_STRING_T 
>
> -AVM
>
>
> On 7/13/2016 12:44 PM, A V Mahesh wrote:
>> Hi  Hoang /Nhat Pham,
>>
>> I just started testing , fowling test case is failing , I may report
>> more  as soon as I get some
>>
>> Test case 1 :
>>
>> Step 1 : saCkptCheckpointOpen  on SC-1
>>
>> SC-1:# ./node_A
>> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
>> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
>> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
>> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
>> 4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
>> saCkptCheckpointWrite Waiting to Read from Checkpoint 
>> saCkptCheckpointWrite Press  key to continue...
>>
>> 1 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 2 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 3 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 4 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 222 saCkptCheckpointWrite  checkpointHandle 626bf0
>> saCkptCheckpointRead Waiting to Read from Checkpoint 
>> saCkptCheckpointRead Press  key to continue...
>>
>> Step 2 : saCkptCheckpointOpen  on SC-2
>>
>> SC-2:/avm/opensaf_app/cpsv_applications/virtualaddr # ./node_B
>> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
>> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
>> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
>> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
>> 4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
>> saCkptCheckpointWrite Waiting to Read from Checkpoint 
>> saCkptCheckpointWrite Press  key to continue...
>>
>> 1 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 2 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 3 saCkptCheckpointWrite  c

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-07-27 Thread A V Mahesh
Hi Hoan,

   I tested in-service testing  on 4 node setup ( combination of old and 
new) ,  with application opened on two payloads,
   restarting controllers.

   I am trying to recollect the test case , mean while you can also give 
a try .

-AVM

On 7/26/2016 1:58 PM, A V Mahesh wrote:
> Hi Hoan,
>
> I need to refresh ,I will setup again and provide the detailed
> reproducible steps.
>
> -AVM
>
> On 7/26/2016 8:41 AM, Vo Minh Hoang wrote:
>> Dear Mahesh,
>>
>> Thank you very much for your checking.
>>
>> Unfortunately, I unsuccessfully reproduce this problem in our environment.
>> Would you please send us the trace log of d and nd of both SC-1 and SC-2
>> when error occur for investigating.
>>
>> For reference, here is my reproduce steps:
>> 1. prepare SC-1 with patch, SC-2 without patch
>> 2. create checkpoint in SC-1
>> 3. open checkpoint in SC-2
>> 4. immlist to get checkpoint information
>> 5. unlink and close checkpoint in SC-1
>> 6. immlist again to confirm its deletion
>> 7. create checkpoint again in SC-1
>> 8. list all replica in sharemem, there is a different here, in you error
>> log, why sharemem is different between SC-1 and SC-2? In my opinion sharemem
>> should be one.
>> 9. immlist to check information
>>
>> Please tell us if I miss something.
>> I am sorry for any inconvenient.
>>
>> Thank you and best regards.
>> Hoang
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Friday, July 15, 2016 10:26 AM
>> To: Nhat Pham <nhat.p...@dektech.com.au>; anders.wid...@ericsson.com; Nhat
>> Pham <nhat.p...@dektech.com.au>; Hoang Vo <hoang.m...@dektech.com.au>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
>> node [#1669] V3
>>
>> Hi  Hoang /Nhat Pham,
>>
>>
>> The basic testing with in-service upgrade(one old  controller with
>> out patch and one new  controller with patch ) is corrupting the
>> Writers/Readers/Openers  DB,
>>
>> please verify in-service upgrade test with collocated & no-collocated ckpts
>> and address new issue and publish V4 patch.
>>
>> SC-1:/avm/opensaf_app/cpsv_applications/virtualaddr # immlist
>> safCkpt=checkpoint_test77
>> Name   Type Value(s)
>> 
>> safCkptSA_STRING_T
>> safCkpt=checkpoint_test77
>> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
>> saCkptCheckpointSize   SA_UINT64_T 2097152
>> (0x20)
>> saCkptCheckpointRetDurationSA_TIME_T
>> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
>> saCkptCheckpointNumWriters SA_UINT32_T
>> 4294967291 (0xfffb)
>> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
>> saCkptCheckpointNumReplicasSA_UINT32_T  4 (0x4)
>> saCkptCheckpointNumReaders SA_UINT32_T
>> 4294967291 (0xfffb)
>> saCkptCheckpointNumOpeners SA_UINT32_T
>> 4294967291 (0xfffb)
>> saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
>> saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
>> saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152
>> (0x20)
>> saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
>> saCkptCheckpointCreationTimestamp  SA_TIME_T
>> 14685525530 (0x146158c4278eda00, Fri Jul 15 08:45:53 2016)
>> saCkptCheckpointCreationFlags  SA_UINT32_T  2 (0x2)
>> SaImmAttrImplementerName   SA_STRING_T
>> safCheckPointService
>> SaImmAttrClassName SA_STRING_T
>> SaCkptCheckpoint
>> SaImmAttrAdminOwnerNameSA_STRING_T 
>>
>> -AVM
>>
>>
>> On 7/13/2016 12:44 PM, A V Mahesh wrote:
>>> Hi  Hoang /Nhat Pham,
>>>
>>> I just started testing , fowling test case is failing , I may report
>>> more  as soon as I get some
>>>
>>> Test case 1 :
>>>
>>> Step 1 : saCkptCheckpointOpen  on SC-1
>>>
>>> SC-1:# ./node_A
>>> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
>>> 1 saCkptCheckpointOpen  return

Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638]

2016-07-26 Thread A V Mahesh
Hi,

I missed to add new file ? osaf/services/saf/logsv/lgs/lgs_clm.cc  , 
please hold i will republish V1


-AVM


On 7/26/2016 1:48 PM, mahesh.va...@oracle.com wrote:
> Summary:lgsv: Log Service CLM integration [#1638]
> Review request for Trac Ticket(s): #1638
> Peer Reviewer(s): Vu, Lennar
> 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 servicesy
>   OpenSAF servicesn
>   Core libraries  n
>   Samples n
>   Tests   n
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> ---------
>
> changeset 3cea257f1e7fc8570828ece564f9bfa563c0693b
> Author:   A V Mahesh <mahesh.va...@oracle.com>
> Date: Tue, 26 Jul 2016 13:42:29 +0530
>
>   lga: agent Cluster Membership (CLM) integration [#1638] Description:
>
>   Form CLM integration is supported from Log Service A.02.02.
>
>   At-least a A.02.02 LGA client will check CLM membership status of 
> client's
>   node. old LGA clients A.02.01 are always clm member.
>
>   This patch enhanced the log service for Unavailability of the Log 
> Service
>   API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.
>
>   After this patch the Log Service does not provide service to processes 
> on
>   cluster nodes that are not in the cluster membership.
>
>   If the node rejoins the cluster membership, processes executing on the 
> node
>   will be able to reinitialize new library handles and use the entire set 
> of
>   Log Service APIs that operate on these new handles; however, invocation 
> of
>   APIs that operate on handles acquired by any process before the node 
> left
>   the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
> with
>   the special treatment described above for asynchronous calls) with the
>   exception of saLogFinalize(), which is used to free the library handles 
> and
>   all resources associated with these handles. Hence, it is recommended 
> for
>   the processes to finalize the library handles as soon as the processes
>   detect that the node left the membership.
>
>   Detailed README will be provide soon.
>
>   Following are expected Log Service API behavior :
>
>   Case1: On Non-Member Node, Log Service API will fail with code
>   SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from 
> Non-
>   Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE 
> (31)
>   Case3: Non-Member Node + (Headless) Log Service API will fail with code
>   SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + 
> (Head
>   Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)
>
> changeset 5b17d7c4634d65b05bb105654971bffa2f7f8d9d
> Author:   A V Mahesh <mahesh.va...@oracle.com>
> Date: Tue, 26 Jul 2016 13:42:41 +0530
>
>   lgs: director Cluster Membership (CLM) integration [#1638] Description:
>
>   Form CLM integration is supported from Log Service A.02.02.
>
>   At-least a A.02.02 LGA client will check CLM membership status of 
> client's
>   node. old LGA clients A.02.01 are always clm member.
>
>   This patch enhanced the log service for Unavailability of the Log 
> Service
>   API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.
>
>   After this patch the Log Service does not provide service to processes 
> on
>   cluster nodes that are not in the cluster membership.
>
>   If the node rejoins the cluster membership, processes executing on the 
> node
>   will be able to reinitialize new library handles and use the entire set 
> of
>   Log Service APIs that operate on these new handles; however, invocation 
> of
>   APIs that operate on handles acquired by any process before the node 
> left
>   the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
> with
>   the special treatment described above for asynchronous calls) with the
>   exception of saLogFinalize(), which is used to free the library handles 
> and
>   all resources associated with these handles. Hence, it is recommended 
> for
>   the processes to finalize the library handles as soon as the processes
>  

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-07-26 Thread A V Mahesh
Hi Hoan,

I need to refresh ,I will setup again and provide the detailed 
reproducible steps.

-AVM

On 7/26/2016 8:41 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your checking.
>
> Unfortunately, I unsuccessfully reproduce this problem in our environment.
> Would you please send us the trace log of d and nd of both SC-1 and SC-2
> when error occur for investigating.
>
> For reference, here is my reproduce steps:
> 1. prepare SC-1 with patch, SC-2 without patch
> 2. create checkpoint in SC-1
> 3. open checkpoint in SC-2
> 4. immlist to get checkpoint information
> 5. unlink and close checkpoint in SC-1
> 6. immlist again to confirm its deletion
> 7. create checkpoint again in SC-1
> 8. list all replica in sharemem, there is a different here, in you error
> log, why sharemem is different between SC-1 and SC-2? In my opinion sharemem
> should be one.
> 9. immlist to check information
>
> Please tell us if I miss something.
> I am sorry for any inconvenient.
>
> Thank you and best regards.
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Friday, July 15, 2016 10:26 AM
> To: Nhat Pham <nhat.p...@dektech.com.au>; anders.wid...@ericsson.com; Nhat
> Pham <nhat.p...@dektech.com.au>; Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
> node [#1669] V3
>
> Hi  Hoang /Nhat Pham,
>
>
> The basic testing with in-service upgrade(one old  controller with
> out patch and one new  controller with patch ) is corrupting the
> Writers/Readers/Openers  DB,
>
> please verify in-service upgrade test with collocated & no-collocated ckpts
> and address new issue and publish V4 patch.
>
> SC-1:/avm/opensaf_app/cpsv_applications/virtualaddr # immlist
> safCkpt=checkpoint_test77
> Name   Type Value(s)
> 
> safCkptSA_STRING_T
> safCkpt=checkpoint_test77
> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
> saCkptCheckpointSize   SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointRetDurationSA_TIME_T
> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
> saCkptCheckpointNumWriters SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointNumReplicasSA_UINT32_T  4 (0x4)
> saCkptCheckpointNumReaders SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumOpeners SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
> saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
> saCkptCheckpointCreationTimestamp  SA_TIME_T
> 14685525530 (0x146158c4278eda00, Fri Jul 15 08:45:53 2016)
> saCkptCheckpointCreationFlags  SA_UINT32_T  2 (0x2)
> SaImmAttrImplementerName       SA_STRING_T
> safCheckPointService
> SaImmAttrClassName SA_STRING_T
> SaCkptCheckpoint
> SaImmAttrAdminOwnerNameSA_STRING_T 
>
> -AVM
>
>
> On 7/13/2016 12:44 PM, A V Mahesh wrote:
>> Hi  Hoang /Nhat Pham,
>>
>> I just started testing , fowling test case is failing , I may report
>> more  as soon as I get some
>>
>> Test case 1 :
>>
>> Step 1 : saCkptCheckpointOpen  on SC-1
>>
>> SC-1:# ./node_A
>> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
>> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
>> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
>> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
>> 4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
>> saCkptCheckpointWrite Waiting to Read from Checkpoint 
>> saCkptCheckpointWrite Press  key to continue...
>>
>> 1 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 2 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 3 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 4 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 222 saCkptCheckpointWrite  checkpointHandle 626bf0
>> saCkptCheckpointRead Waiting to Read from Checkpoin

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-07-14 Thread A V Mahesh
Hi  Hoang /Nhat Pham,


The basic testing with in-service upgrade(one old  controller with 
out patch and one new  controller with patch ) is corrupting the  
Writers/Readers/Openers  DB,

please verify in-service upgrade test with collocated & no-collocated 
ckpts and address new issue and publish V4 patch.

SC-1:/avm/opensaf_app/cpsv_applications/virtualaddr # immlist 
safCkpt=checkpoint_test77
Name   Type Value(s)

safCkptSA_STRING_T 
safCkpt=checkpoint_test77
saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
saCkptCheckpointSize   SA_UINT64_T 2097152 
(0x20)
saCkptCheckpointRetDurationSA_TIME_T 
9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
saCkptCheckpointNumWriters SA_UINT32_T 
4294967291 (0xfffb)
saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
saCkptCheckpointNumReplicasSA_UINT32_T  4 (0x4)
saCkptCheckpointNumReaders SA_UINT32_T 
4294967291 (0xfffb)
saCkptCheckpointNumOpeners SA_UINT32_T 
4294967291 (0xfffb)
saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152 
(0x20)
saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
saCkptCheckpointCreationTimestamp  SA_TIME_T 
14685525530 (0x146158c4278eda00, Fri Jul 15 08:45:53 2016)
saCkptCheckpointCreationFlags  SA_UINT32_T  2 (0x2)
SaImmAttrImplementerName   SA_STRING_T 
safCheckPointService
SaImmAttrClassName SA_STRING_T 
SaCkptCheckpoint
SaImmAttrAdminOwnerNameSA_STRING_T 

-AVM


On 7/13/2016 12:44 PM, A V Mahesh wrote:
> Hi  Hoang /Nhat Pham,
>
> I just started testing , fowling test case is failing , I may report 
> more  as soon as I get some
>
> Test case 1 :
>
> Step 1 : saCkptCheckpointOpen  on SC-1
>
> SC-1:# ./node_A
> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
> 4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
> saCkptCheckpointWrite Waiting to Read from Checkpoint 
> saCkptCheckpointWrite Press  key to continue...
>
> 1 saCkptCheckpointWrite  checkpointHandle 626bf0
> 2 saCkptCheckpointWrite  checkpointHandle 626bf0
> 3 saCkptCheckpointWrite  checkpointHandle 626bf0
> 4 saCkptCheckpointWrite  checkpointHandle 626bf0
> 222 saCkptCheckpointWrite  checkpointHandle 626bf0
> saCkptCheckpointRead Waiting to Read from Checkpoint 
> saCkptCheckpointRead Press  key to continue...
>
> Step 2 : saCkptCheckpointOpen  on SC-2
>
> SC-2:/avm/opensaf_app/cpsv_applications/virtualaddr # ./node_B
> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
> 4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
> saCkptCheckpointWrite Waiting to Read from Checkpoint 
> saCkptCheckpointWrite Press  key to continue...
>
> 1 saCkptCheckpointWrite  checkpointHandle 626bf0
> 2 saCkptCheckpointWrite  checkpointHandle 626bf0
> 3 saCkptCheckpointWrite  checkpointHandle 626bf0
> 4 saCkptCheckpointWrite  checkpointHandle 626bf0
> 222 saCkptCheckpointWrite  checkpointHandle 626bf0
> saCkptCheckpointRead Waiting to Read from Checkpoint 
> saCkptCheckpointRead Press  key to continue...
>
> Step 3 : do   # immlist safCkpt=checkpoint_test77
>
> Name   Type Value(s)
> 
> safCkptSA_STRING_T 
> safCkpt=checkpoint_test77
> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
> saCkptCheckpointSize   SA_UINT64_T 2097152 
> (0x20)
> saCkptCheckpointRetDurationSA_TIME_T 
> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
> saCkptCheckpointNumWriters SA_UINT32_T  10 (0xa)
> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointNumReplicasSA_UINT32_T  2 (0x2)
> 

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-07-13 Thread A V Mahesh
Hi  Hoang /Nhat Pham,

I just started testing , fowling test case is failing , I may report 
more  as soon as I get some

Test case 1 :

Step 1 : saCkptCheckpointOpen  on SC-1

SC-1:# ./node_A
0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
1 saCkptCheckpointOpen  returned checkpointHandle 626e70
2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
3 saCkptCheckpointOpen  returned checkpointHandle 627170
4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
saCkptCheckpointWrite Waiting to Read from Checkpoint 
saCkptCheckpointWrite Press  key to continue...

1 saCkptCheckpointWrite  checkpointHandle 626bf0
2 saCkptCheckpointWrite  checkpointHandle 626bf0
3 saCkptCheckpointWrite  checkpointHandle 626bf0
4 saCkptCheckpointWrite  checkpointHandle 626bf0
222 saCkptCheckpointWrite  checkpointHandle 626bf0
saCkptCheckpointRead Waiting to Read from Checkpoint 
saCkptCheckpointRead Press  key to continue...

Step 2 : saCkptCheckpointOpen  on SC-2

SC-2:/avm/opensaf_app/cpsv_applications/virtualaddr # ./node_B
0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
1 saCkptCheckpointOpen  returned checkpointHandle 626e70
2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
3 saCkptCheckpointOpen  returned checkpointHandle 627170
4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
saCkptCheckpointWrite Waiting to Read from Checkpoint 
saCkptCheckpointWrite Press  key to continue...

1 saCkptCheckpointWrite  checkpointHandle 626bf0
2 saCkptCheckpointWrite  checkpointHandle 626bf0
3 saCkptCheckpointWrite  checkpointHandle 626bf0
4 saCkptCheckpointWrite  checkpointHandle 626bf0
222 saCkptCheckpointWrite  checkpointHandle 626bf0
saCkptCheckpointRead Waiting to Read from Checkpoint 
saCkptCheckpointRead Press  key to continue...

Step 3 : do   # immlist safCkpt=checkpoint_test77

Name   Type Value(s)

safCkptSA_STRING_T 
safCkpt=checkpoint_test77
saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
saCkptCheckpointSize   SA_UINT64_T 2097152 
(0x20)
saCkptCheckpointRetDurationSA_TIME_T 
9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
saCkptCheckpointNumWriters SA_UINT32_T  10 (0xa)
saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
saCkptCheckpointNumReplicasSA_UINT32_T  2 (0x2)
saCkptCheckpointNumReaders SA_UINT32_T  10 (0xa)
saCkptCheckpointNumOpeners SA_UINT32_T  10 (0xa)
saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152 
(0x20)
saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
saCkptCheckpointCreationTimestamp  SA_TIME_T 
14683927200 (0x1460c766225ea000, Wed Jul 13 12:22:00 2016)
saCkptCheckpointCreationFlags  SA_UINT32_T  9 (0x9)
SaImmAttrImplementerName   SA_STRING_T 
safCheckPointService
SaImmAttrClassName SA_STRING_T 
SaCkptCheckpoint
SaImmAttrAdminOwnerNameSA_STRING_T 


Step 4 :  saCkptCheckpointUnlink & saCkptCheckpointClose  on SC-1

Attempt 1-0 Read DataBuffer 
:VV
0 saCkptCheckpointClose  checkpointHandle 626bf0
1 saCkptCheckpointClose  checkpointHandle 626e70
2 saCkptCheckpointClose  checkpointHandle 626ff0
3 saCkptCheckpointClose  checkpointHandle 627170
4 saCkptCheckpointClose  checkpointHandle 6272f0

Step 5 :  do   # immlist safCkpt=checkpoint_test77

error - object or attribute does not exist as expected

Step 6 :  saCkptCheckpointOpen  on SC-1 again ( note  on SC-2 ckpt still 
open )

SC-1:# ./node_A
0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
1 saCkptCheckpointOpen  returned checkpointHandle 626e70
2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
3 saCkptCheckpointOpen  returned checkpointHandle 627170
4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
saCkptCheckpointWrite Waiting to Read from Checkpoint 
saCkptCheckpointWrite Press  key to continue...

Step 7 : check Replicas on both  ( you will see 2 Replicas and partially 
10 Openers )

SC-1: # ls /dev/shm/
opensaf_CPND_CHECKPOINT_INFO_131343 opensaf_NCS_GLND_LCK_CKPT_INFO  
opensaf_NCS_MQND_QUEUE_CKPT_INFO
opensaf_NCS_GLND_EVT_CKPT_INFO opensaf_NCS_GLND_RES_CKPT_INFO 
opensaf_safCkpt=checkpoint_test7_131343_2

SC-2: # ls
opensaf_CPND_CHECKPOINT_INFO_131599 opensaf_NCS_GLND_LCK_CKPT_INFO  
opensaf_NCS_MQND_QUEUE_CKPT_INFO
opensaf_NCS_GLND_EVT_CKPT_INFO opensaf_NCS_GLND_RES_CKPT_INFO 

Re: [devel] [PATCH 1 of 4] log: add one new option -f to saflogger tool [#1315]

2016-07-10 Thread A V Mahesh
Hi Vu,

On 7/8/2016 4:08 PM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> To make long DN work (e.g: long DN at @Ng token), we have to do some
> settings first. IMM is one of them.
> You can refer to ` setUpTestEnv()` @ tet_log_longDN.c for details on this.
[AVM]  I understand that the Agent has to do 
`setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1);`
to enable long DN , which I did for my LAG ( An application) , as we 
know LAGA using IMMA,NTFA , ect ... implicitly,
in such case user will not expect , for each Agent that  implicitly 
getting used ( user un aware) ,
what was trying to say is for all implicit agent long DN should be 
enabled implicitly.

-AVM

>
> One question, have you tried to run the added test suite #13 for verifying
> long DN?
> With this test suite, before starting test, each TC does change precondition
> settings to make long DN work .
>
> If you want to see the verification data, enable the environment `
> LOGTEST_ENABLE_STDOUT`.
>
> E.g:
> # LOGTEST_ENABLE_STDOUT=1 logtest 13
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Friday, July 8, 2016 4:00 PM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>;
>> lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 4] log: add one new option -f to saflogger tool
>> [#1315]
>>
>> Hi Vu,
>>
>> While validating the patch , i received following errors , do we need to
>> apply any other IMM patchs
>>
>> to validate this patch ?
>>
>> ==
>> 
>>
>> # Jul  8 13:03:03 SC-1 osafimmnd[23888]: NO ERR_INVALID_PARAM: RDN
>> attribute value
>> safLgStr=L
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> L
>> is too large: 997. Max length is 64 for SaStringT
>> Jul  8 13:03:03 SC-1 osaflogd[23903]: WA saImmOiRtObjectCreate_2
>> returned 7 for
>> safLgStr=L
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LL
>> LLLLLL
>> LL
>> LL
>> L,
>> parent (null)
>>
>> ==
>> 
>>
>> -AVM
>>
>>
>> On 7/8/2016 10:19 AM, A V Mahesh wrote:
>>> Hi Vu,
>>>
>>> On 7/8/2016 10:11 AM, Vu Minh Nguyen wrote:
>>>> I zipped all the patches in attached file, you can try to apply it in
>>>> the
>>>> meantime. Thanks.
>>> Thanks The attached patches are getting applied.
>>>
>>> -AVM
>>>
>>> On 7/8/2016 10:11 AM, Vu Minh Nguyen wrote:
>>>> Hi M

Re: [devel] [PATCH 1 of 1] cpd: To reduce updating time out [#1788]

2016-07-10 Thread A V Mahesh
ACK ,Not tested .

Sorry for the delay some how Over looked this patch.

-AVM


On 5/13/2016 7:41 AM, Nhat Pham wrote:
>   osaf/libs/common/cpsv/include/cpd_proc.h |  2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> Problem:
> 
> Application gets fault code SA_AIS_ERR_NOT_EXIST in case it accesses the 
> checkpoint with
> saCkptCheckpointWrite() when SCs are up after headless state.
> The problem happens due to combination of 2 conditions:
> 1. The process ID on SC-2 before headless and after headless are same.
> This leads their MDS destination are same. (This rarely happens)
> 2. Accessing checkpoint happens during updating checkpoint period after 
> headless state
> (i.e the active replica hasn't been updated yet.
> After this period checkpoint can be accessed normally)
>
> Solution:
> -
> The problem happens temporarily during updating period.
> The solution is to reduce the updating time out.
>
> diff --git a/osaf/libs/common/cpsv/include/cpd_proc.h 
> b/osaf/libs/common/cpsv/include/cpd_proc.h
> --- a/osaf/libs/common/cpsv/include/cpd_proc.h
> +++ b/osaf/libs/common/cpsv/include/cpd_proc.h
> @@ -20,7 +20,7 @@
>   
>   /* CPD definations */
>   #define CPD_CPND_DOWN_RETENTION_TIME 600/* 100 Milli Sec */
> -#define CPD_CKPT_UPDATE_TIME 600 /* 10 Milli Sec */
> +#define CPD_CKPT_UPDATE_TIME 300 /* 10 Milli Sec */
>   #define CPD_CLM_API_TIMEOUT 100LL
>   /* The count of non colloc replicas created by CPSv (Policy) */
>   #define CPD_NON_COLLOC_CREATED_REPLICA_CNT 1


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 4] log: add one new option -f to saflogger tool [#1315]

2016-07-08 Thread A V Mahesh
Hi Vu,

While validating the patch , i received following errors , do we need to 
apply any other IMM patchs

to validate this patch ?

==

# Jul  8 13:03:03 SC-1 osafimmnd[23888]: NO ERR_INVALID_PARAM: RDN 
attribute value 
safLgStr=
 
is too large: 997. Max length is 64 for SaStringT
Jul  8 13:03:03 SC-1 osaflogd[23903]: WA saImmOiRtObjectCreate_2 
returned 7 for 
safLgStr=,
  
parent (null)

==

-AVM


On 7/8/2016 10:19 AM, A V Mahesh wrote:
> Hi Vu,
>
> On 7/8/2016 10:11 AM, Vu Minh Nguyen wrote:
>> I zipped all the patches in attached file, you can try to apply it in 
>> the
>> meantime. Thanks.
>
> Thanks The attached patches are getting applied.
>
> -AVM
>
> On 7/8/2016 10:11 AM, Vu Minh Nguyen wrote:
>> Hi Mahesh,
>>
>> I have tried to apply these patches (copy from emails [PATCH x of 4]) to
>> latest staging and it works.
>> And I see you get failed at the first patch (saflogger tool), then I 
>> guess
>> the patches you applied were broken somehow.
>>
>> Can you send me the saflogger patch (1st patch) that you used? I will 
>> check
>> it to see why you get failed.
>>
>> I zipped all the patches in attached file, you can try to apply it in 
>> the
>> meantime. Thanks.
>>
>> Regards, Vu
>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Friday, July 8, 2016 11:07 AM
>>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>;
>>> lennart.l...@ericsson.com
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 1 of 4] log: add one new option -f to saflogger 
>>> tool
>>> [#1315]
>>>
>>> Hi Vu,
>>>
>>> This patch is not being applied on latest staging , can you tell on
>>> which changesset  this will cleanly appy ?
>>>
>>> ==
>>> 
>>>
>>> patching file osaf/tools/saflog/saflogger/Makefile.am
>>> Hunk #1 FAILED at 22.
>>> 1 out of 1 hunk FAILED -- saving rejects to file
>>> osaf/tools/saflog/saflogger/Makefile.am.rej
>>> patching file osaf/tools/saflog/saflogger/saf_logger.c
>>> Hunk #2 FAILED at 84.
>>> Hunk #3 FAILED at 96.
>>> Hunk #4 FAILED at 236.
>>> Hunk #5 FAILED at 259.
>>> Hunk #6 FAILED at 268.
>>> Hunk #7 FAILED at 299.
>>> Hunk #8 FAILED at 367.
>>> Hunk #9 FAILED at 411.
>>> 8 out of 9 hunks FAILED -- saving rejects to file
>>> osaf/tools/saflog/saflogger/saf_logger.c.rej
>>>
>>> 

Re: [devel] [PATCH 1 of 1] log: Readme file for long DN support [#1315]

2016-07-07 Thread A V Mahesh
Hi Vu,

I don't think  it is required , I will check OpenSAF_extensions_PR.

-AVM

On 7/8/2016 10:30 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> In the OpenSAF_extensions_PR, it stated clearly how to enable extended
> SaNameT in application at 4.3 section.
> I am wondering it is redundant to re-state such info in every services that
> has Long DN support.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Friday, July 8, 2016 11:42 AM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>;
>> lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] log: Readme file for long DN support [#1315]
>>
>> Hi Vu,
>>
>> It seems this README doesn't explained , how to enable
>> SA_ENABLE_EXTENDED_NAMES on a node,
>>
>> if some application is creating an app stream ( NOT using saflogger tool
>> ) DN is longer than 255 characters in length.
>>
>> -AVM
>>
>> On 7/4/2016 8:36 AM, Vu Minh Nguyen wrote:
>>>osaf/services/saf/logsv/README_LONGDN |  138
>> ++
>>>1 files changed, 138 insertions(+), 0 deletions(-)
>>>
>>>
>>> Show changes for long DN, including:
>>> 1) saflogger tool
>>> 2) log agent
>>> 3) log services
>>> 4) test suite
>>>
>>> diff --git a/osaf/services/saf/logsv/README_LONGDN
>> b/osaf/services/saf/logsv/README_LONGDN
>>> new file mode 100644
>>> --- /dev/null
>>> +++ b/osaf/services/saf/logsv/README_LONGDN
>>> @@ -0,0 +1,138 @@
>>> +#
>>> +#  -*- OpenSAF  -*-
>>> +#
>>> +# (C) Copyright 2016 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
>>> +#
>>> +
>>> +I. GENERAL INFORMATION (#1315)
>>> +==
>>> +
>>> +The SaNameT type, which is used to pass distinguished stream DNs name
>> in saLogStreamOpen_2() API,
>>> +or in `logSvcUsrName`, `notificationObject` or `notifyingObject` which
>> belong to `SaLogRecordT`
>>> +data structure passed to `saLogWriteLogAsync()` API, contains a
> fixed-size
>> buffer that limits
>>> +the string length to a maximum of 255 bytes.
>>> +
>>> +#1315 ticket was raised for LOG to support long DN. The use cases could
>> be:
>>> +UC1) Write log records using the long DN in @Sl, @No, @Ng tokens using
>> Log API.
>>> +UC2) Create any long DN name stream using Log API.
>>> +UC3) Write record to long DN app stream using saflogger tool.
>>> +
>>> +The implementation was split into following parts:
>>> +1) Update saflogger tool - add one more option `-f`
>>> +2) Update LOG agent (API) to support Long DN
>>> +3) Update LOG service to support Long DN
>>> +4) Create test cases
>>> +
>>> +Besides, README file and OpenSAF_LOG_PR.odt have to be updated.
>>> +
>>> +
>>> +II) IMPLEMENTATION (#1315)
>>> +==
>>> +
>>> +1) Update saflogger tool - Add One More Option `-f`
>>> +-
>>> +`-f` option is only applicable for application stream. Means it is only
> valid
>>> +when comes together with option `-a`. If no `-f` is provided, default
>> behavior is maintained.
>>> +
>>> +Why need to add new option `-f` to saflogger tool?
>>> +When long DN is supported, user is able to put long DN name after
> option
>> `-a`, and saflogger tool will
>>> +use that long DN for log file name of that app stream. In that case,
> the log
>> file name will be over 256 characters in length.
>>> +As the result, logsv could get failed to create such long file name
> (most
>> Unix system supports file name length up to 255 characters).
>>> +
>>> +
>>> +2) Update LOG Agent (API) 

Re: [devel] [PATCH 1 of 4] log: add one new option -f to saflogger tool [#1315]

2016-07-07 Thread A V Mahesh
Hi Vu,

On 7/8/2016 10:11 AM, Vu Minh Nguyen wrote:
> I zipped all the patches in attached file, you can try to apply it in the
> meantime. Thanks.

Thanks The attached patches are getting applied.

-AVM

On 7/8/2016 10:11 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> I have tried to apply these patches (copy from emails [PATCH x of 4]) to
> latest staging and it works.
> And I see you get failed at the first patch (saflogger tool), then I guess
> the patches you applied were broken somehow.
>
> Can you send me the saflogger patch (1st patch) that you used? I will check
> it to see why you get failed.
>
> I zipped all the patches in attached file, you can try to apply it in the
> meantime. Thanks.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Friday, July 8, 2016 11:07 AM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>;
>> lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 4] log: add one new option -f to saflogger tool
>> [#1315]
>>
>> Hi Vu,
>>
>> This patch is not being applied on latest staging , can you tell on
>> which changesset  this will cleanly appy ?
>>
>> ==
>> 
>>
>> patching file osaf/tools/saflog/saflogger/Makefile.am
>> Hunk #1 FAILED at 22.
>> 1 out of 1 hunk FAILED -- saving rejects to file
>> osaf/tools/saflog/saflogger/Makefile.am.rej
>> patching file osaf/tools/saflog/saflogger/saf_logger.c
>> Hunk #2 FAILED at 84.
>> Hunk #3 FAILED at 96.
>> Hunk #4 FAILED at 236.
>> Hunk #5 FAILED at 259.
>> Hunk #6 FAILED at 268.
>> Hunk #7 FAILED at 299.
>> Hunk #8 FAILED at 367.
>> Hunk #9 FAILED at 411.
>> 8 out of 9 hunks FAILED -- saving rejects to file
>> osaf/tools/saflog/saflogger/saf_logger.c.rej
>>
>> ==
>> 
>>
>> -AVM
>>
>> On 7/1/2016 4:12 PM, Vu Minh Nguyen wrote:
>>>osaf/tools/saflog/saflogger/Makefile.am  |   1 +
>>>osaf/tools/saflog/saflogger/saf_logger.c |  90
>> ++-
>>>2 files changed, 75 insertions(+), 16 deletions(-)
>>>
>>>
>>> With app stream, saflogger used app stream DN as logFileName.
>>> With Long DN, the app stream DN could be longer than 255 characters in
>> length.
>>> This patch provides one new option -f .
>>> This option is only applicable for app stream.
>>>
>>> diff --git a/osaf/tools/saflog/saflogger/Makefile.am
>> b/osaf/tools/saflog/saflogger/Makefile.am
>>> --- a/osaf/tools/saflog/saflogger/Makefile.am
>>> +++ b/osaf/tools/saflog/saflogger/Makefile.am
>>> @@ -22,6 +22,7 @@ MAINTAINERCLEANFILES = Makefile.in
>>>bin_PROGRAMS = saflogger
>>>
>>>saflogger_CPPFLAGS = \
>>> +   -DSA_EXTENDED_NAME_SOURCE \
>>> $(AM_CPPFLAGS) \
>>> -I$(top_srcdir)/osaf/tools/saflog/include
>>>
>>> diff --git a/osaf/tools/saflog/saflogger/saf_logger.c
>> b/osaf/tools/saflog/saflogger/saf_logger.c
>>> --- a/osaf/tools/saflog/saflogger/saf_logger.c
>>> +++ b/osaf/tools/saflog/saflogger/saf_logger.c
>>> @@ -37,8 +37,9 @@
>>>#include 
>>>#include 
>>>#include 
>>> +#include 
>>> +#include "osaf_extended_name.h"
>>>
>>> -#include 
>>>#include 
>>>
>>>#include "saf_error.h"
>>> @@ -83,7 +84,7 @@ static void usage(void)
>>> printf("\t%s - write log record to log stream\n", progname);
>>>
>>> printf("\nSYNOPSIS\n");
>>> -   printf("\t%s [options] [message ...]\n", progname);
>>> +   printf("\t%s [options] [-f ] [message ...]\n", progname);
>>>
>>> printf("\nDESCRIPTION\n");
>>> printf("\t%s is a SAF LOG client used to write a log record into a
>> specified log stream.\n", progname);
>>> @@ -95,11 +96,16 @@ static void usage(void)
>>> printf("\t-n or --notification   write to notification
> stream\n");
>>> printf("\t-y or --system write to system stream
> (default)\n");
>>> printf("\t-a NAME or --application=NAME  write to application
>> stream NAME (create it if not exist)\n");
>>> +   printf("\t-

Re: [devel] [PATCH 1 of 1] log: Readme file for long DN support [#1315]

2016-07-07 Thread A V Mahesh
Hi Vu,

It seems this README doesn't explained , how to enable 
SA_ENABLE_EXTENDED_NAMES on a node,

if some application is creating an app stream ( NOT using saflogger tool 
) DN is longer than 255 characters in length.

-AVM

On 7/4/2016 8:36 AM, Vu Minh Nguyen wrote:
>   osaf/services/saf/logsv/README_LONGDN |  138 
> ++
>   1 files changed, 138 insertions(+), 0 deletions(-)
>
>
> Show changes for long DN, including:
> 1) saflogger tool
> 2) log agent
> 3) log services
> 4) test suite
>
> diff --git a/osaf/services/saf/logsv/README_LONGDN 
> b/osaf/services/saf/logsv/README_LONGDN
> new file mode 100644
> --- /dev/null
> +++ b/osaf/services/saf/logsv/README_LONGDN
> @@ -0,0 +1,138 @@
> +#
> +#  -*- OpenSAF  -*-
> +#
> +# (C) Copyright 2016 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
> +#
> +
> +I. GENERAL INFORMATION (#1315)
> +==
> +
> +The SaNameT type, which is used to pass distinguished stream DNs name in 
> saLogStreamOpen_2() API,
> +or in `logSvcUsrName`, `notificationObject` or `notifyingObject` which 
> belong to `SaLogRecordT`
> +data structure passed to `saLogWriteLogAsync()` API, contains a fixed-size 
> buffer that limits
> +the string length to a maximum of 255 bytes.
> +
> +#1315 ticket was raised for LOG to support long DN. The use cases could be:
> +UC1) Write log records using the long DN in @Sl, @No, @Ng tokens using Log 
> API.
> +UC2) Create any long DN name stream using Log API.
> +UC3) Write record to long DN app stream using saflogger tool.
> +
> +The implementation was split into following parts:
> +1) Update saflogger tool - add one more option `-f`
> +2) Update LOG agent (API) to support Long DN
> +3) Update LOG service to support Long DN
> +4) Create test cases
> +
> +Besides, README file and OpenSAF_LOG_PR.odt have to be updated.
> +
> +
> +II) IMPLEMENTATION (#1315)
> +==
> +
> +1) Update saflogger tool - Add One More Option `-f`
> +-
> +`-f` option is only applicable for application stream. Means it is only valid
> +when comes together with option `-a`. If no `-f` is provided, default 
> behavior is maintained.
> +
> +Why need to add new option `-f` to saflogger tool?
> +When long DN is supported, user is able to put long DN name after option 
> `-a`, and saflogger tool will
> +use that long DN for log file name of that app stream. In that case, the log 
> file name will be over 256 characters in length.
> +As the result, logsv could get failed to create such long file name (most 
> Unix system supports file name length up to 255 characters).
> +
> +
> +2) Update LOG Agent (API) to Support Long DN
> +-
> +All internal SaNameT will be replaced by SaConstStringT and functions 
> handling extended SaNameT are used.
> +
> +One point needs to be noticed is that, with extended SaNameT, data size 
> could be up to 2048 bytes (not limited to 256 bytes any more).
> +As the result, several condition checking for max length size against 256 
> bytes will be updated to 2048 bytes (kOsafMaxDnLength).
> +So, when supported long DN client (e.g: log client running on OpenSAF 5.1 or 
> newer versions) sends an record containing long DN
> +(e.g: `notificationObject` length > 256 bytes) to active Log service not 
> support long DN (e.g: active log running on OpenSAF 5.0
> +or older versions), that log client will get `SA_AIS_ERR_TRY_AGAIN` always 
> and make cause the log client hang.
> +There is no problem with the opposite case (non-support long DN do 
> communicate with supported long DN).
> +
> +
> +3) Update LOG Service to Support Long DN
> +
> +In original code, logsv used NCS PATRICIA TREE as an database to hold all 
> existing LOG streams in system,
> +and taking stream DN as the keyword for searching/adding/deleting tree 
> elements.
> +NCS PATRICIA TREE has a limitation with keyword size. It is only supported 
> the key size up to 600 bytes.
> +With long DN, stream DN could be up to 2024 bytes (kOsafMaxDnLength), that 
> tree is no longer valid.
> +
> +Besides, logsv is providing other database named `stream_array` which is 
> used to hold all LOG existing streams.
> +When there is any new stream created, `log_stream_t` holding information of 
> that stream, will be added to that database
> +and when the stream is closed and no 

Re: [devel] [PATCH 1 of 4] log: add one new option -f to saflogger tool [#1315]

2016-07-07 Thread A V Mahesh
Hi Vu,

This patch is not being applied on latest staging , can you tell on 
which changesset  this will cleanly appy ?

==

patching file osaf/tools/saflog/saflogger/Makefile.am
Hunk #1 FAILED at 22.
1 out of 1 hunk FAILED -- saving rejects to file 
osaf/tools/saflog/saflogger/Makefile.am.rej
patching file osaf/tools/saflog/saflogger/saf_logger.c
Hunk #2 FAILED at 84.
Hunk #3 FAILED at 96.
Hunk #4 FAILED at 236.
Hunk #5 FAILED at 259.
Hunk #6 FAILED at 268.
Hunk #7 FAILED at 299.
Hunk #8 FAILED at 367.
Hunk #9 FAILED at 411.
8 out of 9 hunks FAILED -- saving rejects to file 
osaf/tools/saflog/saflogger/saf_logger.c.rej

==

-AVM

On 7/1/2016 4:12 PM, Vu Minh Nguyen wrote:
>   osaf/tools/saflog/saflogger/Makefile.am  |   1 +
>   osaf/tools/saflog/saflogger/saf_logger.c |  90 
> ++-
>   2 files changed, 75 insertions(+), 16 deletions(-)
>
>
> With app stream, saflogger used app stream DN as logFileName.
> With Long DN, the app stream DN could be longer than 255 characters in length.
>
> This patch provides one new option -f .
> This option is only applicable for app stream.
>
> diff --git a/osaf/tools/saflog/saflogger/Makefile.am 
> b/osaf/tools/saflog/saflogger/Makefile.am
> --- a/osaf/tools/saflog/saflogger/Makefile.am
> +++ b/osaf/tools/saflog/saflogger/Makefile.am
> @@ -22,6 +22,7 @@ MAINTAINERCLEANFILES = Makefile.in
>   bin_PROGRAMS = saflogger
>   
>   saflogger_CPPFLAGS = \
> + -DSA_EXTENDED_NAME_SOURCE \
>   $(AM_CPPFLAGS) \
>   -I$(top_srcdir)/osaf/tools/saflog/include
>   
> diff --git a/osaf/tools/saflog/saflogger/saf_logger.c 
> b/osaf/tools/saflog/saflogger/saf_logger.c
> --- a/osaf/tools/saflog/saflogger/saf_logger.c
> +++ b/osaf/tools/saflog/saflogger/saf_logger.c
> @@ -37,8 +37,9 @@
>   #include 
>   #include 
>   #include 
> +#include 
> +#include "osaf_extended_name.h"
>   
> -#include 
>   #include 
>   
>   #include "saf_error.h"
> @@ -83,7 +84,7 @@ static void usage(void)
>   printf("\t%s - write log record to log stream\n", progname);
>   
>   printf("\nSYNOPSIS\n");
> - printf("\t%s [options] [message ...]\n", progname);
> + printf("\t%s [options] [-f ] [message ...]\n", progname);
>   
>   printf("\nDESCRIPTION\n");
>   printf("\t%s is a SAF LOG client used to write a log record into a 
> specified log stream.\n", progname);
> @@ -95,11 +96,16 @@ static void usage(void)
>   printf("\t-n or --notification   write to notification 
> stream\n");
>   printf("\t-y or --system write to system stream 
> (default)\n");
>   printf("\t-a NAME or --application=NAME  write to application stream 
> NAME (create it if not exist)\n");
> + printf("\t-f FILENAMEwrite log record to 
> FILENAME\n");
>   printf("\t-s SEV or --severity=SEV   use severity SEV, default 
> INFO\n");
>   printf("\t\tvalid severity names: emerg, alert, crit, error, warn, 
> notice, info\n");
> + printf("\nNOTES\n");
> + printf("\t1) -f is only applicable for app stream.\n");
> + printf("\t1)  length must not be longer than 255 
> characters.\n");
>   
>   printf("\nEXAMPLES\n");
>   printf("\tsaflogger -a safLgStrCfg=Test \"Hello world\"\n");
> + printf("\tsaflogger -a safLgStrCfg=Test -f testLogFile \"Hello 
> world\"\n");
>   printf("\tsaflogger -s crit \"I am going down\"\n\n");
>   }
>   
> @@ -230,7 +236,7 @@ static SaLogSeverityT get_severity(char
>   int main(int argc, char *argv[])
>   {
>   int c;
> - SaNameT logStreamName = {.length = 0 };
> + SaNameT logStreamName;
>   SaLogFileCreateAttributesT_2 *logFileCreateAttributes = NULL;
>   SaLogFileCreateAttributesT_2 appLogFileCreateAttributes;
>   SaLogStreamOpenFlagsT logStreamOpenFlags = 0;
> @@ -253,6 +259,7 @@ int main(int argc, char *argv[])
>   SaLogStreamHandleT logStreamHandle;
>   SaSelectionObjectT selectionObject;
>   unsigned int wait_time;
> + bool is_appstream = false, f_opt = false;
>   
>   srandom(getpid());
>   
> @@ -261,11 +268,23 @@ int main(int argc, char *argv[])
>   exit(EXIT_FAILURE);
>   }
>   
> - sprintf((char *)logSvcUsrName.value, "%s.%u@%s", "saflogger", getpid(), 
> hostname);
> - logSvcUsrName.length = strlen((char *)logSvcUsrName.value);
> + if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
> + fprintf(stderr, "Failed to enable Extended SaNameT");
> + exit(EXIT_FAILURE);
> + }
> +
> + /**
> +  * osaf_extended_name_init() is added in case osaf_extended_* APIs
> +  * are used before saLogInitialize().
> +  */
> + osaf_extended_name_init();
> +
> + char svcUserName[kOsafMaxDnLength];
> + snprintf(svcUserName, sizeof(svcUserName), "%s.%u@%s", "saflogger", 
> getpid(), hostname);
> + 

Re: [devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574]

2016-07-05 Thread A V Mahesh
Hi Hoang,

Except  [PATCH 8 of 8] ,  I am done with code review , please try to 
optimize  the [PATCH 8 of 8]  logic with single function , with three 
different version arguments.

Please provide updated V2 patch with review comments along with README, 
so that we can move for testing.

-AVM


On 7/1/2016 9:59 AM, A V Mahesh wrote:
> Hi Hoang,
>
> Thanks for the clarifications.
>
> Please hold on publishing new version of patch, I am in process of 
> reviewing[PATCH 2 to  8] ,
>
> so we may  have some more comments , so we can have on single 
> consolidated patch V2.
>
> -AVM
>
>
> On 7/1/2016 9:27 AM, Vo Minh Hoang wrote:
>> Dear Mahesh,
>>
>> I would like to answer to your comments.
>>
>>>> Comment 1 :
>> I will update PR document so there is not a README file.
>>
>>>> Comment 2:
>> I thought that we should keep current implementation even it is not
>> beautiful. The reasons are:
>> - keep a consistence way to access string value.
>> - 2 pointers to one string brings potential problem for future 
>> maintenance.
>> - For near future changing to CPP,  this implementation can easily 
>> change to
>> nicer way.
>>
>>>> Comment 3 :
>> I'm agreed with your comments, will work on that in next version of 
>> patch.
>>
>>>> Comment 4 :
>> Firstly, I tried to look for ckpt_name usage in source code but found
>> nothing.
>> Secondly, struct cpd_cpnd_info_node contains cpnd node info so it 
>> does not
>> have any ckpt_name related sematic. And struct cpd_cpnd_info_node 
>> also have
>> ckpt_ref_list to refer all its check points.
>> So ckpt_name seems redundant and need to be removed.
>>
>>>> Comment 5 :
>> I'm agreed. This work has lower priority and will be submitted in 
>> different
>> patch/ticket.
>>
>> P.S. About the problem #1574 patches cannot apply on today's staging. I
>> tested and found that it need to be applied after #1874. I skip 
>> sending new
>> version for updating patch following your comments.
>>
>> Thank you and best regards,
>> Hoang
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Thursday, June 30, 2016 11:41 AM
>> To: Vo Minh Hoang <hoang.m...@dektech.com.au>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 0 of 8] Review Request for CKPT: Support DNs 
>> longer than
>> 255 bytes [#1574]
>>
>> Hi  Hoang ,
>>
>> On 6/30/2016 9:22 AM, Vo Minh Hoang wrote:
>>> Dear Mahesh,
>>>
>>> Now I am updating documents related to CKPT long DN.
>>> It will be submitted soon.
>> Ok you can ignore comment one.
>>
>> I will provide patch by patch clarification & review comments, please 
>> find
>> them  for  [PATCH 1 of 8]
>>
>>
>> Comment 1 :
>>
>> ==
>> @@ -26,6 +27,12 @@ static int __init_cpd(void)
>>{
>>NCS_LIB_REQ_INFO lib_create;
>>
>> +/* Enable extended SaNameT */
>> +if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
>> +LOG_ER("Failed to set environment variable:
>> SA_ENABLE_EXTENDED_NAMES");
>> +return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
>> +}
>> +
>> ==
>>
>> Can you please  provide   README about  long DN  Support , which will
>> consist information such as `how steps to enable long DN setting`
>>
>> similar to   LOG service,  please find  reference LOG service README
>> Support Long DN
>> `https://sourceforge.net/p/opensaf/tickets/_discuss/thread/6ba7a0c9/8103/att 
>>
>> achment/README_LONGDN_R2`
>>
>>
>> Comment 2 :
>>
>> ==
>> @@ -334,10 +334,10 @@ uint32_t cpd_amf_register(CPD_CB *cpd_cb
>>
>>}
>>if (saAmfComponentRegister(cpd_cb->amf_hdl, _cb->comp_name,
>> (SaNameT *)NULL) == SA_AIS_OK) {
>> -TRACE_LEAVE2("cpd amf register success for
>> %s",cpd_cb->comp_name.value);
>> +TRACE_LEAVE2("cpd amf register success for %s",
>> osaf_extended_name_borrow(_cb->comp_name));
>>
>> ==
>>
>> I think `cpd_cb->comp_name` `cluster_node.nodeName` kind of variables
>> are fill once and thy are consistent ,
>> so is it possible to sto

Re: [devel] [PATCH 8 of 8] imported patch 1574_cpnd_support_recover_shm_version_0_v2.patch

2016-07-05 Thread A V Mahesh
Hi Hoang ,

cpnd_restore_client_info
cpnd_restore_ckpt_info_v0
cpnd_restore_ckpt_info_v1

can you please elaborate   this share memory version &

and restoring client information from share memory process  ,

Not able to interpret the  use case.

-AVM


On 6/23/2016 4:23 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/include/cpsv_shm.h |   20 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c  |1 -
>   osaf/services/saf/cpsv/cpnd/cpnd_res.c   |  821 
> +++---
>   3 files changed, 634 insertions(+), 208 deletions(-)
>
>
> diff --git a/osaf/libs/common/cpsv/include/cpsv_shm.h 
> b/osaf/libs/common/cpsv/include/cpsv_shm.h
> --- a/osaf/libs/common/cpsv/include/cpsv_shm.h
> +++ b/osaf/libs/common/cpsv/include/cpsv_shm.h
> @@ -31,7 +31,7 @@
>   
>   typedef struct cpsv_ckpt_hdr {
>   SaCkptCheckpointHandleT ckpt_id;/* Index for identifying the 
> checkpoint */
> - char ckpt_name[kOsafMaxDnLength];
> +  SaNameT ckpt_name;
>   SaCkptCheckpointCreationAttributesT create_attrib;
>   SaCkptCheckpointOpenFlagsT open_flags;
>   uint32_t ckpt_lcl_ref_cnt;
> @@ -74,6 +74,24 @@ typedef struct ckpt_info {
>   int32_t next;
>   } CKPT_INFO;
>   
> +typedef struct ckpt_info_v0 {
> + SaNameT ckpt_name;
> + SaCkptCheckpointHandleT ckpt_id;
> + uint32_t maxSections;
> + SaSizeT maxSecSize;
> + NODE_ID node_id;
> + int32_t offset;
> + uint32_t client_bitmap;
> + int32_t is_valid;
> + uint32_t bm_offset;
> + bool is_unlink;
> + bool is_close;
> + bool cpnd_rep_create;
> + bool is_first;
> + SaTimeT close_time;
> + int32_t next;
> +} CKPT_INFO_V0;
> +
>   typedef struct client_info {
>   SaCkptHandleT ckpt_app_hdl;
>   uint32_t ckpt_open_ref_cnt;
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_proc.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_proc.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_proc.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_proc.c
> @@ -1813,7 +1813,6 @@ uint32_t cpnd_ckpt_hdr_update(CPND_CKPT_
>   memset(_req, '\0', sizeof(write_req));
>   memset(_hdr, '\0', sizeof(CPSV_CKPT_HDR));
>   ckpt_hdr.ckpt_id = cp_node->ckpt_id;
> - strncpy(ckpt_hdr.ckpt_name, cp_node->ckpt_name, kOsafMaxDnLength);
>   ckpt_hdr.create_attrib = cp_node->create_attrib;
>   ckpt_hdr.open_flags = cp_node->open_flags;
>   ckpt_hdr.is_unlink = cp_node->is_unlink;
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_res.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_res.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_res.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_res.c
> @@ -40,6 +40,8 @@
>   
>   #define m_CPND_CKPTINFO_READ(ckpt_info,addr,offset) 
> memcpy(_info,addr+offset,sizeof(CKPT_INFO))
>   
> +#define m_CPND_CKPTINFO_V0_READ(ckpt_info,addr,offset) 
> memcpy(_info,addr+offset,sizeof(CKPT_INFO_V0))
> +
>   #define m_CPND_CKPTINFO_UPDATE(addr,ckpt_info,offset) 
> memcpy(addr+offset,_info,sizeof(CKPT_INFO))
>   
>   #define m_CPND_CKPTHDR_UPDATE(ckpt_hdr,offset)  
> memcpy(offset,_hdr,sizeof(CKPT_HDR))
> @@ -48,6 +50,13 @@ static uint32_t cpnd_res_ckpt_sec_add(CP
>   static bool cpnd_find_exact_ckptinfo(CPND_CB *cb, CKPT_INFO *ckpt_info, 
> uint32_t bitmap_offset,
>uint32_t *offset, uint32_t 
> *prev_offset);
>   static void cpnd_clear_ckpt_info(CPND_CB *cb, CPND_CKPT_NODE *cp_node, 
> uint32_t curr_offset, uint32_t prev_offset);
> +static uint32_t cpnd_restore_client_info(CPND_CB *cb, uint8_t *cli_addr);
> +static uint32_t cpnd_restore_ckpt_info_v1(CPND_CB *cb, uint8_t *ckpt_addr, 
> SaClmNodeIdT nodeid);
> +static uint32_t cpnd_restore_ckpt_info_v0(CPND_CB *cb, uint8_t *ckpt_addr, 
> SaClmNodeIdT nodeid);
> +static void cpnd_destroy_shm_cpnd_cp_info(NCS_OS_POSIX_SHM_REQ_OPEN_INFO 
> *open_req);
> +static void *cpnd_create_shm_cpnd_cp_info(NCS_OS_POSIX_SHM_REQ_INFO 
> *req_info);
> +static void cpnd_update_shm_cpnd_cp_info(CPND_CB *cb);
> +static void cpnd_convert_cp_info_v0(CKPT_INFO_V0 *cp_info_v0, CKPT_INFO 
> *cp_info);
>   
>   
> /***
>  *
>* Name   : cpnd_client_extract_bits
> @@ -315,24 +324,10 @@ void cpnd_restart_update_timer(CPND_CB *
>   
>   void *cpnd_restart_shm_create(NCS_OS_POSIX_SHM_REQ_INFO *cpnd_open_req, 
> CPND_CB *cb, SaClmNodeIdT nodeid)
>   {
> - uint32_t counter = 0, count, num_bitset = 0, n_clients, rc = 
> NCSCC_RC_SUCCESS, bit_position;
> - uint64_t i_offset;
> - int32_t next_offset;
> - CPND_CKPT_CLIENT_NODE *cl_node = NULL;
> - CPND_CKPT_NODE *cp_node = NULL;
> - CLIENT_INFO cl_info;
> - CLIENT_HDR cli_hdr;
> - CKPT_INFO cp_info, tmp_cp_info;
> - SaCkptHandleT client_hdl;
> + uint32_t rc = NCSCC_RC_SUCCESS;
>   char *buf = NULL, *buffer = NULL;
>   uint8_t size = 0, total_length;
>   GBL_SHM_PTR gbl_shm_addr = {0, 0, 0, 0, 0};
> - memset(_info, '\0', sizeof(CKPT_INFO));
> - NCS_OS_POSIX_SHM_REQ_INFO 

Re: [devel] [PATCH 7 of 8] ckpt: Add new test cases to verify long DN feature on CPSV v1 [#1574]

2016-07-05 Thread A V Mahesh
Hi Hoang,

+bool is_extended_name_enable() {
+
+  char *extended_name_env = getenv("SA_ENABLE_EXTENDED_NAMES");

Please provide usage detailes of SA_ENABLE_EXTENDED_NAMES in README  in V2 
patch.

-AVM

On 6/23/2016 4:23 PM, Hoang Vo wrote:
>   tests/cpsv/Makefile.am  |1 +
>   tests/cpsv/test_cpa.c   |  180 
> +++-
>   tests/cpsv/test_cpa_util.c  |   15 +++
>   tests/cpsv/test_cpsv.h  |6 +
>   tests/cpsv/test_cpsv_conf.h |3 +
>   5 files changed, 203 insertions(+), 2 deletions(-)
>
>
> diff --git a/tests/cpsv/Makefile.am b/tests/cpsv/Makefile.am
> --- a/tests/cpsv/Makefile.am
> +++ b/tests/cpsv/Makefile.am
> @@ -21,6 +21,7 @@ MAINTAINERCLEANFILES = Makefile.in
>   bin_PROGRAMS = ckpttest
>   
>   ckpttest_CPPFLAGS = \
> + -DSA_EXTENDED_NAME_SOURCE \
>   $(AM_CPPFLAGS) \
>   -I$(top_srcdir)/tests/unit_test_fw/inc \
>   -I$(top_srcdir)/osaf/libs/common/immsv/include \
> diff --git a/tests/cpsv/test_cpa.c b/tests/cpsv/test_cpa.c
> --- a/tests/cpsv/test_cpa.c
> +++ b/tests/cpsv/test_cpa.c
> @@ -1,6 +1,8 @@
>   #include 
>   #include 
>   
> +#include "saAis.h"
> +#include "osaf_extended_name.h"
>   #include "test_cpsv.h"
>   #include "test_cpsv_conf.h"
>   #include "ncs_main_papi.h"
> @@ -42,6 +44,10 @@ const char *saf_error_string[] = {
>   #define m_TEST_CPSV_PRINTF(...)
>   #endif
>   
> +#define VALID_EXTENDED_NAME_LENGTH 400
> +#define INVALID_EXTENDED_NAME_LENGTH 2049
> +
> +
>   extern int gl_prev_act;
>   
>   /** Ultility Functions /
> @@ -82,6 +88,18 @@ void printResult(int result)
>   
>   }
>   
> +bool is_extended_name_enable() {
> +
> +  char *extended_name_env = getenv("SA_ENABLE_EXTENDED_NAMES");
> +  if (extended_name_env == 0)
> +   return false;
> +
> +  if (strcmp(extended_name_env, "1") != 0)
> +   return false;
> +
> +  return true;
> +}
> +
>   void handleAssigner(SaInvocationT invocation, SaCkptCheckpointHandleT 
> checkpointHandle)
>   {
>  if (invocation == 1014)
> @@ -122,8 +140,7 @@ void fill_ckpt_attri(SaCkptCheckpointCre
>   
>   
> 
>   void fill_ckpt_name(SaNameT *name,char *string)
>   {
> -   strcpy((char *)name->value,string);
> -   name->length = strlen((char *)name->value);
> +   saAisNameLend(string, name);
>   }
>   
>   void fill_sec_attri(SaCkptSectionCreationAttributesT 
> *sec_cr_attr,SaCkptSectionIdT *sec,SaTimeT exp_time)
> @@ -279,6 +296,20 @@ void fill_testcase_data()
>  
> fill_ckpt_name(_replica_ckpt_large,"safCkpt=weak_replica_large_ckpt,safApp=safCkptService");
>  
> fill_ckpt_name(_ckpt_large,"safCkpt=collocated_large_ckpt,safApp=safCkptService");
>   
> +   char *ckpt_name = malloc(VALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, 0, VALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, '.', VALID_EXTENDED_NAME_LENGTH - 1);
> +   int length = sprintf(ckpt_name, 
> "safCkpt=all_replicas_ckpt_with_valid_extended_name_length");
> +   *(ckpt_name + length) = '.';
> +   saAisNameLend(ckpt_name, 
> _replicas_ckpt_with_valid_extended_name_length);
> +
> +   ckpt_name = malloc(INVALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, 0, INVALID_EXTENDED_NAME_LENGTH);
> +   memset(ckpt_name, '.', INVALID_EXTENDED_NAME_LENGTH - 1);
> +   length = sprintf(ckpt_name, 
> "safCkpt=all_replicas_ckpt_with_invalid_extended_name_length");
> +   *(ckpt_name + length) = '.';
> +   saAisNameLend(ckpt_name, 
> _replicas_ckpt_with_invalid_extended_name_length);
> +
>  /* Variables for sec create */
>  tcd.sec_id1 = (SaUint8T*)"11";
>  tcd.section1.idLen = 2;
> @@ -447,6 +478,9 @@ void test_ckpt_cleanup(CPSV_CLEANUP_CKPT
> error = test_ckptUnlink(CKPT_UNLINK_SUCCESS9_T,TEST_CONFIG_MODE);
> break;
>   
> + case CPSV_CLEAN_ASYNC_ALL_REPLICAS_CKPT_EXTENDED_NAME:
> +  error = 
> test_ckptUnlink(CKPT_UNLINK_ALL_REPLICAS_EXTENDED_NAME_SUCCESS_T,TEST_CONFIG_MODE);
> +  break;
> }
>   
> if(error != TEST_PASS)
> @@ -2274,6 +2308,122 @@ final1:
> test_validate(result, TEST_PASS);
>   }
>   
> +void cpsv_it_open_55()
> +{
> +  int result;
> +  printHead("To verify creating a ckpt with valid extended name length");
> +
> +  /* Skip the test if Extended Name is not enable */
> +  if (is_extended_name_enable() == false)
> +   return test_validate(TEST_PASS, TEST_PASS);
> +
> +  result = test_ckptInitialize(CKPT_INIT_SUCCESS_T,TEST_CONFIG_MODE);
> +  if(result != TEST_PASS)
> + goto final1;
> +
> +  result = 
> test_ckptOpen(CKPT_OPEN_ALL_CREATE_EXTENDED_NAME_SUCCESS_T,TEST_NONCONFIG_MODE);
> +
> +  test_cpsv_cleanup(CPSV_CLEAN_INIT_SUCCESS_T);
> +
> +final1:
> +  printResult(result);
> +  test_validate(result, TEST_PASS);
> +}
> +
> +void cpsv_it_open_56()
> +{
> +  int result;
> +  printHead("To verify creating a ckpt with invalid extended 

Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]

2016-07-05 Thread A V Mahesh
Hi Hoang,

-case CPD_EVT_ND2D_CKPT_UNLINK:
+case CPD_EVT_ND2D_CKPT_UNLINK_2:

-send_evt.info.cpnd.type = CPND_EVT_D2ND_CKPT_CREATE;
+send_evt.info.cpnd.type = CPND_EVT_D2ND_CKPT_CREATE_2;

Is this changes  tested with in-service upgrade ?

case like old ND and new ND  , New Director and  Old ND.

- AVM

On 6/23/2016 4:23 PM, Hoang Vo wrote:
>   osaf/libs/agents/saf/cpa/cpa_api.c  |  12 +---
>   osaf/libs/agents/saf/cpa/cpa_mds.c  |   2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c|   1 +
>   osaf/services/saf/cpsv/cpd/cpd_evt.c|  10 +++---
>   osaf/services/saf/cpsv/cpd/cpd_mds.c|   3 ++-
>   osaf/services/saf/cpsv/cpd/cpd_proc.c   |   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  26 --
>   osaf/services/saf/cpsv/cpnd/cpnd_mds.c  |   4 ++--
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   6 +++---
>   9 files changed, 42 insertions(+), 24 deletions(-)
>
>
> diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c 
> b/osaf/libs/agents/saf/cpa/cpa_api.c
> --- a/osaf/libs/agents/saf/cpa/cpa_api.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_api.c
> @@ -880,6 +880,8 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -981,7 +983,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1192,6 +1194,8 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02
>  Section 3.6.1 saCkptCheckpointOpen() and 
> saCkptCheckpointOpenAsync(), Return Values */
> @@ -1277,7 +1281,7 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa
>   /* Populate & Send the Open Event to CPND */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2;
>   evt.info.cpnd.info.openReq.client_hdl = ckptHandle;
>   evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl;
>   
> @@ -1597,6 +1601,8 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   }
>   
>   ckpt_name = osaf_extended_name_borrow(checkpointName);
> + if (strlen(ckpt_name) >= kOsafMaxDnLength)
> + return SA_AIS_ERR_INVALID_PARAM;
>   
>   /* retrieve CPA CB */
>   m_CPA_RETRIEVE_CB(cb);
> @@ -1635,7 +1641,7 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp
>   /* Populate evt.info.cpnd.info.unlinkReq & Call MDS sync Send */
>   memset(, 0, sizeof(CPSV_EVT));
>   evt.type = CPSV_EVT_TYPE_CPND;
> - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK;
> + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK_2;
>   
>   osaf_extended_name_lend(ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c 
> b/osaf/libs/agents/saf/cpa/cpa_mds.c
> --- a/osaf/libs/agents/saf/cpa/cpa_mds.c
> +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c
> @@ -515,7 +515,7 @@ static uint32_t cpa_mds_svc_evt(CPA_CB *
>  /* Populate & Send the Open Event to CPND */
>  memset(, 0, sizeof(CPSV_EVT));
>  evt.type = CPSV_EVT_TYPE_CPND;
> -evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE;
> +evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE_2;
>  evt.info.cpnd.info.ckptListUpdate.client_hdl = 
> lc_node->cl_hdl;
>  osaf_extended_name_lend(lc_node->ckpt_name, 
> _name);
>   
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -2414,6 +2414,7 @@ uint32_t cpsv_encode_extended_name(NCS_U
>   if(!osaf_is_an_extended_name(name))
>   return NCSCC_RC_SUCCESS;
>   
> + TRACE("length = %d", name->length);
>   SaConstStringT value = osaf_extended_name_borrow(name);
>   uint16_t length = osaf_extended_name_length(name);
>   
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
> b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> @@ -110,6 +110,7 @@ void cpd_process_evt(CPSV_EVT 

Re: [devel] [PATCH 2 of 8] cpnd: Add support for extended SaNameT v1 [#1574]

2016-07-04 Thread A V Mahesh
Hi Hoan,

On 6/23/2016 4:23 PM, Hoang Vo wrote:
> + buf = m_MMGR_ALLOC_CPND_DEFAULT(CPND_MAX_REPLICA_NAME_LENGTH);
> + memset(buf, '\0', CPND_MAX_REPLICA_NAME_LENGTH);
> + strncpy(buf, cp_node->ckpt_name, CPND_REP_NAME_MAX_CKPT_NAME_LENGTH);
> +
> + sprintf(buf + strlen(buf) - 1, "_%d_%llu", 
> (uint32_t)m_NCS_NODE_ID_FROM_MDS_DEST(cb->cpnd_mdest_id), cp_node->ckpt_id);

Dose REP_NAME Including node_id  will go  up to  Filename length limits 
on linux (255) ?

-AVM

On 6/23/2016 4:23 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/include/cpnd.h  |   1 +
>   osaf/libs/common/cpsv/include/cpnd_cb.h   |   5 +-
>   osaf/libs/common/cpsv/include/cpnd_init.h |   3 +-
>   osaf/libs/common/cpsv/include/cpsv_shm.h  |   6 +-
>   osaf/services/saf/cpsv/cpnd/Makefile.am   |   1 +
>   osaf/services/saf/cpsv/cpnd/cpnd_db.c |   6 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c|  71 ++
>   osaf/services/saf/cpsv/cpnd/cpnd_main.c   |   7 ++
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c   |  83 
> ++
>   osaf/services/saf/cpsv/cpnd/cpnd_res.c|  20 +++---
>   10 files changed, 143 insertions(+), 60 deletions(-)
>
>
> diff --git a/osaf/libs/common/cpsv/include/cpnd.h 
> b/osaf/libs/common/cpsv/include/cpnd.h
> --- a/osaf/libs/common/cpsv/include/cpnd.h
> +++ b/osaf/libs/common/cpsv/include/cpnd.h
> @@ -34,6 +34,7 @@
>   #define CPND_H
>   
>   #include 
> +#include "osaf_extended_name.h"
>   #include "ncssysf_def.h"
>   #include "ncs_main_papi.h"
>   #include "ncssysf_tsk.h"
> diff --git a/osaf/libs/common/cpsv/include/cpnd_cb.h 
> b/osaf/libs/common/cpsv/include/cpnd_cb.h
> --- a/osaf/libs/common/cpsv/include/cpnd_cb.h
> +++ b/osaf/libs/common/cpsv/include/cpnd_cb.h
> @@ -34,6 +34,9 @@ extern uint32_t gl_cpnd_cb_hdl;
>   #define m_CPND_GIVEUP_CPND_CBncshm_give_hdl(gl_cpnd_cb_hdl)
>   
>   #define CPND_MAX_REPLICAS 1000
> +#define CPND_REP_NAME_MAX_CKPT_NAME_LENGTH 150
> +#define CPND_MAX_REPLICA_NAME_LENGTH (CPND_REP_NAME_MAX_CKPT_NAME_LENGTH + 
> 50)
> +
>   #define CPSV_GEN_SECTION_ID_SIZE 4
>   #define CPSV_WAIT_TIME  1000
>   
> @@ -169,7 +172,7 @@ typedef struct cpnd_all_repl_write_evt_n
>   typedef struct cpnd_ckpt_node {
>   NCS_PATRICIA_NODE patnode;
>   SaCkptCheckpointHandleT ckpt_id;/* index for identifying the 
> checkpoint */
> - SaNameT ckpt_name;
> + SaConstStringT ckpt_name;
>   SaCkptCheckpointCreationAttributesT create_attrib;
>   SaCkptCheckpointOpenFlagsT open_flags;
>   uint32_t ckpt_lcl_ref_cnt;
> diff --git a/osaf/libs/common/cpsv/include/cpnd_init.h 
> b/osaf/libs/common/cpsv/include/cpnd_init.h
> --- a/osaf/libs/common/cpsv/include/cpnd_init.h
> +++ b/osaf/libs/common/cpsv/include/cpnd_init.h
> @@ -130,6 +130,7 @@ uint32_t cpnd_all_repl_rsp_expiry(CPND_C
>   uint32_t cpnd_open_active_sync_expiry(CPND_CB *cb, CPND_TMR_INFO *tmr_info);
>   void cpnd_proc_free_read_data(CPSV_EVT *evt);
>   SaUint32T cpnd_get_scAbsenceAllowed_attr();
> +SaUint32T cpnd_get_longDnsAllowed_attr();
>   /* End cpnd_proc.c */
>   
>   /* File : ---  cpnd_amf.c */
> @@ -163,7 +164,7 @@ void cpnd_evt_node_get(CPND_CB *cb, SaCk
>   void cpnd_evt_node_getnext(CPND_CB *cb, SaCkptCheckpointHandleT 
> lcl_ckpt_id, CPSV_CPND_ALL_REPL_EVT_NODE **evt_node);
>   uint32_t cpnd_evt_node_add(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE 
> *evt_node);
>   uint32_t cpnd_evt_node_del(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE 
> *evt_node);
> -CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaNameT 
> ckpt_name);
> +CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaConstStringT 
> ckpt_name);
>   CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_add(CPND_CKPT_NODE *cp_node, 
> SaCkptSectionIdT *id, SaTimeT exp_time,
> uint32_t gen_flag);
>   void cpnd_evt_backup_queue_add(CPND_CKPT_NODE *cp_node, CPND_EVT *evt);
> diff --git a/osaf/libs/common/cpsv/include/cpsv_shm.h 
> b/osaf/libs/common/cpsv/include/cpsv_shm.h
> --- a/osaf/libs/common/cpsv/include/cpsv_shm.h
> +++ b/osaf/libs/common/cpsv/include/cpsv_shm.h
> @@ -18,6 +18,8 @@
>   #ifndef CPSV_SHM_H
>   #define CPSV_SHM_H
>   
> +#include "osaf_extended_name.h"
> +
>   #define MAX_CLIENTS 1000
>   #define MAX_CKPTS  2000
>   #define MAX_SIZE  30
> @@ -29,7 +31,7 @@
>   
>   typedef struct cpsv_ckpt_hdr {
>   SaCkptCheckpointHandleT ckpt_id;/* Index for identifying the 
> checkpoint */
> - SaNameT ckpt_name;
> + char ckpt_name[kOsafMaxDnLength];
>   SaCkptCheckpointCreationAttributesT create_attrib;
>   SaCkptCheckpointOpenFlagsT open_flags;
>   uint32_t ckpt_lcl_ref_cnt;
> @@ -55,7 +57,7 @@ typedef struct cpsv_sect_hdr {
>   } CPSV_SECT_HDR;
>   
>   typedef struct ckpt_info {
> - SaNameT ckpt_name;
> + char ckpt_name[kOsafMaxDnLength];
>   SaCkptCheckpointHandleT ckpt_id;
>   uint32_t maxSections;
>   SaSizeT maxSecSize;
> diff --git 

Re: [devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574]

2016-06-30 Thread A V Mahesh
Hi Hoang,

Thanks for the clarifications.

Please hold on publishing new version of patch, I am in process of 
reviewing[PATCH 2 to  8] ,

so we may  have some more comments , so we can have on single 
consolidated patch V2.

-AVM


On 7/1/2016 9:27 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> I would like to answer to your comments.
>
>>> Comment 1 :
> I will update PR document so there is not a README file.
>
>>> Comment 2:
> I thought that we should keep current implementation even it is not
> beautiful. The reasons are:
> - keep a consistence way to access string value.
> - 2 pointers to one string brings potential problem for future maintenance.
> - For near future changing to CPP,  this implementation can easily change to
> nicer way.
>
>>> Comment 3 :
> I'm agreed with your comments, will work on that in next version of patch.
>
>>> Comment 4 :
> Firstly, I tried to look for ckpt_name usage in source code but found
> nothing.
> Secondly, struct cpd_cpnd_info_node contains cpnd node info so it does not
> have any ckpt_name related sematic. And struct cpd_cpnd_info_node also have
> ckpt_ref_list to refer all its check points.
> So ckpt_name seems redundant and need to be removed.
>
>>> Comment 5 :
> I'm agreed. This work has lower priority and will be submitted in different
> patch/ticket.
>
> P.S. About the problem #1574 patches cannot apply on today's staging. I
> tested and found that it need to be applied after #1874. I skip sending new
> version for updating patch following your comments.
>
> Thank you and best regards,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Thursday, June 30, 2016 11:41 AM
> To: Vo Minh Hoang <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than
> 255 bytes [#1574]
>
> Hi  Hoang ,
>
> On 6/30/2016 9:22 AM, Vo Minh Hoang wrote:
>> Dear Mahesh,
>>
>> Now I am updating documents related to CKPT long DN.
>> It will be submitted soon.
> Ok you can ignore comment one.
>
> I will provide patch by patch clarification & review comments, please find
> them  for  [PATCH 1 of 8]
>
>
> Comment 1 :
>
> ==
> @@ -26,6 +27,12 @@ static int __init_cpd(void)
>{
>NCS_LIB_REQ_INFO lib_create;
>
> +/* Enable extended SaNameT */
> +if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
> +LOG_ER("Failed to set environment variable:
> SA_ENABLE_EXTENDED_NAMES");
> +return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
> +}
> +
> ==
>
> Can you please  provide   README about  long DN  Support , which will
> consist information such as `how steps to enable long DN setting`
>
> similar to   LOG service,  please find  reference LOG service README
> Support Long DN
> `https://sourceforge.net/p/opensaf/tickets/_discuss/thread/6ba7a0c9/8103/att
> achment/README_LONGDN_R2`
>
>
> Comment 2 :
>
> ==
> @@ -334,10 +334,10 @@ uint32_t cpd_amf_register(CPD_CB *cpd_cb
>
>}
>if (saAmfComponentRegister(cpd_cb->amf_hdl, _cb->comp_name,
> (SaNameT *)NULL) == SA_AIS_OK) {
> -TRACE_LEAVE2("cpd amf register success for
> %s",cpd_cb->comp_name.value);
> +TRACE_LEAVE2("cpd amf register success for %s",
> osaf_extended_name_borrow(_cb->comp_name));
>
> ==
>
> I think `cpd_cb->comp_name` `cluster_node.nodeName` kind of variables
> are fill once and thy are consistent ,
> so is it possible to store such variable once by using
> `osaf_extended_name_borrow()` when the intial value getting assigned?
> this comment applies to all other consistent variables .
>
> Comment 3 :
>
> ==
>
> @@ -166,6 +162,9 @@ uint32_t cpd_ckpt_node_delete(CPD_CB *cb
>rc = NCSCC_RC_FAILURE;
>}
>
> +if (ckpt_node->ckpt_name != NULL)
> +free((void *)ckpt_node->ckpt_name);
> +
> ==
>
> Ideally frees can be part of m_MMGR_FREE_CPD_CKPT_INFO_NODE() , so that
> we can avoid multiple free calls ( code readability )
> this comment applies to all other free chances.
>
> Comment 4 :
>
> ==
>
> @@ -123,8 +123,7 @@ typedef struct cpd_cpnd_inf

Re: [devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574]

2016-06-29 Thread A V Mahesh
Hi  Hoang ,

On 6/30/2016 9:22 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Now I am updating documents related to CKPT long DN.
> It will be submitted soon.
Ok you can ignore comment one.

I will provide patch by patch clarification & review comments, please 
find them  for  [PATCH 1 of 8]


Comment 1 :

==
@@ -26,6 +27,12 @@ static int __init_cpd(void)
  {
  NCS_LIB_REQ_INFO lib_create;

+/* Enable extended SaNameT */
+if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
+LOG_ER("Failed to set environment variable: 
SA_ENABLE_EXTENDED_NAMES");
+return m_LEAP_DBG_SINK(NCSCC_RC_FAILURE);
+}
+
==

Can you please  provide   README about  long DN  Support , which will 
consist information such as `how steps to enable long DN setting`

similar to   LOG service,  please find  reference LOG service README 
Support Long DN
`https://sourceforge.net/p/opensaf/tickets/_discuss/thread/6ba7a0c9/8103/attachment/README_LONGDN_R2`


Comment 2 :

==
@@ -334,10 +334,10 @@ uint32_t cpd_amf_register(CPD_CB *cpd_cb

  }
  if (saAmfComponentRegister(cpd_cb->amf_hdl, _cb->comp_name, 
(SaNameT *)NULL) == SA_AIS_OK) {
-TRACE_LEAVE2("cpd amf register success for 
%s",cpd_cb->comp_name.value);
+TRACE_LEAVE2("cpd amf register success for %s", 
osaf_extended_name_borrow(_cb->comp_name));

==

I think `cpd_cb->comp_name` `cluster_node.nodeName` kind of variables 
are fill once and thy are consistent ,
so is it possible to store such variable once by using 
`osaf_extended_name_borrow()` when the intial value getting assigned?
this comment applies to all other consistent variables .

Comment 3 :

==

@@ -166,6 +162,9 @@ uint32_t cpd_ckpt_node_delete(CPD_CB *cb
  rc = NCSCC_RC_FAILURE;
  }

+if (ckpt_node->ckpt_name != NULL)
+free((void *)ckpt_node->ckpt_name);
+
==

Ideally frees can be part of m_MMGR_FREE_CPD_CKPT_INFO_NODE() , so that 
we can avoid multiple free calls ( code readability )
this comment applies to all other free chances.

Comment 4 :

==

@@ -123,8 +123,7 @@ typedef struct cpd_cpnd_info_node {
  uint32_t timer_state;
  bool ckpt_cpnd_scxb_exist;
  /* for imm */
-SaNameT node_name;
-SaNameT ckpt_name;
+SaConstStringT node_name;
===

why ckpt_name removed form struct cpd_cpnd_info_node ?
is it no more used in this struct ?


Comment 5 :

It will be more useful to provide or change the cpsv_demo application to 
use LONG DN

/staging/samples/cpsv

-AVM

>
> Thank you and best regards,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Wednesday, June 29, 2016 10:48 AM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than
> 255 bytes [#1574]
>
> Hi Hoang,
>
> On 6/23/2016 4:23 PM, Hoang Vo wrote:
>> Testing Commands:
>> -
>> start all SCs and PLs
>> log in to Sc-1
>> run ckpttest
>> enable long DN setting
> Can you please how steps to enable long DN setting.  it will be more
> useful to have  README about  long DN  Support similar to
> LOG service,  please find  reference LOG service README Support Long DN
> `https://sourceforge.net/p/opensaf/tickets/_discuss/thread/6ba7a0c9/8103/att
> achment/README_LONGDN_R2`
>
>
> -AVM
>
>
>
> On 6/23/2016 4:23 PM, Hoang Vo wrote:
>> Summary: CKPT: Support DNs longer than 255 bytes [#1574]
>> Review request for Trac Ticket(s): 1574
>> Peer Reviewer(s): mahesh.va...@oracle.com; anders.wid...@ericsson.com
>> Pull request to: mahesh.va...@oracle.com
>> 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 servicesy
>>OpenSAF servicesn
>>Core libraries  n
>>Samples n
>>Tests   y
>>Other   n
>>
>>
>> Comments (indicate scope for each "y"

Re: [devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574]

2016-06-28 Thread A V Mahesh
Hi Hoang,

On 6/23/2016 4:23 PM, Hoang Vo wrote:
> Testing Commands:
> -
> start all SCs and PLs
> log in to Sc-1
> run ckpttest
> enable long DN setting
   Can you please how steps to enable long DN setting.  it will be more 
useful to have  README about  long DN  Support similar to
   LOG service,  please find  reference LOG service README Support Long DN
`https://sourceforge.net/p/opensaf/tickets/_discuss/thread/6ba7a0c9/8103/attachment/README_LONGDN_R2`
 


-AVM



On 6/23/2016 4:23 PM, Hoang Vo wrote:
> Summary: CKPT: Support DNs longer than 255 bytes [#1574]
> Review request for Trac Ticket(s): 1574
> Peer Reviewer(s): mahesh.va...@oracle.com; anders.wid...@ericsson.com
> Pull request to: mahesh.va...@oracle.com
> 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 servicesy
>   OpenSAF servicesn
>   Core libraries  n
>   Samples n
>   Tests   y
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
>
> changeset 729f0b7318a9e628a00ed6ab0617c85d4527aa73
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   cpd: Add support for extended SaNameT [#1574]
>
> changeset c2fae0887466adc3414fa64506832122896e6070
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   cpnd: Add support for extended SaNameT v1 [#1574]
>
> changeset 98a1ed77d1de469b95022d5ea302b1e3d94b949b
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   cpa: Add support for extended SaNameT v1 [#1574]
>
> changeset adb30ae18b5972a4948403cabe379d5546ccdbea
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   cpsv: Add new message to support extended SaNameT v1 [#1574] New 
> messages
>   supporting extended SaNameT are introduce. Encoding and decoding 
> funtions
>   for them are also included.
>
> changeset dd4916df11a3e50a76f9002b00fefd63364f7599
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   cpd: Add new mbcsv messages supporting extended SaNameT v1 [#1574] New 
> MBCSV
>   messages supporting extended SaNameT and their encoding/decoding 
> functions
>   are included.
>
> changeset f091e95968329ed246c613537c636efe1508f3e8
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and 
> CPA
>   v1 [#1574]
>
> changeset d1bc0b21ac74f3eb2a6fff7c3d46dd7ef478ec92
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   ckpt: Add new test cases to verify long DN feature on CPSV v1 [#1574]
>
> changeset 4d297fdba6e02c0501ad9872f98b85372bb6f6ce
> Author:   Hoang Vo 
> Date: Thu, 23 Jun 2016 17:42:12 +0700
>
>   imported patch 1574_cpnd_support_recover_shm_version_0_v2.patch
>
>
> Complete diffstat:
> --
>   osaf/libs/agents/saf/cpa/Makefile.am  |1 +
>   osaf/libs/agents/saf/cpa/cpa_api.c|   50 ---
>   osaf/libs/agents/saf/cpa/cpa_db.c |2 +
>   osaf/libs/agents/saf/cpa/cpa_mds.c|4 +-
>   osaf/libs/agents/saf/cpa/cpa_proc.c   |2 +-
>   osaf/libs/common/cpsv/cpsv_evt.c  |  505 
> +--
>   osaf/libs/common/cpsv/include/cpa.h   |1 +
>   osaf/libs/common/cpsv/include/cpa_cb.h|2 +-
>   osaf/libs/common/cpsv/include/cpa_proc.h  |2 +-
>   osaf/libs/common/cpsv/include/cpd.h   |1 +
>   osaf/libs/common/cpsv/include/cpd_cb.h|   17 +-
>   osaf/libs/common/cpsv/include/cpd_imm.h   |4 +-
>   osaf/libs/common/cpsv/include/cpd_proc.h  |2 +-
>   osaf/libs/common/cpsv/include/cpnd.h  |1 +
>   osaf/libs/common/cpsv/include/cpnd_cb.h   |5 +-
>   osaf/libs/common/cpsv/include/cpnd_init.h |3 +-
>   osaf/libs/common/cpsv/include/cpsv_evt.h  |   24 +++
>   osaf/libs/common/cpsv/include/cpsv_shm.h  |   24 +++-
>   osaf/services/saf/cpsv/cpd/Makefile.am|1 +
>   osaf/services/saf/cpsv/cpd/cpd_amf.c  |7 +-
>   osaf/services/saf/cpsv/cpd/cpd_db.c   |  110 +---
>   osaf/services/saf/cpsv/cpd/cpd_evt.c  |  107 +++-
>   osaf/services/saf/cpsv/cpd/cpd_imm.c  |  268 
> ++
>   osaf/services/saf/cpsv/cpd/cpd_main.c |7 +
>   osaf/services/saf/cpsv/cpd/cpd_mbcsv.c|   31 -
>   

Re: [devel] [PATCH 1 of 1] cpnd: To reject creating section which has id length longer than MAX_SEC_ID_LEN [#1667]

2016-06-23 Thread A V Mahesh
Hi Hoang,

Ok I will push , can you please re-base and provide "[PATCH 1 of 2] 
ckpt: To add a new test case to verify creating section with id lenght 
longer than MAX_SIZE(30) [#1667]"

this not getting applied directly , on current code base.

-AVM

On 6/23/2016 4:35 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your review.
>
> Would you please push this when you have time.
>
> I confirmed LONG DN requirement and its target seems only SaNameT objects.
> Section name does not use DN so it still stay at fix 50 limit.
>
> More information, when you are reviewing Long DN implementation in CKPT, I
> have just submit newest patch files of Long DN. Basically, they are patches
> that Nhat Pham already submitted. I just rebase them to current source base
> (merging with headless feature, etc..).
> I hope this could help your review work easier.
>
> Best regards,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Monday, June 20, 2016 10:58 AM
> To: Vo Minh Hoang <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpnd: To reject creating section which has id
> length longer than MAX_SEC_ID_LEN [#1667]
>
> Hi  Hoang,
>
> No issue , for now we can push this for to over come current bug that you
> are facing .
>
> We can address all the  LONG DN related issue including Section ID length.
>
> 
> 
> Object Class : Table 2 DN Formats for Objects of Checkpoint Service Classes
> (SAI-AIS-CKPT-B.02.02 spec)
>
> 1) SaCkptCheckpoint -- "safCkpt=...,* "
>
> 2) SaCkptReplica -- "safReplica=...,safCkpt=...,* "
>
> 
> 
>
> So ACK form me not tested.
>
> -AVM
>
>
> On 6/14/2016 2:40 PM, Vo Minh Hoang wrote:
>> Dear Mahesh,
>>
>> Thank you very much for your information.
>> It seem I have lack of information when receiving this ticket from
>> Nhat Pham.
>> We will consider more about this.
>>
>> Sincerely,
>> Hoang
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, June 14, 2016 3:55 PM
>> To: Hoang Vo <hoang.m...@dektech.com.au>
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] cpnd: To reject creating section which has
>> id length longer than MAX_SEC_ID_LEN [#1667]
>>
>> Hi Hoang Vo,
>>
>> This patch is already published by Nhat Pham , and
>>
>> it is under review, I also provided few comments ( attached ) , please
>> check.
>>
>> -AVM
>>
>>
>> On 6/14/2016 1:48 PM, Hoang Vo wrote:
>>> osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>
>>>
>>> When a section with id size greater than MAX_SEC_ID_LEN [50], the
>>> cpnd
>> restarts with core dump.
>>> This fixing validates id size before creating section.
>>>
>>> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>>> @@ -2167,6 +2167,7 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
>>> CPSV_CKPT_DATA *ckpt_data = NULL;
>>> SaTimeT now, duration;
>>> int64_t time_stamp, giga_sec, result;
>>> +   uint16_t sec_id_len =
>>> +evt->info.sec_creatReq.sec_attri.sectionId->idLen;
>>> 
>>> TRACE_ENTER();
>>> memset(_evt, '\0', sizeof(CPSV_EVT)); @@ -2205,6 +2206,16 
>>> @@
>>> static uint32_t cpnd_evt_proc_ckpt_sect_
>>> TRACE_4("cpnd ckpt sect create failed for
>> ckpt_id:%llx,return value:%d",evt->info.sec_creatReq.ckpt_id,
>> SA_AIS_ERR_INVALID_PARAM);
>>> goto agent_rsp;
>>> }
>>> +
>>> +   if (sec_id_len >= MAX_SEC_ID_LEN) {
>>> +   send_evt.type = CPSV_EVT_TYPE_CPA;
>>> +   send_evt.info.cpa.type = CPA_EVT_ND2A_SEC_CREATE_RSP;
>>> +   send_evt.info.cpa.info.sec_creat_rsp.error =
>> SA_AIS_ERR_INVALID_PARAM;
>>> +   LOG_NO("cpnd ckpt sect create failed for ckpt_id:%llx,return
>> value:%d - sec_id_len:%d over supported limit %d",
>>> + 

Re: [devel] [PATCH 1 of 1] log: fix fail to delete appstream post headless when controllers come back [#1877]

2016-06-21 Thread A V Mahesh
Hi Vu,

Srikanth says it is existing bug #1330
so no issue , ACK from me ( verified )

-AVM

On 6/21/2016 2:34 PM, Srikanth Revanuru wrote:
> Hi Vu,
>
>
>   There is an existing ticket for the issue mentioned ( 
> https://sourceforge.net/p/opensaf/tickets/1330 )
>
> -- Srikanth
>
>
> - Original Message -
> From: vu.m.ngu...@dektech.com.au
> To: mahesh.va...@oracle.com, lennart.l...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net
> Sent: Tuesday, June 21, 2016 2:28:53 PM GMT +05:30 Chennai, Kolkata, Mumbai, 
> New Delhi
> Subject: Re: [devel] [PATCH 1 of 1] log: fix fail to delete appstream post 
> headless when controllers come back [#1877]
>
> Hi Mahesh,
>
> It is something we should consider to fix in a separate ticket (you can
> raise an ticket for this).
>
> The problem is that, logsv do not distingue runtime app stream or
> configurable app stream
> when it performs stream closing. That is why we see that syslog when we
> perfom `immcfg -d ` .
>
> Logsv should only call ` saImmOiRtObjectDelete` if the deleted app stream is
> runtime.
>
> Regards, Vu
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, June 21, 2016 3:37 PM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>;
>> lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] log: fix fail to delete appstream post
> headless
>> when controllers come back [#1877]
>>
>> Hi Vu,
>>
>> I was trying validate patch ,  the  App stream got deleted as expected
>> after this patch fix ,
>>
>> whic was not getting deleted as reported in  this ticket (#1877)
>>
>> but  getting "WA saImmOiRtObjectDelete returned 12" while deleting  why ?
>>
>> ==
>> =
>>
>> 1)  Created application stream
>>
>>SC-1:#immcfg -c SaLogStreamConfig
>> safLgStrCfg=appstream1,safApp=safLogService -a
>> saLogStreamPathName=applogs -a saLogStreamMaxLogFileSize=1500 -a
>> saLogStreamMaxFilesRotated=4 -a
>> saLogStreamFileName=applicationStream1
>>
>> 2) crated headless state ( stooped both controllers )
>>
>> 3) restored form  headless state ( restarted both both controllers )
>>
>> 4) checked the  App stream  & IMM object  exist
>>
>>
>>   SC-1: # immlist safLgStrCfg=appstream1,safApp=safLogService
>>
>> Name   Type Value(s)
>> ==
>> ==
>> safLgStrCfgSA_STRING_T
>> safLgStrCfg=appstream1
>> saLogStreamSeverityFilter  SA_UINT32_T 
>> saLogStreamPathNameSA_STRING_T applogs
>> saLogStreamNumOpeners  SA_UINT32_T  1 (0x1)
>> saLogStreamMaxLogFileSize  SA_UINT64_T 1500
> (0x5dc)
>> saLogStreamMaxFilesRotated SA_UINT32_T  4 (0x4)
>> saLogStreamLogFullHaltThresholdSA_UINT32_T  75 (0x4b)
>> saLogStreamLogFullAction   SA_UINT32_T  3 (0x3)
>> saLogStreamLogFileFormat   SA_STRING_T 
>> saLogStreamFixedLogRecordSize  SA_UINT32_T 150 (0x96)
>> saLogStreamFileNameSA_STRING_T
>> applicationStream1
>> saLogStreamCreationTimestamp   SA_TIME_T
>> 1466496942638256691 (0x145a0b3312265233, Tue Jun 21 13:45:42 2016)
>> logStreamDiscardedCounter  SA_UINT64_T  0 (0x0)
>> SaImmAttrImplementerName   SA_STRING_T
>> safLogService
>> SaImmAttrClassName SA_STRING_T
>> SaLogStreamConfig
>> SaImmAttrAdminOwnerNameSA_STRING_T 
>>
>> 5) Deleted the stream
>>
>> SC-1:# immcfg -d safLgStrCfg=appstream1,safApp=safLogService
>>
>> While deleting revived following warning :
>>
>> Jun 21 13:48:35 SC-1 osafimmnd[28957]: NO Ccb 3 COMMITTED
>> (immcfg_SC-1_29261)
>> Jun 21 13:48:35 SC-1 osaflogd[28969]: WA saImmOiRtObjectDelete returned
>> 12 for safLgStrCfg=appstream1,safApp=safLogService
>>
>> 6)   checked  again the  App stream  & IMM object(  App stream got
>> deleted as this patch fixed the issue reported in  this ticket #1877 )
>>
>> SC-1:#  immlist safLgStrCfg=appstream1,safApp=safLogSe

Re: [devel] [PATCH 1 of 1] log: fix fail to delete appstream post headless when controllers come back [#1877]

2016-06-21 Thread A V Mahesh
Hi Vu,

I was trying validate patch ,  the  App stream got deleted as expected 
after this patch fix ,

whic was not getting deleted as reported in  this ticket (#1877)

but  getting "WA saImmOiRtObjectDelete returned 12" while deleting  why ?

===

1)  Created application stream

  SC-1:#immcfg -c SaLogStreamConfig 
safLgStrCfg=appstream1,safApp=safLogService -a 
saLogStreamPathName=applogs -a saLogStreamMaxLogFileSize=1500 -a 
saLogStreamMaxFilesRotated=4 -a saLogStreamFileName=applicationStream1

2) crated headless state ( stooped both controllers )

3) restored form  headless state ( restarted both both controllers )

4) checked the  App stream  & IMM object  exist


 SC-1: # immlist safLgStrCfg=appstream1,safApp=safLogService

Name   Type Value(s)

safLgStrCfgSA_STRING_T 
safLgStrCfg=appstream1
saLogStreamSeverityFilter  SA_UINT32_T 
saLogStreamPathNameSA_STRING_T applogs
saLogStreamNumOpeners  SA_UINT32_T  1 (0x1)
saLogStreamMaxLogFileSize  SA_UINT64_T 1500 (0x5dc)
saLogStreamMaxFilesRotated SA_UINT32_T  4 (0x4)
saLogStreamLogFullHaltThresholdSA_UINT32_T  75 (0x4b)
saLogStreamLogFullAction   SA_UINT32_T  3 (0x3)
saLogStreamLogFileFormat   SA_STRING_T 
saLogStreamFixedLogRecordSize  SA_UINT32_T 150 (0x96)
saLogStreamFileNameSA_STRING_T 
applicationStream1
saLogStreamCreationTimestamp   SA_TIME_T 
1466496942638256691 (0x145a0b3312265233, Tue Jun 21 13:45:42 2016)
logStreamDiscardedCounter  SA_UINT64_T  0 (0x0)
SaImmAttrImplementerName   SA_STRING_T 
safLogService
SaImmAttrClassName SA_STRING_T 
SaLogStreamConfig
SaImmAttrAdminOwnerNameSA_STRING_T 

5) Deleted the stream

SC-1:# immcfg -d safLgStrCfg=appstream1,safApp=safLogService

While deleting revived following warning :

Jun 21 13:48:35 SC-1 osafimmnd[28957]: NO Ccb 3 COMMITTED 
(immcfg_SC-1_29261)
Jun 21 13:48:35 SC-1 osaflogd[28969]: WA saImmOiRtObjectDelete returned 
12 for safLgStrCfg=appstream1,safApp=safLogService

6)   checked  again the  App stream  & IMM object(  App stream got 
deleted as this patch fixed the issue reported in  this ticket #1877 )

SC-1:#  immlist safLgStrCfg=appstream1,safApp=safLogService
error - object or attribute does not exist

===

-AVM


On 6/14/2016 11:33 AM, Vu Minh Nguyen wrote:
>   osaf/services/saf/logsv/lgs/lgs_imm.cc |  54 +++
>   tests/logsv/logtest.c  |   2 +
>   tests/logsv/logtest.h  |   1 +
>   tests/logsv/tet_Log_recov.c|  57 
> ++
>   4 files changed, 100 insertions(+), 14 deletions(-)
>
>
> logsv supposed there were only three well-known config streams at logsv 
> startup.
> But this is not true when headless mode is enabled, so the stream id was 
> wrongly assigned to streams.
>
> One more thing, with headless enabled, app streams can be found at startup
> and app stream DN can be named not under `safApp=safLogService`.
> So, searching config objects under the root `safApp=safLogService` could
> miss the config app streams. e.g: app stream with DN "safLgStrCfg=Test"
>
> This patch fix the problem and also add new test suite #12 to test
> if created app stream can be deleted after headless.
>
> diff --git a/osaf/services/saf/logsv/lgs/lgs_imm.cc 
> b/osaf/services/saf/logsv/lgs/lgs_imm.cc
> --- a/osaf/services/saf/logsv/lgs/lgs_imm.cc
> +++ b/osaf/services/saf/logsv/lgs/lgs_imm.cc
> @@ -144,6 +144,21 @@ static void report_om_error(SaImmOiHandl
>   }
>   
>   /**
> + * Check to see if given DN is well-known stream or notE
> + *
> + * @param dn stream DN
> + * @ret true if well-known stream, false otherwise
> + */
> +static bool is_well_know_stream(const char* dn)
> +{
> + if (strcmp(dn, SA_LOG_STREAM_ALARM) == 0) return true;
> + if (strcmp(dn, SA_LOG_STREAM_NOTIFICATION) == 0) return true;
> + if (strcmp(dn, SA_LOG_STREAM_SYSTEM) == 0) return true;
> +
> + return false;
> +}
> +
> +/**
>* Pack and send a log service config checkpoint using mbcsv
>* @param stream
>*
> @@ -1694,7 +1709,11 @@ static SaAisErrorT stream_ccb_completed_
>   log_stream_t *stream = log_stream_get_by_name(name);
>   
>   if (stream != NULL) {
> - if (stream->streamId < 3) {
> + /**
> +  * Use stream name (DN) to 

Re: [devel] [PATCH 1 of 1] log: fix issue with priority of messages adding to mailbox in the server[1396]

2016-06-21 Thread A V Mahesh
Hi Canh,

It seems Lennart already provide comments  please check.

-AVM


On 6/21/2016 12:07 PM, Canh Truong wrote:
> Hi Mahesh,
>
> Thanks for your comments. I will send new version after Lennart comments.
> I have checked your idea about multiple thread test case. The idea may be 
> same with patch that I sent it before.
>
> Regards,
> Canh.
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Tuesday, June 21, 2016 11:47 AM
> To: Canh Truong; vu.m.ngu...@dektech.com.au; lennart.l...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] log: fix issue with priority of messages adding 
> to mailbox in the server[1396]
>
> Hi Canh,
>
> It will be good to send V2 patch with Lennart comments and adding new test 
> cases.
>
> -AVM
> On 6/21/2016 9:46 AM, A V Mahesh wrote:
>> Hi Canh,
>>
>> Some how we were not able to open your attachment , so  my self
>> written
>>
>> a multi threaded test case ( attached `thread_LogInitializeFinalize.c`
>> ) and reviewed/tested it is working fine.
>>
>> ACK  from me with following :
>>
>> - Please add such as attached  multi threaded test case to logtest,
>> before pushing
>>
>> - add # before ticket number in commit message  #1396
>>
>> -AVM
>>
>>
>> On 6/14/2016 2:47 PM, Canh Truong wrote:
>>> Hi Mahesh,
>>>
>>> I have created new test case for multiple threads. Please help check
>>> new patch in attachment.
>>>
>>> Thanks,
>>> Canh.
>>>
>>> -Original Message-
>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>> Sent: Tuesday, June 14, 2016 11:03 AM
>>> To: Canh Van Truong; vu.m.ngu...@dektech.com.au;
>>> lennart.l...@ericsson.com
>>> Cc: opensaf-devel@lists.sourceforge.net
>>> Subject: Re: [PATCH 1 of 1] log: fix issue with priority of messages
>>> adding to mailbox in the server[1396]
>>>
>>> Hi Canh Van Truong,
>>>
>>> I hope this patch will work for multiple threads doing
>>> saLogInitialize() , saLogStreamOpen_2()  and saLogFinalize()
>>> concurrently in a single process and reaches lga_use_count = 0 ,
>>> againg restarting
>>> saLogInitialize() , saLogStreamOpen_2()  and
>>> saLogFinalize()
>>> without process exist.
>>>
>>> If so let us have a  test case like for multiple threads doing
>>> saLogInitialize() , saLogStreamOpen_2()  and saLogFinalize()
>>> concurrently
>>>
>>> -AVM
>>>
>>>
>>> On 6/13/2016 12:37 PM, Canh Van Truong wrote:
>>>> osaf/libs/agents/saf/lga/lga_api.c |   3 ++-
>>>> osaf/libs/agents/saf/lga/lga_util.c |  21 -
>>>> tests/logsv/logtest.h   |   1 +
>>>> tests/logsv/tet_saLogStreamOpen_2.c |  29
>>>> +
>>>> 4 files changed, 44 insertions(+), 10 deletions(-)
>>>>
>>>>
>>>> Sometimes, Log service can handle LGSV_INITIALIZE_REQ before handle
>>>> LGSV_LGS_EVT_LGA_DOWN, although LGSV_LGS_EVT_LGA_DOWN was sent first
>>>> whenever
>>>> finalize() is call for last client. Because lgs can not distinguish
>>>> MDS address between new connection (initializing new client) and old
>>>> connection (finalizing last client before). This patch fixes to keep
>>>> MDS connection when last client finalized, and re-use it when next
>>> initialize() called.
>>>> diff --git a/osaf/libs/agents/saf/lga/lga_api.c
>>>> b/osaf/libs/agents/saf/lga/lga_api.c
>>>> --- a/osaf/libs/agents/saf/lga/lga_api.c
>>>> +++ b/osaf/libs/agents/saf/lga/lga_api.c
>>>> @@ -41,7 +41,8 @@
>>>> /* The main controle block */
>>>> lga_cb_t lga_cb = {
>>>> .cb_lock = PTHREAD_MUTEX_INITIALIZER,
>>>> -.lgs_state = LGS_START
>>>> +.lgs_state = LGS_START,
>>>> +.mds_hdl = 0
>>>> };
>>>>static bool is_well_know_stream(const char* dn) diff --git
>>>> a/osaf/libs/agents/saf/lga/lga_util.c
>>>> b/osaf/libs/agents/saf/lga/lga_util.c
>>>> --- a/osaf/libs/agents/saf/lga/lga_util.c
>>>> +++ b/osaf/libs/agents/saf/lga/lga_util.c
>>>> @@ -308,21 +308,17 @@ unsigned int lga_startup(lga_cb_t *cb)
>>>> osaf_mutex_lock_ordie(_lock);
>>>>TRACE_ENTER2("lga_use_

Re: [devel] [PATCH 1 of 1] log: fix issue with priority of messages adding to mailbox in the server[1396]

2016-06-20 Thread A V Mahesh
Hi Canh,

It will be good to send V2 patch with Lennart comments
and adding new test cases.

-AVM
On 6/21/2016 9:46 AM, A V Mahesh wrote:
> Hi Canh,
>
> Some how we were not able to open your attachment , so  my self written
>
> a multi threaded test case ( attached `thread_LogInitializeFinalize.c` 
> ) and reviewed/tested it is working fine.
>
> ACK  from me with following :
>
> - Please add such as attached  multi threaded test case to logtest, 
> before pushing
>
> - add # before ticket number in commit message  #1396
>
> -AVM
>
>
> On 6/14/2016 2:47 PM, Canh Truong wrote:
>> Hi Mahesh,
>>
>> I have created new test case for multiple threads. Please help check new
>> patch in attachment.
>>
>> Thanks,
>> Canh.
>>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Tuesday, June 14, 2016 11:03 AM
>> To: Canh Van Truong; vu.m.ngu...@dektech.com.au; 
>> lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1 of 1] log: fix issue with priority of messages 
>> adding
>> to mailbox in the server[1396]
>>
>> Hi Canh Van Truong,
>>
>> I hope this patch will work for multiple threads doing
>> saLogInitialize() , saLogStreamOpen_2()  and saLogFinalize() 
>> concurrently in
>> a single process and reaches lga_use_count = 0 , againg restarting
>> saLogInitialize() , saLogStreamOpen_2()  and
>> saLogFinalize()
>> without process exist.
>>
>> If so let us have a  test case like for multiple threads doing
>> saLogInitialize() , saLogStreamOpen_2()  and saLogFinalize() 
>> concurrently
>>
>> -AVM
>>
>>
>> On 6/13/2016 12:37 PM, Canh Van Truong wrote:
>>>osaf/libs/agents/saf/lga/lga_api.c |   3 ++-
>>>osaf/libs/agents/saf/lga/lga_util.c |  21 -
>>>tests/logsv/logtest.h   |   1 +
>>>tests/logsv/tet_saLogStreamOpen_2.c |  29 
>>> +
>>>4 files changed, 44 insertions(+), 10 deletions(-)
>>>
>>>
>>> Sometimes, Log service can handle LGSV_INITIALIZE_REQ before handle
>>> LGSV_LGS_EVT_LGA_DOWN, although LGSV_LGS_EVT_LGA_DOWN was sent first
>>> whenever
>>> finalize() is call for last client. Because lgs can not distinguish
>>> MDS address between new connection (initializing new client) and old
>>> connection (finalizing last client before). This patch fixes to keep
>>> MDS connection when last client finalized, and re-use it when next
>> initialize() called.
>>> diff --git a/osaf/libs/agents/saf/lga/lga_api.c
>>> b/osaf/libs/agents/saf/lga/lga_api.c
>>> --- a/osaf/libs/agents/saf/lga/lga_api.c
>>> +++ b/osaf/libs/agents/saf/lga/lga_api.c
>>> @@ -41,7 +41,8 @@
>>>/* The main controle block */
>>>lga_cb_t lga_cb = {
>>>.cb_lock = PTHREAD_MUTEX_INITIALIZER,
>>> -.lgs_state = LGS_START
>>> +.lgs_state = LGS_START,
>>> +.mds_hdl = 0
>>>};
>>>   static bool is_well_know_stream(const char* dn) diff --git
>>> a/osaf/libs/agents/saf/lga/lga_util.c
>>> b/osaf/libs/agents/saf/lga/lga_util.c
>>> --- a/osaf/libs/agents/saf/lga/lga_util.c
>>> +++ b/osaf/libs/agents/saf/lga/lga_util.c
>>> @@ -308,21 +308,17 @@ unsigned int lga_startup(lga_cb_t *cb)
>>>osaf_mutex_lock_ordie(_lock);
>>>   TRACE_ENTER2("lga_use_count: %u", lga_use_count);
>>> -if (lga_use_count > 0) {
>>> -/* Already created, just increment the use_count */
>>> -lga_use_count++;
>>> -goto done;
>>> -} else {
>>> +
>>> +if (cb->mds_hdl == 0) {
>>>if ((rc = ncs_agents_startup()) != NCSCC_RC_SUCCESS) {
>>>TRACE("ncs_agents_startup FAILED");
>>>goto done;
>>>}
>>>   if ((rc = lga_create()) != NCSCC_RC_SUCCESS) {
>>> +cb->mds_hdl = 0;
>>>ncs_agents_shutdown();
>>>goto done;
>>> -} else {
>>> -lga_use_count = 1;
>>>}
>>>   /* Agent has successfully been started including
>> communication @@
>>> -331,6 +327,9 @@ unsigned int lga_startup(lga_cb_t *cb)
>>>set_lga_state(LGA_NORMAL);
>>>}
>>>+/* Increase the use_count */
>>> +lga_

Re: [devel] [PATCH 1 of 1] log: fix issue with priority of messages adding to mailbox in the server[1396]

2016-06-20 Thread A V Mahesh

Hi Canh,

Some how we were not able to open your attachment , so  my self written

a multi threaded test case ( attached `thread_LogInitializeFinalize.c` ) 
and reviewed/tested it is working fine.


ACK  from me with following :

- Please add such as attached  multi threaded test case to logtest, 
before pushing


- add # before ticket number in commit message  #1396

-AVM


On 6/14/2016 2:47 PM, Canh Truong wrote:

Hi Mahesh,

I have created new test case for multiple threads. Please help check new
patch in attachment.

Thanks,
Canh.

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com]
Sent: Tuesday, June 14, 2016 11:03 AM
To: Canh Van Truong; vu.m.ngu...@dektech.com.au; lennart.l...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1 of 1] log: fix issue with priority of messages adding
to mailbox in the server[1396]

Hi Canh Van Truong,

I hope this patch will work for multiple threads doing
saLogInitialize() , saLogStreamOpen_2()  and saLogFinalize() concurrently in
a single process and reaches lga_use_count = 0 , againg restarting
saLogInitialize() , saLogStreamOpen_2()  and
saLogFinalize()
without process exist.

If so let us have a  test case like for multiple threads doing
saLogInitialize() , saLogStreamOpen_2()  and saLogFinalize() concurrently

-AVM


On 6/13/2016 12:37 PM, Canh Van Truong wrote:

   osaf/libs/agents/saf/lga/lga_api.c  |   3 ++-
   osaf/libs/agents/saf/lga/lga_util.c |  21 -
   tests/logsv/logtest.h   |   1 +
   tests/logsv/tet_saLogStreamOpen_2.c |  29 +
   4 files changed, 44 insertions(+), 10 deletions(-)


Sometimes, Log service can handle LGSV_INITIALIZE_REQ before handle
LGSV_LGS_EVT_LGA_DOWN, although LGSV_LGS_EVT_LGA_DOWN was sent first
whenever
finalize() is call for last client. Because lgs can not distinguish
MDS address between new connection (initializing new client) and old
connection (finalizing last client before). This patch fixes to keep
MDS connection when last client finalized, and re-use it when next

initialize() called.

diff --git a/osaf/libs/agents/saf/lga/lga_api.c
b/osaf/libs/agents/saf/lga/lga_api.c
--- a/osaf/libs/agents/saf/lga/lga_api.c
+++ b/osaf/libs/agents/saf/lga/lga_api.c
@@ -41,7 +41,8 @@
   /* The main controle block */
   lga_cb_t lga_cb = {
.cb_lock = PTHREAD_MUTEX_INITIALIZER,
-   .lgs_state = LGS_START
+   .lgs_state = LGS_START,
+   .mds_hdl = 0
   };
   
   static bool is_well_know_stream(const char* dn) diff --git

a/osaf/libs/agents/saf/lga/lga_util.c
b/osaf/libs/agents/saf/lga/lga_util.c
--- a/osaf/libs/agents/saf/lga/lga_util.c
+++ b/osaf/libs/agents/saf/lga/lga_util.c
@@ -308,21 +308,17 @@ unsigned int lga_startup(lga_cb_t *cb)
osaf_mutex_lock_ordie(_lock);
   
   	TRACE_ENTER2("lga_use_count: %u", lga_use_count);

-   if (lga_use_count > 0) {
-   /* Already created, just increment the use_count */
-   lga_use_count++;
-   goto done;
-   } else {
+
+   if (cb->mds_hdl == 0) {
if ((rc = ncs_agents_startup()) != NCSCC_RC_SUCCESS) {
TRACE("ncs_agents_startup FAILED");
goto done;
}
   
   		if ((rc = lga_create()) != NCSCC_RC_SUCCESS) {

+   cb->mds_hdl = 0;
ncs_agents_shutdown();
goto done;
-   } else {
-   lga_use_count = 1;
}
   
   		/* Agent has successfully been started including

communication @@

-331,6 +327,9 @@ unsigned int lga_startup(lga_cb_t *cb)
set_lga_state(LGA_NORMAL);
}
   
+	/* Increase the use_count */

+   lga_use_count++;
+
done:
osaf_mutex_unlock_ordie(_lock);
   
@@ -361,8 +360,12 @@ unsigned int lga_shutdown_after_last_cli

/* Users still exist, just decrement the use count */
lga_use_count--;
} else if (lga_use_count == 1) {
-   lga_destroy();
-   rc = ncs_agents_shutdown();
+   /*
+* Disable MDS_UNINSTALL and ncs agent shutdown to keep MDS

connection.

+* Fix ticket 1396. Msg NCSMDS_DOWN and Initialize are out

of order in Mbx.

+*/
+   /* lga_destroy(); */
+   /* rc = ncs_agents_shutdown(); */
lga_use_count = 0;
}
   
diff --git a/tests/logsv/logtest.h b/tests/logsv/logtest.h

--- a/tests/logsv/logtest.h
+++ b/tests/logsv/logtest.h
@@ -27,6 +27,7 @@
   #include 
   #include 
   #include 
+#include 
   
   #include 

   #include 
diff --git a/tests/logsv/tet_saLogStreamOpen_2.c
b/tests/logsv/tet_saLogStreamOpen_2.c
--- a/tests/logsv/tet_saLogStreamOpen_2.c
+++ b/tests/logsv/tet_saLogStreamOpen_2.c
@@ -704,6 +704,34 @@ done:
}
   }
   
+/*

+ * Ticket 1396
+ * Verify that saLogInitialize() 

Re: [devel] [PATCH 1 of 1] cpnd: To reject creating section which has id length longer than MAX_SEC_ID_LEN [#1667]

2016-06-19 Thread A V Mahesh
Hi  Hoang,

No issue , for now we can push this for to over come current bug that 
you are facing .

We can address all the  LONG DN related issue including Section ID length.


Object Class : Table 2 DN Formats for Objects of Checkpoint Service 
Classes (SAI-AIS-CKPT-B.02.02 spec)

1) SaCkptCheckpoint -- "safCkpt=...,* "

2) SaCkptReplica -- "safReplica=...,safCkpt=...,* "



So ACK form me not tested.

-AVM


On 6/14/2016 2:40 PM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your information.
> It seem I have lack of information when receiving this ticket from Nhat
> Pham.
> We will consider more about this.
>
> Sincerely,
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Tuesday, June 14, 2016 3:55 PM
> To: Hoang Vo <hoang.m...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpnd: To reject creating section which has id
> length longer than MAX_SEC_ID_LEN [#1667]
>
> Hi Hoang Vo,
>
> This patch is already published by Nhat Pham , and
>
> it is under review, I also provided few comments ( attached ) , please
> check.
>
> -AVM
>
>
> On 6/14/2016 1:48 PM, Hoang Vo wrote:
>>osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
>>1 files changed, 11 insertions(+), 0 deletions(-)
>>
>>
>> When a section with id size greater than MAX_SEC_ID_LEN [50], the cpnd
> restarts with core dump.
>> This fixing validates id size before creating section.
>>
>> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
>> @@ -2167,6 +2167,7 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
>>  CPSV_CKPT_DATA *ckpt_data = NULL;
>>  SaTimeT now, duration;
>>  int64_t time_stamp, giga_sec, result;
>> +uint16_t sec_id_len =
>> +evt->info.sec_creatReq.sec_attri.sectionId->idLen;
>>
>>  TRACE_ENTER();
>>  memset(_evt, '\0', sizeof(CPSV_EVT)); @@ -2205,6 +2206,16 @@
>> static uint32_t cpnd_evt_proc_ckpt_sect_
>>  TRACE_4("cpnd ckpt sect create failed for
> ckpt_id:%llx,return value:%d",evt->info.sec_creatReq.ckpt_id,
> SA_AIS_ERR_INVALID_PARAM);
>>  goto agent_rsp;
>>  }
>> +
>> +if (sec_id_len >= MAX_SEC_ID_LEN) {
>> +send_evt.type = CPSV_EVT_TYPE_CPA;
>> +send_evt.info.cpa.type = CPA_EVT_ND2A_SEC_CREATE_RSP;
>> +send_evt.info.cpa.info.sec_creat_rsp.error =
> SA_AIS_ERR_INVALID_PARAM;
>> +LOG_NO("cpnd ckpt sect create failed for ckpt_id:%llx,return
> value:%d - sec_id_len:%d over supported limit %d",
>> +evt->info.sec_creatReq.ckpt_id,
> SA_AIS_ERR_INVALID_PARAM, sec_id_len, MAX_SEC_ID_LEN);
>> +goto agent_rsp;
>> +}
>> +
>>  if (evt->info.sec_creatReq.sec_attri.sectionId->id == NULL &&
>>  evt->info.sec_creatReq.sec_attri.sectionId->idLen == 0) {
>>  if (cp_node->create_attrib.maxSections > 1) {
>


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] cpnd: To reject creating section which has id length longer than MAX_SEC_ID_LEN [#1667]

2016-06-14 Thread A V Mahesh

Hi Hoang Vo,

This patch is already published by Nhat Pham , and

it is under review, I also provided few comments ( attached ) , please 
check.


-AVM


On 6/14/2016 1:48 PM, Hoang Vo wrote:

  osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
  1 files changed, 11 insertions(+), 0 deletions(-)


When a section with id size greater than MAX_SEC_ID_LEN [50], the cpnd restarts 
with core dump.
This fixing validates id size before creating section.

diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
--- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
+++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
@@ -2167,6 +2167,7 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
CPSV_CKPT_DATA *ckpt_data = NULL;
SaTimeT now, duration;
int64_t time_stamp, giga_sec, result;
+   uint16_t sec_id_len = evt->info.sec_creatReq.sec_attri.sectionId->idLen;
  
  	TRACE_ENTER();

memset(_evt, '\0', sizeof(CPSV_EVT));
@@ -2205,6 +2206,16 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
TRACE_4("cpnd ckpt sect create failed for ckpt_id:%llx,return 
value:%d",evt->info.sec_creatReq.ckpt_id, SA_AIS_ERR_INVALID_PARAM);
goto agent_rsp;
}
+
+   if (sec_id_len >= MAX_SEC_ID_LEN) {
+   send_evt.type = CPSV_EVT_TYPE_CPA;
+   send_evt.info.cpa.type = CPA_EVT_ND2A_SEC_CREATE_RSP;
+   send_evt.info.cpa.info.sec_creat_rsp.error = 
SA_AIS_ERR_INVALID_PARAM;
+   LOG_NO("cpnd ckpt sect create failed for ckpt_id:%llx,return 
value:%d - sec_id_len:%d over supported limit %d",
+   evt->info.sec_creatReq.ckpt_id, 
SA_AIS_ERR_INVALID_PARAM, sec_id_len, MAX_SEC_ID_LEN);
+   goto agent_rsp;
+   }
+
if (evt->info.sec_creatReq.sec_attri.sectionId->id == NULL &&
evt->info.sec_creatReq.sec_attri.sectionId->idLen == 0) {
if (cp_node->create_attrib.maxSections > 1) {


--- Begin Message ---

Hi Nhat Pham,

>>this macro was defined long time ago.

Any we are planning to have LONG DN for CKpt as well,

so let us consider how much max size we can accommodate for section as 
well  ( considering   #1574: CKPT support for Long DN)


If required re-send the patch.

-AVM



On 6/6/2016 1:20 PM, Nhat Pham wrote:

Hi Mahesh,

I'm not sure about this.
Checking the history, this macro was defined long time ago.

changeset:   619:2d68497895b2
user:Jonathan Fournier <jonathan.fourn...@windriver.com>
date:Thu Aug 06 00:59:42 2009 -0400
summary: build: re-organize the source tree layout to fit the build
dependencies

Best regards,
Nhat Pham

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com]
Sent: Monday, June 6, 2016 11:24 AM
To: Nhat Pham <nhat.p...@dektech.com.au>; anders.wid...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 2 of 2] cpnd: To reject creating section which has id
length longer than MAX_SIZE(30) [#1667]

Hi Nhat Pham,

Which was forcing us to have MAX_SIZE(30) limit ?

-AVM

On 6/6/2016 9:19 AM, Nhat Pham wrote:

   osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
   1 files changed, 11 insertions(+), 0 deletions(-)


diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
--- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
+++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
@@ -2151,6 +2151,7 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
CPSV_CKPT_DATA *ckpt_data = NULL;
SaTimeT now, duration;
int64_t time_stamp, giga_sec, result;
+   uint16_t sec_id_len =
+evt->info.sec_creatReq.sec_attri.sectionId->idLen;

TRACE_ENTER();
memset(_evt, '\0', sizeof(CPSV_EVT)); @@ -2189,6 +2190,16 @@
static uint32_t cpnd_evt_proc_ckpt_sect_
TRACE_4("cpnd ckpt sect create failed for

ckpt_id:%llx,return value:%d",evt->info.sec_creatReq.ckpt_id,
SA_AIS_ERR_INVALID_PARAM);

goto agent_rsp;
}
+
+   if (sec_id_len >= MAX_SIZE) {
+   send_evt.type = CPSV_EVT_TYPE_CPA;
+   send_evt.info.cpa.type = CPA_EVT_ND2A_SEC_CREATE_RSP;
+   send_evt.info.cpa.info.sec_creat_rsp.error =

SA_AIS_ERR_INVALID_PARAM;

+   LOG_NO("cpnd ckpt sect create failed for ckpt_id:%llx,return

value:%d - sec_id_len:%d over supported limit %d",

+   evt->info.sec_creatReq.ckpt_id,

SA_AIS_ERR_INVALID_PARAM, sec_id_len, MAX_SIZE);

+   goto agent_rsp;
+   }
+
if (evt->info.sec_creatReq.sec_attri.sectionId->id == NULL &&
evt->info.sec_creatReq.sec_attri.sectionId->idLen == 0) {
if (cp_node->create_attrib.maxSections > 1) {




--- End Message ---
-

Re: [devel] [PATCH 1 of 1] ckpt: fix cppcheck warning [#1874]

2016-06-13 Thread A V Mahesh
Hi Hoang Vo,

ACK , Not tested.

By the way which GCC/tool given these warnings ?

-AVM

On 6/13/2016 9:20 AM, Hoang Vo wrote:
>   osaf/services/saf/cpsv/cpd/cpd_db.c |   8 ++---
>   osaf/services/saf/cpsv/cpd/cpd_evt.c|   4 +-
>   osaf/services/saf/cpsv/cpd/cpd_imm.c|   2 +-
>   osaf/services/saf/cpsv/cpd/cpd_tmr.c|   2 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c  |  49 
> 
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c |   2 +-
>   6 files changed, 32 insertions(+), 35 deletions(-)
>
>
> This enhancement fix following warning results from cppcheck 1.74:
> Either the condition is redundant or there is possible null pointer 
> dereference
>
> This enhancement does not fix following warnings when they are not problems:
> Possible null pointer dereference
> Style and performance warnings
>
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_db.c 
> b/osaf/services/saf/cpsv/cpd/cpd_db.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_db.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_db.c
> @@ -843,12 +843,10 @@ uint32_t cpd_cpnd_info_node_delete(CPD_C
>   }
>   
>   /* Free the Client Node */
> - if (cpnd_info_node) {
> - if (cpnd_info_node->cpnd_ret_timer.uarg)
> - ncshm_destroy_hdl(NCS_SERVICE_ID_CPD, 
> cpnd_info_node->cpnd_ret_timer.uarg);
> + if (cpnd_info_node->cpnd_ret_timer.uarg)
> + ncshm_destroy_hdl(NCS_SERVICE_ID_CPD, 
> cpnd_info_node->cpnd_ret_timer.uarg);
>   
> - m_MMGR_FREE_CPD_CPND_INFO_NODE(cpnd_info_node);
> - }
> + m_MMGR_FREE_CPD_CPND_INFO_NODE(cpnd_info_node);
>   
>   return rc;
>   
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
> b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
> @@ -1439,7 +1439,7 @@ static uint32_t cpd_evt_proc_mds_evt(CPD
>   /* No Checkpoints on this node, */
>   TRACE_LEAVE();
>   return NCSCC_RC_SUCCESS;
> - } else if (node_info && 
> (node_info->ckpt_ref_list == NULL)) {
> + } else if (node_info->ckpt_ref_list == NULL) {
>   cpd_cpnd_info_node_delete(cb, 
> node_info);
>   TRACE_LEAVE();
>   return NCSCC_RC_SUCCESS;
> @@ -1453,7 +1453,7 @@ static uint32_t cpd_evt_proc_mds_evt(CPD
>   /* No Checkpoints on this node, */
>   return NCSCC_RC_SUCCESS;
>   }
> - else if (node_info && (node_info->ckpt_ref_list 
> == NULL)) {
> + else if (node_info->ckpt_ref_list == NULL) {
>   cpd_cpnd_info_node_delete(cb, 
> node_info);
>   TRACE_LEAVE();
>   return NCSCC_RC_SUCCESS;
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_imm.c 
> b/osaf/services/saf/cpsv/cpd/cpd_imm.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_imm.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_imm.c
> @@ -904,7 +904,7 @@ SaUint32T cpd_get_scAbsenceAllowed_attr(
>   
>   /* Handle the global scAbsenceAllowed_flag */
>   attribute = attributes[0];
> - TRACE("%s attrName \"%s\"",__FUNCTION__,attribute->attrName);
> + TRACE("%s attrName 
> \"%s\"",__FUNCTION__,attribute?attribute->attrName:"");
>   if ((attribute != NULL) && (attribute->attrValuesNumber != 0)) {
>   /* scAbsenceAllowed has value. Get the value */
>   value = attribute->attrValues[0];
> diff --git a/osaf/services/saf/cpsv/cpd/cpd_tmr.c 
> b/osaf/services/saf/cpsv/cpd/cpd_tmr.c
> --- a/osaf/services/saf/cpsv/cpd/cpd_tmr.c
> +++ b/osaf/services/saf/cpsv/cpd/cpd_tmr.c
> @@ -42,7 +42,7 @@ void cpd_timer_expiry(NCSCONTEXT uarg)
>   CPSV_EVT *evt = NULL;
>   uint32_t cpd_hdl = m_CPD_GET_CB_HDL;
>   
> - TRACE("cpd_timer_expiry(uarg=%p, type=%u)", uarg, tmr->type);
> + TRACE("cpd_timer_expiry(uarg=%p, type=%u)", uarg, tmr ? tmr->type : 0);
>   
>   /* post a message to the corresponding component */
>   if ((cb = (CPD_CB *)ncshm_take_hdl(NCS_SERVICE_ID_CPD, cpd_hdl)) == 
> NULL)
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> @@ -753,7 +753,7 @@ static uint32_t cpnd_evt_proc_ckpt_open(
>   send_evt.info.cpa.info.openRsp.error = SA_AIS_ERR_NO_MEMORY;
>   goto agent_rsp;
>   }
> - if (out_evt && out_evt->info.cpnd.info.ckpt_info.error != SA_AIS_OK) {
> + if (out_evt->info.cpnd.info.ckpt_info.error != SA_AIS_OK) {
>   send_evt.info.cpa.info.openRsp.error = 
> 

Re: [devel] [PATCH 1 of 1] log: fix fail to recovery well-known streams [#1847]

2016-06-13 Thread A V Mahesh
Hi Vu,

ACK, tested no new issue found.

-AVM


On 6/13/2016 11:21 AM, Vu Minh Nguyen wrote:
> Hi Mahesh,
>
> Have you had time to look at this? Thanks.
>
> Regards, Vu
>
>> -Original Message-
>> From: Lennart Lund [mailto:lennart.l...@ericsson.com]
>> Sent: Thursday, June 9, 2016 6:51 PM
>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'A V Mahesh'
>> <mahesh.va...@oracle.com>
>> Cc: opensaf-devel@lists.sourceforge.net; Jorge Pacheco Garcia
>> <jorge.pacheco.gar...@ericsson.com>
>> Subject: RE: [PATCH 1 of 1] log: fix fail to recovery well-known streams
>> [#1847]
>>
>> Hi Vu
>>
>> Ack. I have run legacy and resilience tests (except suite 11)
>>
>> Thanks
>> Lennart
>>
>>> -Original Message-
>>> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
>>> Sent: den 9 juni 2016 06:41
>>> To: Lennart Lund <lennart.l...@ericsson.com>; 'A V Mahesh'
>>> <mahesh.va...@oracle.com>
>>> Cc: opensaf-devel@lists.sourceforge.net; Jorge Pacheco Garcia
>>> <jorge.pacheco.gar...@ericsson.com>
>>> Subject: RE: [PATCH 1 of 1] log: fix fail to recovery well-known
>>> streams [#1847]
>>>
>>> Hi all,
>>>
>>> There is minor issue in test suite #9 - ticket #1865
>>> [https://sourceforge.net/p/opensaf/tickets/1865/]
>>> I included the fix in this patch.
>>>
>>> Please have a look and give me your comments. Thanks
>>>
>>> Regards, Vu
>>>
>>>> -Original Message-
>>>> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
>>>> Sent: Wednesday, June 8, 2016 2:06 PM
>>>> To: 'Lennart Lund' <lennart.l...@ericsson.com>; 'A V Mahesh'
>>>> <mahesh.va...@oracle.com>
>>>> Cc: 'opensaf-devel@lists.sourceforge.net' >>> de...@lists.sourceforge.net>; 'Jorge Pacheco Garcia'
>>>> <jorge.pacheco.gar...@ericsson.com>
>>>> Subject: RE: [PATCH 1 of 1] log: fix fail to recovery well-known
>>>> streams [#1847]
>>>>
>>>> Hi all,
>>>>
>>>> Please see the updates from attached file.
>>>>
>>>> If you have any other comments, please let me know. Thanks.
>>>>
>>>> Regards, Vu
>>>>
>>>>> -Original Message-
>>>>> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
>>>>> Sent: Tuesday, June 7, 2016 2:50 PM
>>>>> To: 'Lennart Lund' <lennart.l...@ericsson.com>; 'A V Mahesh'
>>>>> <mahesh.va...@oracle.com>
>>>>> Cc: 'opensaf-devel@lists.sourceforge.net' >>>> de...@lists.sourceforge.net>; 'Jorge Pacheco Garcia'
>>>>> <jorge.pacheco.gar...@ericsson.com>
>>>>> Subject: RE: [PATCH 1 of 1] log: fix fail to recovery well-known
>>>>> streams [#1847]
>>>>>
>>>>> Hi Lennart,
>>>>>
>>>>> Please see my comments inline [Vu].
>>>>>
>>>>> Regards, Vu
>>>>>
>>>>>> -Original Message-
>>>>>> From: Lennart Lund [mailto:lennart.l...@ericsson.com]
>>>>>> Sent: Monday, May 30, 2016 9:34 PM
>>>>>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; A V Mahesh
>>>>>> <mahesh.va...@oracle.com>
>>>>>> Cc: opensaf-devel@lists.sourceforge.net; Lennart Lund
>>>>>> <lennart.l...@ericsson.com>; Jorge Pacheco Garcia
>>>>>> <jorge.pacheco.gar...@ericsson.com>
>>>>>> Subject: RE: [PATCH 1 of 1] log: fix fail to recovery well-known
>>>>>> streams [#1847]
>>>>>>
>>>>>> Hi Vu
>>>>>>
>>>>>> The problem described in the ticket is actually only that the
>>>>>> following messages are printed in the syslog:
>>>>>>
>>>>>> May 23 14:28:34 REG-S1 osaflogd[8850]: NO
>>> lgs_imm_init_configStreams:
>>>>>> log_stream_open_file_restore Fail May 23 14:28:34 REG-S1
>>>> osaflogd[8850]:
>>>>>> NO lgs_imm_init_configStreams: log_stream_open_file_restore Fail
>>> May
>>>>>> 23
>>>>>> 14:28:34 REG-S1 osaflogd[8850]: NO lgs_imm_init_configStreams:
>>>>>> log_stream_open_file_restore Fail
>>>>>>
>>>>>> This is not error messages. It only mea

Re: [devel] [PATCH 1 of 1] nid: Add support for multiple tipc bearers to configure_tipc [#1862]

2016-06-09 Thread A V Mahesh
ACK , Tested .

-AVM


On 6/9/2016 11:24 AM, Hung Nguyen wrote:
> Hi Mahesh,
>
> The script compares ETH_NAME (which is comma delimited) with output from 
> "tipc-config -b" (which is LF delimited).
> That only works when using single bearer.
> The script will fail in case of multiple bearers.
>
>
> configured_bearer=`tipc-config -b | grep -v Bearer | cut -d: -f2` <== LF 
> delimited
> opensaf_bearer=$ETH_NAME  <== comma 
> delimited
> if [ $configured_bearer != $opensaf_bearer ]  <== will 
> not work in case of multiple bearers
>
>
> I agree that the commit message is misleading, will change them when pushing 
> if the patch is ack'ed.
>
>
> BR,
> Hung Nguyen - DEK Technologies
>
> 
> From: Mahesh vallamahesh.va...@oracle.com
> Sent: Thursday, June 09, 2016 12:24PM
> To: Opensaf-devel
>  opensaf-devel@lists.sourceforge.net
> Cc:
>  
> Subject: Re: [devel] [PATCH 1 of 1] nid: Add support for multiple tipc 
> bearers to configure_tipc [#1862]
>
>
> Hi  Hung Nguyen,
>
>>> Add support for multiple tipc bearers to configure_tipc.
> This support already exist and we have been configuring & using
> multiple tipc bearers, it works with
>
> ==
> /etc/opensaf/nid.conf
>
> # This is valid when above MDS_TRANSPORT is set to TIPC and 
> OPENSAF_MANAGE_TIPC is set to "yes" ,
> # values supported is the network interface name, e.g. eth3
>
> TIPC_ETH_IF=eth0,eth1
> ==
>
> I did see  any change except `sort` list , we need to verify
> implication of adding sort for the following configuration , we will provide
> our observation , please hold.
>
> NODE-1
> ===
> eth0  192.168.56.101
>  
> eth1  10.176.177.138
> 
> with /etc/opensaf/nid.conf - TIPC_ETH_IF=eth0,eth1
> ===
> 
> 
> NODE-2
> ===
> eth0  10.176.177.139
>
> eth1  192.168.56.102
> 
> with /etc/opensaf/nid.conf - TIPC_ETH_IF=eth0,eth1
>===
>
> -AVM
>
> On 6/9/2016 9:49 AM, Hung Nguyen wrote:
>>osaf/services/infrastructure/nid/scripts/configure_tipc.in |  12 
>> +++-
>>1 files changed, 3 insertions(+), 9 deletions(-)
>>
>>
>> Add support for multiple tipc bearers to configure_tipc.
>> Also remove the check for CORE_ID.
>>
>> diff --git a/osaf/services/infrastructure/nid/scripts/configure_tipc.in 
>> b/osaf/services/infrastructure/nid/scripts/configure_tipc.in
>> --- a/osaf/services/infrastructure/nid/scripts/configure_tipc.in
>> +++ b/osaf/services/infrastructure/nid/scripts/configure_tipc.in
>> @@ -276,16 +276,10 @@ else
>>logger -t opensaf -s "TIPC network ID not configured to OpenSAF 
>> requirements, exiting..."
>>exit 1
>>fi
>> -configured_net_id=`tipc-config -netid | cut -d: -f2`
>> -opensaf_net_id=$CORE_ID
>> -if [ $configured_net_id != $opensaf_net_id ]; then
>> -logger -t opensaf -s "TIPC network ID not configured to OpenSAF 
>> requirements, exiting..."
>> -exit 1
>> -fi
>>
>> -configured_bearer=`tipc-config -b | grep -v Bearer | cut -d: -f2`
>> -opensaf_bearer=$ETH_NAME
>> -if [ $configured_bearer != $opensaf_bearer ]; then
>> +configured_bearers=$(${tipc_config} -b | grep -v Bearer | cut -d: -f2 | 
>> sort)
>> +opensaf_bearers=$(echo "$ETH_NAME" | tr "," "\n" | sort)
>> +if [ "$configured_bearers" != "$opensaf_bearers" ]; then
>>logger -t opensaf -s "TIPC bearer not configured to OpenSAF 
>> requirements, exiting..."
>>exit 1
>>fi
>>
>> --
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>> planning reports.https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>> ___
>> Opensaf-devel mailing list
>> Opensaf-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and 

Re: [devel] [PATCH 1 of 1] nid: Add support for multiple tipc bearers to configure_tipc [#1862]

2016-06-08 Thread A V Mahesh
Hi  Hung Nguyen,

>>Add support for multiple tipc bearers to configure_tipc.

This support already exist and we have been configuring & using
multiple tipc bearers, it works with

==
/etc/opensaf/nid.conf

# This is valid when above MDS_TRANSPORT is set to TIPC and OPENSAF_MANAGE_TIPC 
is set to "yes" ,
# values supported is the network interface name, e.g. eth3

TIPC_ETH_IF=eth0,eth1
==

I did see  any change except `sort` list , we need to verify
implication of adding sort for the following configuration , we will provide
our observation , please hold.

NODE-1
===
eth0  192.168.56.101

eth1  10.176.177.138
   
with /etc/opensaf/nid.conf - TIPC_ETH_IF=eth0,eth1
===
   
   
NODE-2
===
eth0  10.176.177.139

eth1  192.168.56.102
   
with /etc/opensaf/nid.conf - TIPC_ETH_IF=eth0,eth1
  ===

-AVM

On 6/9/2016 9:49 AM, Hung Nguyen wrote:
>   osaf/services/infrastructure/nid/scripts/configure_tipc.in |  12 
> +++-
>   1 files changed, 3 insertions(+), 9 deletions(-)
>
>
> Add support for multiple tipc bearers to configure_tipc.
> Also remove the check for CORE_ID.
>
> diff --git a/osaf/services/infrastructure/nid/scripts/configure_tipc.in 
> b/osaf/services/infrastructure/nid/scripts/configure_tipc.in
> --- a/osaf/services/infrastructure/nid/scripts/configure_tipc.in
> +++ b/osaf/services/infrastructure/nid/scripts/configure_tipc.in
> @@ -276,16 +276,10 @@ else
>   logger -t opensaf -s "TIPC network ID not configured to OpenSAF 
> requirements, exiting..."
>   exit 1
>   fi
> -configured_net_id=`tipc-config -netid | cut -d: -f2`
> -opensaf_net_id=$CORE_ID
> -if [ $configured_net_id != $opensaf_net_id ]; then
> -logger -t opensaf -s "TIPC network ID not configured to OpenSAF 
> requirements, exiting..."
> -exit 1
> -fi
>   
> -configured_bearer=`tipc-config -b | grep -v Bearer | cut -d: -f2`
> -opensaf_bearer=$ETH_NAME
> -if [ $configured_bearer != $opensaf_bearer ]; then
> +configured_bearers=$(${tipc_config} -b | grep -v Bearer | cut -d: -f2 | 
> sort)
> +opensaf_bearers=$(echo "$ETH_NAME" | tr "," "\n" | sort)
> +if [ "$configured_bearers" != "$opensaf_bearers" ]; then
>   logger -t opensaf -s "TIPC bearer not configured to OpenSAF 
> requirements, exiting..."
>   exit 1
>   fi
>
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 2 of 2] cpnd: To reject creating section which has id length longer than MAX_SIZE(30) [#1667]

2016-06-05 Thread A V Mahesh
Hi Nhat Pham,

Which was forcing us to have MAX_SIZE(30) limit ?

-AVM

On 6/6/2016 9:19 AM, Nhat Pham wrote:
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
>   1 files changed, 11 insertions(+), 0 deletions(-)
>
>
> diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
> b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> --- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> +++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
> @@ -2151,6 +2151,7 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
>   CPSV_CKPT_DATA *ckpt_data = NULL;
>   SaTimeT now, duration;
>   int64_t time_stamp, giga_sec, result;
> + uint16_t sec_id_len = evt->info.sec_creatReq.sec_attri.sectionId->idLen;
>   
>   TRACE_ENTER();
>   memset(_evt, '\0', sizeof(CPSV_EVT));
> @@ -2189,6 +2190,16 @@ static uint32_t cpnd_evt_proc_ckpt_sect_
>   TRACE_4("cpnd ckpt sect create failed for ckpt_id:%llx,return 
> value:%d",evt->info.sec_creatReq.ckpt_id, SA_AIS_ERR_INVALID_PARAM);
>   goto agent_rsp;
>   }
> +
> + if (sec_id_len >= MAX_SIZE) {
> + send_evt.type = CPSV_EVT_TYPE_CPA;
> + send_evt.info.cpa.type = CPA_EVT_ND2A_SEC_CREATE_RSP;
> + send_evt.info.cpa.info.sec_creat_rsp.error = 
> SA_AIS_ERR_INVALID_PARAM;
> + LOG_NO("cpnd ckpt sect create failed for ckpt_id:%llx,return 
> value:%d - sec_id_len:%d over supported limit %d",
> + evt->info.sec_creatReq.ckpt_id, 
> SA_AIS_ERR_INVALID_PARAM, sec_id_len, MAX_SIZE);
> + goto agent_rsp;
> + }
> +
>   if (evt->info.sec_creatReq.sec_attri.sectionId->id == NULL &&
>   evt->info.sec_creatReq.sec_attri.sectionId->idLen == 0) {
>   if (cp_node->create_attrib.maxSections > 1) {


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 2] Review Request for cpsv: cpnd restart with coredump when creating a section with id size greater than 30 [#1667]

2016-06-05 Thread A V Mahesh
Hi Nhat Pham,

Some how this # 1667 review was not in devel list mails

I am finding an IMM ticket with `[devel] [PATCH 1 of 1] imm: Release 
adminowner of IMM object for immoitest [#1667]`

Can you please resend


-AVM



On 6/3/2016 5:50 AM, Nhat Pham wrote:
> Hi Mahesh,
>
> Could you please help to review this? Thanks.
>
> Best regards,
> Nhat Pham
>
> -Original Message-
> From: Nhat Pham [mailto:nhat.p...@dektech.com.au]
> Sent: Wednesday, April 13, 2016 4:27 PM
> To: mahesh.va...@oracle.com; anders.wid...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [devel] [PATCH 0 of 2] Review Request for cpsv: cpnd restart with
> coredump when creating a section with id size greater than 30 [#1667]
>
> Summary: cpsv: cpnd restart with coredump when creating a section with id
> size greater than 30 [#1667] Review request for Trac Ticket(s): #1667 Peer
> Reviewer(s): mahesh.va...@oracle.com; anders.wid...@ericsson.com Pull
> request to: mahesh.va...@oracle.com Affected branch(es): default, 5.0, and
> 4.7 Development branch: default
>
> 
> 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 0e0fc6a3c00145a9beaa8558c7a6251deb9adf99
> Author:   Nhat Pham 
> Date: Thu, 07 Apr 2016 15:45:25 +0700
>
>   ckpt: To add a new test case to verify creating section with id
> lenght longer than MAX_SIZE(30)
>
> changeset 7cc939f0e111e649ee7a06b5207069421a0335d7
> Author:   Nhat Pham 
> Date: Thu, 07 Apr 2016 15:45:50 +0700
>
>   cpnd: To reject creating section which has id length longer than
> MAX_SIZE(30)
>
>
> Complete diffstat:
> --
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  11 +++
>   tests/cpsv/test_cpa.c  |  35
> ++-
>   tests/cpsv/test_cpa_util.c |   2 ++
>   tests/cpsv/test_cpsv.h |   1 +
>   tests/cpsv/test_cpsv_conf.h|   2 ++
>   5 files changed, 50 insertions(+), 1 deletions(-)
>
>
> Testing Commands:
> -
> ckpttest 11 16
>
> Testing, Expected Results:
> --
> The test case passes.
>
> Conditions of Submission:
> -
> -
>
> 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 

Re: [devel] [PATCH 1 of 1] cpsv: add message tracing for headless feature [#1852]

2016-05-26 Thread A V Mahesh
ACK

NOT tested

-AVM

On 5/27/2016 8:20 AM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/cpsv_evt.c |  20 
>   1 files changed, 20 insertions(+), 0 deletions(-)
>
>
> This enhancement adds trace log for following messages:
> CPD_EVT_ND2D_CKPT_INFO_UPDATE
> CPND_EVT_D2ND_CKPT_INFO_UPDATE_ACK
> CPA_EVT_ND2A_CKPT_DESTROY
>
> diff --git a/osaf/libs/common/cpsv/cpsv_evt.c 
> b/osaf/libs/common/cpsv/cpsv_evt.c
> --- a/osaf/libs/common/cpsv/cpsv_evt.c
> +++ b/osaf/libs/common/cpsv/cpsv_evt.c
> @@ -616,6 +616,10 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   snprintf(o_evt_str, len, 
> "CPND_EVT_A2ND_ARRIVAL_CB_UNREG(hdl=%llu)",
>   evt->info.cpnd.info.arr_ntfy.client_hdl);
>   break;
> + case CPND_EVT_D2ND_CKPT_INFO_UPDATE_ACK:
> + snprintf(o_evt_str, len, 
> "CPND_EVT_D2ND_CKPT_INFO_UPDATE_ACK(err=%u)",
> + evt->info.cpnd.info.ckpt_info_update_ack.error);
> + break;
>   default:
>   snprintf(o_evt_str, len, "INVALID_CPND_TYPE(type = 
> %d)", evt->info.cpnd.type);
>   break;
> @@ -772,6 +776,12 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   info->ckpt_id, 
> m_NCS_NODE_ID_FROM_MDS_DEST(info->mds_dest));
>   break;
>   }
> + case CPA_EVT_ND2A_CKPT_DESTROY:
> + {
> + CPSV_CKPT_ID_INFO *info = 
> >info.cpa.info.ckpt_destroy;
> + snprintf(o_evt_str, len, "[%llu] 
> CPA_EVT_ND2A_CKPT_DESTROY", info->ckpt_id);
> + break;
> + }
>   default:
>   snprintf(o_evt_str, len, "INVALID_CPA_TYPE(type = %d)", 
> evt->info.cpa.type);
>   break;
> @@ -895,6 +905,16 @@ char* cpsv_evt_str(CPSV_EVT *evt, char *
>   
> m_NCS_NODE_ID_FROM_MDS_DEST(info->info.cpnd_dest));
>   break;
>   }
> + case CPD_EVT_ND2D_CKPT_INFO_UPDATE:
> + {
> + CPSV_ND2D_CKPT_INFO_UPD *info = 
> >info.cpd.info.ckpt_info;
> + snprintf(o_evt_str, len, "[%llu] 
> CPD_EVT_ND2D_CKPT_INFO_UPDATE(%s, creationFlags=0x%X, "
> + "openFlags=0x%X, numbers[U/W/R]=[%u/%u/%u], 
> active=%s, last=%s)", info->ckpt_id,
> + info->ckpt_name.value, 
> info->attributes.creationFlags, info->ckpt_flags, info->num_users,
> + info->num_writers, info->num_readers, 
> info->is_active ? "true" : "false",
> + info->is_last ? "true" : "false");
> + break;
> + }
>   default:
>   snprintf(o_evt_str, len, "INVALID_CPD_TYPE(type = %d)", 
> evt->info.cpd.type);
>   break;


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] log: fix log file sizes grow rapidly and cannot open [#1851]

2016-05-26 Thread A V Mahesh
Hi Vu,

Yes you can push the patch .

The other issue we can debug later.

-AVM

On 5/26/2016 3:52 PM, Vu Minh Nguyen wrote:
> I ran on standby node too. Can you give me the log trace on active node and
> log trace of log agent?
>
> By the way, can I push the patch now? Thanks.
>
> Regards, Vu.
>
>
>> -Original Message-
>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>> Sent: Thursday, May 26, 2016 5:08 PM
>> To: Vu Minh Nguyen; opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 1 of 1] log: fix log file sizes grow rapidly
> and cannot
>> open [#1851]
>>
>> Hi Vu,
>>
>> Similar result are observed on today's staging  changeset:   7667 WITH &
>> WITH-OUT this patch
>> so this errors are not related to this patch.
>>
>> But still is see problems with today's staging  changeset:   7667 as well ,
>> I am running this  `/usr/bin/logtest`  on STANDBY node on Active all
>> will pass, you can test your self
>> still not reproducible , i will provide traces.
>>
>> It seems this patch is relevant to  5.0 only .
>> Are you planing to push now ?
>>
>>
>> -AVM
>>
>>
>>
>> On 5/26/2016 3:21 PM, Vu Minh Nguyen wrote:
>>> Hi Mahesh,
>>>
>>> So strange!
>>>
>>> The patch only did convert data type in case write request gets timeout,
>>> it should not have any impact to current functionalities.
>>>
>>> Of course, I ran whole test several times and not got any errors.
>>>
>>> Can you try to rebuild whole opensaf, and rerun the test?
>>> If you still get failed, please send me the log trace?
>>>
>>> Regards, Vu.
>>>
>>>
>>>> -Original Message-
>>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
>>>> Sent: Thursday, May 26, 2016 3:47 PM
>>>> To: opensaf-devel@lists.sourceforge.net
>>>> Subject: Re: [devel] [PATCH 1 of 1] log: fix log file sizes grow rapidly
>>> and cannot
>>>> open [#1851]
>>>>
>>>> Hi Vu,
>>>>
>>>> With this patch i am seeing considerble erros for `/usr/bin/logtest`
>>>> Note : I am usng  5.0 GA  release with changeset:7606  with   log
>>>> service tickets #1789,  #1805 , #1807
>>>>
>>>> Am I missing any other critical patch on top of changeset:7606 ?
>>>>
>>>> Test Result:
>>>> Total:  205
>>>> Passed: 194
>>>> Failed: 11
>>>>
>>>>
>> ==
>>>> ==
>>>> Log file size (0) is less than 65535
>>>>  39  FAILED   Modify: saLogStreamFixedLogRecordSize == 0, write a
>>>> record = 65535 bytes, OK (expected UNKNOWN, got SA_AIS_NOT_VALID);
>>>> Log file size (0) is less than 65535
>>>>  40  FAILED   Modify: saLogStreamFixedLogRecordSize == 65535, Write a
>>>> record = 65535 bytes with special characters, OK (expected UNKNOWN, got
>>>> SA_AIS_NOT_VALID);
>>>>  41  PASSED   Write 20 log records to System/Notification stream.
>>>> MANUALLY verify millisecond increased continuously;
>>>>
>> ==
>>>> ==
>>>>
>>>>
>>>>
>> ==
>>>> ==
>>>> 57  PASSED   saflogtest, writing to saLogApplication1, severity
>>>> filtering check;
>>>>  58  FAILED   (expected EXIT_SUCCESS, got UNKNOWN (123))  CCB
>>>> Object Modify, saLogstreamLogFileFormat, timezone token (@Nz);
>>>>  59  FAILED   (expected EXIT_SUCCESS, got UNKNOWN (123))  CCB
>>>> Object Modify, saLogstreamLogFileFormat, millisecond token (@Nk);
>>>>  60  FAILED   (expected EXIT_SUCCESS, got UNKNOWN (123))  CCB
>>>> Object Modify, saLogstreamLogFileFormat, timezone token (@Cz);
>>>>  61  FAILED   (expected EXIT_SUCCESS, got UNKNOWN (123))  CCB
>>>> Object Modify, saLogstreamLogFileFormat, millisecond token (@Ck);
>>>>  62  FAILED   (expected EXIT_SUCCESS, got UNKNOWN (123))  CCB
>>>> Object Modify, saLogstreamLogFileFormat, timezone & millisecond token
>>

<    1   2   3   4   5   6   >