Re: [devel] [PATCH 1/1] msg: update msg to use CLM B.04.01 [#2841]

2018-05-18 Thread Srinivas Mangipudy
Hi Alex,

Ack from my side, code review only.

Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:ajo...@rbbn.com] 
Sent: Friday, May 11, 2018 9:03 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <ajo...@rbbn.com>
Subject: [PATCH 1/1] msg: update msg to use CLM B.04.01 [#2841]

Update msgd and msgnd to use CLM B.04.01.
---
 src/msg/Makefile.am   |  2 --
 src/msg/common/mqsv_def.h |  5 +
 src/msg/msgd/mqd_api.c| 15 ---
 src/msg/msgd/mqd_clm.c| 17 +++--
 src/msg/msgd/mqd_clm.h| 10 --
 src/msg/msgnd/mqnd_init.c | 18 +-  src/msg/msgnd/mqnd_proc.c | 
17 +++--  src/msg/msgnd/mqnd_proc.h | 10 --
 8 files changed, 68 insertions(+), 26 deletions(-)

diff --git a/src/msg/Makefile.am b/src/msg/Makefile.am index 
dd282504e..d77251609 100644
--- a/src/msg/Makefile.am
+++ b/src/msg/Makefile.am
@@ -135,7 +135,6 @@ dist_pkgsysconf_DATA += \
src/msg/msgnd/msgnd.conf
 
 bin_osafmsgnd_CPPFLAGS = \
-   -DSA_CLM_B01=1 \
-DNCS_MQND=1 -DASAPi_DEBUG=1 \
$(AM_CPPFLAGS)
 
@@ -166,7 +165,6 @@ bin_osafmsgnd_LDADD = \
lib/libopensaf_core.la
 
 bin_osafmsgd_CPPFLAGS = \
-   -DSA_CLM_B01=1 \
-DNCS_MQD=1 -DASAPi_DEBUG=1 \
$(AM_CPPFLAGS)
 
diff --git a/src/msg/common/mqsv_def.h b/src/msg/common/mqsv_def.h index 
bfeb8bc71..de805d6cf 100644
--- a/src/msg/common/mqsv_def.h
+++ b/src/msg/common/mqsv_def.h
@@ -80,6 +80,11 @@ typedef struct mqsv_dsend_info {
   amf_ver.majorVersion = 0x01;  \
   amf_ver.minorVersion = 0x01;
 
+#define m_MQSV_GET_CLM_VER(clm_ver) \
+  clm_ver.releaseCode = 'B';\
+  clm_ver.majorVersion = 0x04;  \
+  clm_ver.minorVersion = 0x01;
+
 #define m_MQSV_IS_ACKFLAGS_NOT_VALID(ackFlags) \
   ((ackFlags) && ((ackFlags) != SA_MSG_MESSAGE_DELIVERED_ACK))
 
diff --git a/src/msg/msgd/mqd_api.c b/src/msg/msgd/mqd_api.c index 
83d5c2198..ee92f8375 100644
--- a/src/msg/msgd/mqd_api.c
+++ b/src/msg/msgd/mqd_api.c
@@ -113,17 +113,17 @@ static SaAisErrorT mqd_clm_init(MQD_CB *cb)
 
do {
SaVersionT clm_version;
-   SaClmCallbacksT mqd_clm_cbk;
+   SaClmCallbacksT_4 mqd_clm_cbk;
 
-   m_MQSV_GET_AMF_VER(clm_version);
+   m_MQSV_GET_CLM_VER(clm_version);
mqd_clm_cbk.saClmClusterNodeGetCallback = NULL;
mqd_clm_cbk.saClmClusterTrackCallback =
mqd_clm_cluster_track_callback;
 
saErr =
-   saClmInitialize(>clm_hdl, _clm_cbk, _version);
+   saClmInitialize_4(>clm_hdl, _clm_cbk, _version);
if (saErr != SA_AIS_OK) {
-   LOG_ER("saClmInitialize failed with error %u",
+   LOG_ER("saClmInitialize_4 failed with error %u",
   (unsigned)saErr);
break;
}
@@ -137,10 +137,11 @@ static SaAisErrorT mqd_clm_init(MQD_CB *cb)
}
TRACE_1("saClmSelectionObjectGet success");
 
-   saErr =
-   saClmClusterTrack(cb->clm_hdl, SA_TRACK_CHANGES_ONLY, NULL);
+   saErr = saClmClusterTrack_4(cb->clm_hdl,
+   SA_TRACK_CHANGES_ONLY,
+   NULL);
if (SA_AIS_OK != saErr) {
-   LOG_ER("saClmClusterTrack failed with error %u",
+   LOG_ER("saClmClusterTrack_4 failed with error %u",
   (unsigned)saErr);
break;
}
diff --git a/src/msg/msgd/mqd_clm.c b/src/msg/msgd/mqd_clm.c index 
41d9bcf15..ce285283c 100644
--- a/src/msg/msgd/mqd_clm.c
+++ b/src/msg/msgd/mqd_clm.c
@@ -39,8 +39,14 @@ extern MQDLIB_INFO gl_mqdinfo;
  *
  
**/
 void mqd_clm_cluster_track_callback(
-const SaClmClusterNotificationBufferT *notificationBuffer,
-SaUint32T numberOfMembers, SaAisErrorT error)
+   const SaClmClusterNotificationBufferT_4 *notificationBuffer,
+   SaUint32T numberOfMembers,
+   SaInvocationT invocation,
+   const SaNameT *rootCauseEntity,
+   const SaNtfCorrelationIdsT *correlationIds,
+   SaClmChangeStepT step,
+   SaTimeT timeSupervision,
+   SaAisErrorT error)
 {
MQD_CB *pMqd = 0;
SaClmNodeIdT node_id;
@@ -49,6 +55,11 @@ void mqd_clm_cluster_track_callback(
TRACE_ENTER2("cluster change=%d",
 notificationBuffer->notification[counter].clusterChange);
 
+   if (error != SA_AIS_OK) {
+   LOG_ER("mqd_clm_cluster_track_callback error: %i", error);
+   goto done;
+   }
+
/* Get the Controll block */

Re: [devel] [PATCH 1/1] msgd: put node down handling on thread [#2852]

2018-05-18 Thread Srinivas Mangipudy
Hi Alex,

Ack from my side, code review only.

Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:ajo...@rbbn.com] 
Sent: Friday, May 11, 2018 8:42 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <ajo...@rbbn.com>
Subject: [PATCH 1/1] msgd: put node down handling on thread [#2852]

If multiple nodes go down simultaneously which are hosting msg queues (e.g.
multiple VMs on a host, and the host goes down), msgd can take a long time to 
process the node downs which blocks the main thread, and therefore the 
healthcheck doesn't get processed, so msgd dies, which restarts the controller.

msgd needs to sit in a loop waiting for imm to release the implementers for 
each of the down nodes. For many nodes which went down simultaneously this can 
take up to 20 seconds when done serially.

Node down logic needs to be put on a thread, so that we can continue to process 
other messages like healthcheck. This also allows us to parallelize the node 
down handling.
---
 src/msg/msgd/mqd_asapi.c |  17 +++--
 src/msg/msgd/mqd_clm.c   | 183 +++
 src/msg/msgd/mqd_evt.c   |   5 ++
 src/msg/msgd/mqd_mbcsv.c |  16 +++--
 src/msg/msgd/mqd_ntf.cc  |   4 ++
 5 files changed, 151 insertions(+), 74 deletions(-)

diff --git a/src/msg/msgd/mqd_asapi.c b/src/msg/msgd/mqd_asapi.c index 
c44df4d2a..eb760ca8e 100644
--- a/src/msg/msgd/mqd_asapi.c
+++ b/src/msg/msgd/mqd_asapi.c
@@ -1298,18 +1298,18 @@ static uint32_t mqd_asapi_queue_make(MQD_OBJ_INFO 
*pObjInfo,
"%s:%u:ERR_MEMORY:Failed To 
Allocate Memory for QGroups",
__FILE__, __LINE__);
return SA_AIS_ERR_NO_MEMORY;
-   return SA_AIS_ERR_NO_MEMORY;
}
 
itr.state = 0;
-   for (idx = 0; idx < qcnt; idx++) {
-   pOelm = (MQD_OBJECT_ELEM *)ncs_walk_items(
-   >ilist, );
+   idx = 0;
+   while ((pOelm = (MQD_OBJECT_ELEM *)ncs_walk_items(
+   >ilist, ))) {
 
memcpy([idx].name, >pObject->name,
   sizeof(SaNameT));
mqd_qparam_fill(>pObject->info.q,
[idx]);
+   idx++;
}
}
} else {
@@ -1632,6 +1632,8 @@ void mqd_nd_restart_update_dest_info(MQD_CB *pMqd, 
MDS_DEST dest)
NCS_Q_ITR itr;
uint32_t count = 0;
 
+   m_NCS_LOCK(>mqd_cb_lock, NCS_LOCK_WRITE);
+
pObjNode = (MQD_OBJ_NODE *)ncs_patricia_tree_getnext(>qdb,
 (uint8_t *)NULL);
while (pObjNode) {
@@ -1686,6 +1688,8 @@ void mqd_nd_restart_update_dest_info(MQD_CB *pMqd, 
MDS_DEST dest)
pObjNode = (MQD_OBJ_NODE *)ncs_patricia_tree_getnext(
>qdb, (uint8_t *));
}
+
+   m_NCS_UNLOCK(>mqd_cb_lock, NCS_LOCK_WRITE);
 }
 
 /\
@@ -1707,6 +1711,8 @@ void mqd_nd_down_update_info(MQD_CB *pMqd, MDS_DEST dest)
NCS_Q_ITR itr;
uint32_t count = 0;
 
+   m_NCS_LOCK(>mqd_cb_lock, NCS_LOCK_WRITE);
+
pObjNode = (MQD_OBJ_NODE *)ncs_patricia_tree_getnext(>qdb,
 (uint8_t *)NULL);
while (pObjNode) {
@@ -1757,6 +1763,9 @@ void mqd_nd_down_update_info(MQD_CB *pMqd, MDS_DEST dest)
pObjNode = (MQD_OBJ_NODE *)ncs_patricia_tree_getnext(
>qdb, (uint8_t *));
}
+
+   m_NCS_UNLOCK(>mqd_cb_lock, NCS_LOCK_WRITE);
+
return;
 }
 
diff --git a/src/msg/msgd/mqd_clm.c b/src/msg/msgd/mqd_clm.c index 
41d9bcf15..0dbb21b23 100644
--- a/src/msg/msgd/mqd_clm.c
+++ b/src/msg/msgd/mqd_clm.c
@@ -119,84 +119,141 @@ void mqd_clm_cluster_track_callback(
TRACE_LEAVE();
 }
 
-void mqd_del_node_down_info(MQD_CB *pMqd, NODE_ID nodeid)
+static void * _mqd_del_node_down_info(void *arg)
 {
-   MQD_OBJ_NODE *pNode = 0;
-   MQD_A2S_MSG msg;
-   SaImmOiHandleT immOiHandle;
+   NODE_ID nodeid = *(NODE_ID *) arg;
SaAisErrorT rc = SA_AIS_OK;
-   SaImmOiImplementerNameT implementer_name;
-   int retries = 5;
-   char i_name[256] = {0};
-   SaVersionT imm_version = {'A', 0x02, 0x01};
+   SaImmOiHandleT immOiHandle = 0;
+   MQD_CB *pMqd = ncshm_take_hdl(NCS_SERVICE_ID_MQD, 
+gl_mqdinfo.inst_hdl);
+
TRACE_ENTER2("nodeid=%u", nodeid);
 
-   rc = immutil_saImmOiInitialize_2(, NULL, _version);
-   if (rc != SA_AIS_OK)

Re: [devel] [PATCH 1/1] msgd: handle abrupt restart of remote node [#2840]

2018-04-29 Thread Srinivas Mangipudy
Hi Alex,

Ack from my end, code review only.

Thank you
Srinivas


-Original Message-
From: Alex Jones [mailto:ajo...@rbbn.com] 
Sent: Wednesday, April 25, 2018 8:08 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <ajo...@rbbn.com>
Subject: [PATCH 1/1] msgd: handle abrupt restart of remote node [#2840]

Sometimes when a remote node restarts abruptly, queues which were created on 
that node, are unable to be opened again when that node comes up.

There is a race condition when the remote node goes down between msgd getting 
the CLM and MDS events indicating node down, and immd removing the implementer 
for that remote node. When msgd gets the CLM and MDS events indicating node 
down it temporarily becomes the implementer for any queues on that node so that 
it can remove the entries in IMM. If IMM has not yet removed the implementer, 
msgd will fail to remove the IMM entries. When the remote node comes back up, 
and the queues are opened, they will fail because the IMM entries are still 
there.

When msgd recevies ERR_EXIST from implementer set in this case, it should treat 
it as TRY_AGAIN.
---
 src/msg/msgd/mqd_clm.c  | 60 +
 src/msg/msgd/mqd_db.h   |  2 +-
 src/msg/msgd/mqd_evt.c  | 12 --  src/msg/msgd/mqd_util.c |  2 +-
 4 files changed, 58 insertions(+), 18 deletions(-)

diff --git a/src/msg/msgd/mqd_clm.c b/src/msg/msgd/mqd_clm.c index 
912d5a3f5..41d9bcf15 100644
--- a/src/msg/msgd/mqd_clm.c
+++ b/src/msg/msgd/mqd_clm.c
@@ -26,6 +26,7 @@
 the cluster track
 
*/
 
+#include "base/osaf_time.h"
 #include "msg/msgd/mqd.h"
 #include "mqd_imm.h"
 extern MQDLIB_INFO gl_mqdinfo;
@@ -56,11 +57,10 @@ void mqd_clm_cluster_track_callback(
} else {
for (counter = 0; counter < notificationBuffer->numberOfItems;
 counter++) {
+   node_id = notificationBuffer->notification[counter].
+   clusterNode.nodeId;
if (notificationBuffer->notification[counter]
.clusterChange == SA_CLM_NODE_LEFT) {
-   node_id =
-   notificationBuffer->notification[counter]
-   .clusterNode.nodeId;
pNdNode =
(MQD_ND_DB_NODE *)ncs_patricia_tree_get(
>node_db, (uint8_t *)_id); 
@@ -78,6 +78,8 @@ void mqd_clm_cluster_track_callback(
true;
}
} else {
+   SaTimeT timeout =
+
+m_NCS_CONVERT_SATIME_TO_TEN_MILLI_SEC(MQD_ND_EXPIRY_TIME_STANDBY);
TRACE_2(
"%s:%u: CLM Event is coming first 
for Node down",
__FILE__, __LINE__);
@@ -93,9 +95,22 @@ void mqd_clm_cluster_track_callback(
pNdNode->info.nodeid = node_id;
pNdNode->info.is_clm_down = true;
mqd_red_db_node_add(pMqd, pNdNode);
-   if (pMqd->ha_state == SA_AMF_HA_ACTIVE)
-   mqd_del_node_down_info(pMqd,
-  node_id);
+   mqd_tmr_start(>info.timer,
+   timeout);
+   }
+   } else if (notificationBuffer->notification[counter].
+   clusterChange == SA_CLM_NODE_JOINED) {
+   pNdNode =
+   (MQD_ND_DB_NODE *)ncs_patricia_tree_get(
+   >node_db, (uint8_t *)_id);
+   if (pNdNode) {
+   mqd_tmr_stop(>info.timer);
+
+   if (pMqd->ha_state ==
+   SA_AMF_HA_ACTIVE) {
+   mqd_red_db_node_del(pMqd,
+   pNdNode);
+   }
}
}
}
@@ -111,21 +126,38 @@ void mqd_del_node_down_info(MQD_CB *pMqd, NODE_ID nodeid)
SaImmOiHandleT immOiHandle;
SaAisErrorT rc = SA_AIS_OK;
Sa

Re: [devel] [PATCH 1/1] msgnd: prevent race condition during q transfer [#2816]

2018-03-21 Thread Srinivas Mangipudy
Hi Alex,

Ack from my side, code review only.

Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:ajo...@rbbn.com] 
Sent: Tuesday, March 20, 2018 9:25 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <ajo...@rbbn.com>
Subject: [PATCH 1/1] msgnd: prevent race condition during q transfer [#2816]

During q transfer when new node is opening the q, msgnd fails to create the 
runtime IMM object for the queue, and the open fails.

When the transfer is done, the old side and owner of the runtime object doesn't 
delete the IMM object until after the q transfer response is sent. This is a 
race condition. If the new side tries to create the runtime object before the 
old side has deleted it, the opening of the queue on the new side fails.

Delete the runtime object before sending the q transfer response.
---
 src/msg/msgnd/mqnd_proc.c | 38 +-
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/src/msg/msgnd/mqnd_proc.c b/src/msg/msgnd/mqnd_proc.c index 
ca7dfc8ff..3205d714b 100644
--- a/src/msg/msgnd/mqnd_proc.c
+++ b/src/msg/msgnd/mqnd_proc.c
@@ -468,6 +468,21 @@ reg_req:
asapi_msg_free();
 
 send_rsp:
+   /*
+* Delete the runtime object before responding, otherwise the other side
+* might create it before we have removed it
+*/
+   rc = immutil_saImmOiRtObjectDelete(cb->immOiHandle,
+   >qinfo.queueName);
+
+   if (rc != SA_AIS_OK) {
+   LOG_ER("immutil_saImmOiRtObjectDelete: Deletion of MsgQueue "
+   "object %s failed: %i",
+   qnode->qinfo.queueName.value,
+   rc);
+   return NCSCC_RC_FAILURE;
+   }
+
/* Send the response */
transfer_rsp.type = MQSV_EVT_MQP_RSP;
transfer_rsp.msg.mqp_rsp.type = MQP_EVT_TRANSFER_QUEUE_RSP; @@ -485,18 
+500,23 @@ send_rsp:
transfer_rsp.msg.mqp_rsp.error = err;
 
rc = mqnd_mds_send_rsp(cb, >sinfo, _rsp);
-   if (rc != NCSCC_RC_SUCCESS)
+   if (rc != NCSCC_RC_SUCCESS) {
TRACE_2(
"Queue Attribute get :Mds Send Response Failed %" PRIx64,
cb->my_dest);
-   else
-   /* delete Message Queue Objetc at IMMSV */
-   if (immutil_saImmOiRtObjectDelete(
-   cb->immOiHandle, >qinfo.queueName) != SA_AIS_OK) {
-   LOG_ER(
-   "immutil_saImmOiRtObjectDelete: Deletion of MsgQueue object 
%s",
-   qnode->qinfo.queueName.value);
-   return NCSCC_RC_FAILURE;
+
+   /* readd the runtime object which was deleted above */
+   err = mqnd_create_runtime_MsgQobject(
+   (char *)qnode->qinfo.queueName.value,
+   qnode->qinfo.creationTime,
+   qnode,
+   cb->immOiHandle);
+
+   if (err != SA_AIS_OK) {
+   LOG_ER("failed to recreate IMM q object for %s: %i",
+   qnode->qinfo.queueName.value,
+   err);
+   }
}
 
if (mqsv_message_cpy)
--
2.13.6


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


Re: [devel] [PATCH 0/1] Review Request for msgd: during cold sync don't add tracking entries which already exist [#2793]

2018-03-08 Thread Srinivas Mangipudy
Hi Alex,

Ack from my side, code review only.

Thank you
Srinivas


-Original Message-
From: Alex Jones [mailto:ajo...@rbbn.com] 
Sent: Wednesday, March 7, 2018 5:46 AM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <ajo...@rbbn.com>
Subject: [PATCH 0/1] Review Request for msgd: during cold sync don't add 
tracking entries which already exist [#2793]

Summary: msgd: during cold sync don't add tracking entries which already exist 
[#2793] Review request for Ticket(s): 2793 Peer Reviewer(s): Srinivas Pull 
request to: 
Affected branch(es): develop
Development branch: ticket-2793
Base revision: 5d0175a756c4d7fe47dc8b815725332ca7ca4291
Personal repository: git://git.code.sf.net/u/trguitar/review


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):
-

revision 916b838764c03891c5e35b18626d89aadbb5caf6
Author: Alex Jones <ajo...@rbbn.com>
Date:   Tue, 6 Mar 2018 18:48:49 -0500

msgd: during cold sync don't add tracking entries which already exist [#2793]

Opening of an existing msg q using saMsgQueueOpen (for q failover) may take a 
long time.

When cold sync is done, sometimes two MDS cold sync requests are sent by the 
standby, so the standby can receive 2 cold syncs. The standby code to process 
the cold sync response blindly adds the tracking entries for message queue 
groups. If two cold syncs are done, the tracking list can have duplicate 
entries. When controllers are rebooted back and forth, this list can get large 
(1000s of entries), and if another cluster node is rebooted and a q needs to 
move from there, 1000s of duplicate tracking messages are sent by msgd, which 
slows down the failover, and saMsgQueueOpen can take a long time.

Fix is to not blindly add tracking entries during cold sync, but only add them 
if they are not already there.



Complete diffstat:
--
 src/msg/msgd/mqd_mbcsv.c | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)


Testing Commands:
-
1) create a msg q group
2) create 4 msg qs on different nodes and add them to the group
3) send some messages to the group (to enable tracking)
4) open another message q on a different node
5) reboot the controllers back and forth about 20 or 30 times
6) reboot the node with the message q from (4)
7) open the msg q on another node


Testing, Expected Results:
--
1) step 7 should not take seconds
2) there should not be 1000s of entries in syslog saying "unable to send
   "tracking message"

Conditions of Submission:
-
Mar 12 or ack from developer


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 

Re: [devel] [PATCH 1/1] dtm: change trace config var name to _PATHNAME [#2792]

2018-03-05 Thread Srinivas Mangipudy
Hi Vu,

I updated OpenSAF_IMMsv_PR.odt and the document is at:
https://sourceforge.net/p/opensaf/documentation/ci/default/tree/OpenSAF_IMMSv_PR.odt

Can you please review.

Thank you
Srinivas




-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: Thursday, March 1, 2018 1:30 PM
To: srinivas ; anders.wid...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] dtm: change trace config var name to _PATHNAME [#2792]

Ack with a  minor comment, with [Vu].

Regards, Vu

> -Original Message-
> From: srinivas [mailto:srinivas.mangip...@oracle.com]
> Sent: Thursday, March 1, 2018 2:31 PM
> To: anders.wid...@ericsson.com; vu.m.ngu...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net; srinivas 
> 
> Subject: [PATCH 1/1] dtm: change trace config var name to _PATHNAME 
> [#2792]
> 
> ---
>  src/imm/README  | 9 ++---
>  src/imm/immloadd/imm_loader.cc  | 2 +-
>  src/imm/immnd/immnd.conf| 2 +-
>  src/imm/immpbed/immpbe.cc   | 2 +-
>  src/imm/tools/imm_dumper.cc | 2 +-
>  src/ntf/README  | 7 +--
>  src/ntf/ntfd/ntfd.conf  | 2 +-
>  src/ntf/ntfimcnd/ntfimcn_main.c | 2 +-
>  8 files changed, 17 insertions(+), 11 deletions(-)
> 
> diff --git a/src/imm/README b/src/imm/README index ee5f8e8..750d811 
> 100644
> --- a/src/imm/README
> +++ b/src/imm/README
> @@ -3206,12 +3206,12 @@ in immd.conf/immnd.conf and restart the cluster.
> 
>  Errors, warnings and notice level messages are logged to the syslog.
> 
> -To enable traces in the IMM library, export the variable 
> IMMA_TRACE_FILENAME
> +To enable traces in the IMM library, export the variable
> IMMA_TRACE_PATHNAME
>  with a valid pathname before starting the application using the IMM
library.
[Vu] It may be good information for user to state here fixed location of trace 
file as you already did for NTF README as below.
+Traces are always stored in $PKGLOGDIR directory and the directory
component
+of the path name (if any) is ignored.

In OpenSAF_IMMsv_PR.odt
(https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_documentation_ci_default_tree_OpenSAF-5FIMM=DwICAg=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=JgHty7D6Tv9zeykUciK5bglWJyc6T9fA5EnNFw1Mm7Q=A7QbkwCI_4xr19yJ5_fLor10DmmuVrubaAkDIvQF2yc=
Sv_PR.odt),
There is a statement regarding agent trace, I guess we should consider to 
update it too, chapter 3.6.2 Configuration:
" Tracing of he IMMA library is possible by defining the environment variable 
IMMA_TRACE_PATHNAME. The variable should have a legal file path and the trace 
will be appended to the file identified by that path"

> 
>  For example:
> 
> -$ export IMMA_TRACE_FILENAME=imm.trace
> +$ export IMMA_TRACE_PATHNAME=imm.trace
>  $ ./immomtest
>  $ cat $pkglogdir/imm.trace
> 
> @@ -3220,8 +3220,11 @@ It is also possible to trace slave processes 
> forked by the IMMND.
>  This would be processes for loading, sync and dump/pbe.
>  To enable such trace uncomment:
> 
> -#export IMMSV_TRACE_FILENAME=osafimmnd
> +#export IMMSV_TRACE_PATHNAME=osafimmnd
> 
> +It is recommended to use osaflog command as it takes care of flushing 
> +unwritten trace messages from memory to disk, as well as 
> +concatenating the pieces that may have resulted from log rotation of the 
> trace stream.
> 
>  TEST
> 
> diff --git a/src/imm/immloadd/imm_loader.cc 
> b/src/imm/immloadd/imm_loader.cc index 13fb417..de5a575 100644
> --- a/src/imm/immloadd/imm_loader.cc
> +++ b/src/imm/immloadd/imm_loader.cc
> @@ -2507,7 +2507,7 @@ int main(int argc, char *argv[]) {
>  exit(1);
>}
> 
> -  if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) {
> +  if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) {
>  category_mask = 0x; /* TODO: set using env variable ? */
>} else {
>  logPath = defaultLog;
> diff --git a/src/imm/immnd/immnd.conf b/src/imm/immnd/immnd.conf index 
> 9172677..b6a4823 100644
> --- a/src/imm/immnd/immnd.conf
> +++ b/src/imm/immnd/immnd.conf
> @@ -12,7 +12,7 @@
>  # they attach as IMMA clients. These processes will also route trace 
> to
the
>  # IMMND trace-file as define here. Traces are always stored in 
> $PKGLOGDIR  # directory and the directory component of the path name 
> (if any) is
ignored.
> -#export IMMSV_TRACE_FILENAME=osafimmnd
> +#export IMMSV_TRACE_PATHNAME=osafimmnd
> 
>  # The directory where the imm.xml files and persistend backend files 
> are  # stored. Imm dump files may also be stored here or in a subdirectory.
> diff --git a/src/imm/immpbed/immpbe.cc b/src/imm/immpbed/immpbe.cc 
> index 6e9b933..964086f 100644
> --- a/src/imm/immpbed/immpbe.cc
> +++ b/src/imm/immpbed/immpbe.cc
> @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) {
>const SaImmAdminOperationParamsT_2* params[] = {NULL};
>SaImmAdminOperationParamsT_2** retParams = NULL;
> 
> -  if ((logPath = 

Re: [devel] [PATCH 1/1] imm: return correct error code when working on more than 10000 objects [#2359]

2018-02-28 Thread Srinivas Mangipudy
Thank you Vu, Zoran for your comments.

I will make code changes to return NCSCC_RC_NO_OBJECT from 
immsv_evt_enc_name_list.


Thank you
Srinivas


-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com] 
Sent: Tuesday, February 27, 2018 2:45 PM
To: Vu Minh Nguyen ; srinivas 

Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] imm: return correct error code when working on more 
than 1 objects [#2359]

Hi,

I agree with Vu. You are mixing NCSCC errors with AIS errors.

Usually, when we introduce some limitation in the library, we must have the 
same limitation on the service side as well, and both checks return the same 
error code.
This is a bit tricky part. The check is on the service side in the decoding 
part which is more part of MDS than IMM.

If it's not possible to fix the service side and return ERR_INAVLID_PARAM or 
ERR_NO_RESOURCE, I would suggest to make an exception in this case and return 
ERR_INVALID_PARAM or ERR_NO_RESOURCE if the problem is caught in the library 
(so that applications does not need to restart) and return ERR_LIBRARY if the 
problem is caught on the service side (which means that some other library or 
earlier IMM library is used).
In both places (the service and the library sides) comments need to be added in 
the code to be visible that we have made an exception in this case.
So, on the service side, only comments need to be added since it already 
returns ERR_LIBRARY.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
Sent: den 27 februari 2018 02:27
To: 'srinivas' ; Zoran Milinkovic 

Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] imm: return correct error code when working on more 
than 1 objects [#2359]

Hi Srinivas,

I see you added new error code type to the function ` immsv_evt_enc_name_list`.
I don't think that is a good idea to mix using 02 different returned error code 
types in one function.
(Actually,  SA_AIS_ERR_NO_RESOURCES(18) value is equal to
NCSCC_RC_NO_OBJECT(18))

And few minors are inline.

Regards, Vu

> -Original Message-
> From: srinivas [mailto:srinivas.mangip...@oracle.com]
> Sent: Tuesday, February 20, 2018 2:31 PM
> To: vu.m.ngu...@dektech.com.au; zoran.milinko...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net; srinivas 
> 
> Subject: [PATCH 1/1] imm: return correct error code when working on 
> more than 1 objects [#2359]
> 
> ---
>  src/imm/agent/imma_proc.cc | 10 -- src/imm/common/immsv_evt.c 
> |  2 +-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/imm/agent/imma_proc.cc b/src/imm/agent/imma_proc.cc 
> index 886b50c..af8fb58 100644
> --- a/src/imm/agent/imma_proc.cc
> +++ b/src/imm/agent/imma_proc.cc
> @@ -3543,8 +3543,14 @@ SaAisErrorT imma_evt_fake_evs(IMMA_CB *cb, 
> IMMSV_EVT *i_evt, IMMSV_EVT **o_evt,
>proc_rc = immsv_evt_enc(i_evt, );
> 
>if (proc_rc != NCSCC_RC_SUCCESS) {
> -TRACE_2("ERR_LIBRARY: Failed to pre-pack");
> -rc = SA_AIS_ERR_LIBRARY;
> +if (proc_rc != SA_AIS_ERR_NO_RESOURCES) {
> +  rc = SA_AIS_ERR_LIBRARY;
> +  TRACE_2("ERR_LIBRARY: Failed to pre-pack");
> +}
> +else {
[Vu] `else` statement should be on the same line with previous `{`.
> +  rc = SA_AIS_ERR_NO_RESOURCES;
> +  TRACE_2("ERR_NO_RESOURCES: Failed to pre-pack");
> +}
>  goto fail;
>}
[Vu] Can we simplify above logic by only adding below check after ` 
immsv_evt_enc`?
if (proc_rc == NCSCC_RC_NO_OBJECT) {
  TRACE_2("ERR_NO_RESOURCES: Failed to pre-pack");
  rc = SA_AIS_ERR_NO_RESOURCES;
  goto fail;
}

> 
> diff --git a/src/imm/common/immsv_evt.c b/src/imm/common/immsv_evt.c 
> index 88c5101..aef00d4 100644
> --- a/src/imm/common/immsv_evt.c
> +++ b/src/imm/common/immsv_evt.c
> @@ -775,7 +775,7 @@ static uint32_t immsv_evt_enc_name_list(NCS_UBAID 
> *o_ub, IMMSV_OBJ_NAME_LIST *p)
> 
>   if (objs >= IMMSV_MAX_OBJECTS) {
>   LOG_ER("TOO MANY Object Names line:%u", __LINE__);
> - return NCSCC_RC_OUT_OF_MEM;
> + return SA_AIS_ERR_NO_RESOURCES;
[Vu] I don' think It is a good idea to mix using 02 different returned error 
code types.

>   }
>   return NCSCC_RC_SUCCESS;
>  }
> --
> 2.7.4



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


Re: [devel] [PATCH 1/1] dtm: updates to readme files and change of TRACE var in conf [#2776]

2018-02-15 Thread Srinivas Mangipudy
Hi Anders,

I have incorporated your review comments and pushed the patch.

Thank you
Srinivas

-Original Message-
From: Anders Widell [mailto:anders.wid...@ericsson.com] 
Sent: Monday, February 12, 2018 6:26 PM
To: srinivas 
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] dtm: updates to readme files and change of TRACE var 
in conf [#2776]

Ack with minor comments marked AndersW> below.

regards,

Anders Widell


On 02/09/2018 12:36 PM, srinivas wrote:
> ---
>   src/imm/README  | 12 +++-
>   src/imm/immloadd/imm_loader.cc  |  2 +-
>   src/imm/immnd/immnd.conf|  5 +++--
>   src/imm/immpbed/immpbe.cc   |  2 +-
>   src/imm/tools/imm_dumper.cc |  2 +-
>   src/ntf/README  | 10 ++
>   src/ntf/ntfd/ntfd.conf  |  4 +++-
>   src/ntf/ntfimcnd/ntfimcn_main.c |  2 +-
>   8 files changed, 23 insertions(+), 16 deletions(-)
>
> diff --git a/src/imm/README b/src/imm/README index d2f6b2f..ee5f8e8 
> 100644
> --- a/src/imm/README
> +++ b/src/imm/README
> @@ -3194,7 +3194,9 @@ To enable/disable immd/immnd trace in a running system, 
> send signal USR2 to the
>   immd/immnd process. Each signal toggles the trace.
>   Trace default is disabled.
>   
> -Traces are written to the file configured in immd.conf and immnd.conf
> +Traces are written to the file configured in immd.conf and immnd.conf.
> +Traces are always stored in $PKGLOGDIR directory and the directory 
> +component of the path name (if any) is ignored.
>   
>   To enable traces from the very start, uncomment:
>   
> @@ -3204,21 +3206,21 @@ in immd.conf/immnd.conf and restart the cluster.
>   
>   Errors, warnings and notice level messages are logged to the syslog.
>   
> -To enable traces in the IMM library, export the variable 
> IMMA_TRACE_PATHNAME
> +To enable traces in the IMM library, export the variable 
> +IMMA_TRACE_FILENAME
>   with a valid pathname before starting the application using the IMM library.
>   
>   For example:
>   
> -$ export IMMA_TRACE_PATHNAME=/tmp/imm.trace
> +$ export IMMA_TRACE_FILENAME=imm.trace
>   $ ./immomtest
> -$ cat /tmp/imm.trace
> +$ cat $pkglogdir/imm.trace
>   
>   
>   It is also possible to trace slave processes forked by the IMMND.
>   This would be processes for loading, sync and dump/pbe.
>   To enable such trace uncomment:
>   
> - #export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd
> +#export IMMSV_TRACE_FILENAME=osafimmnd
>   
>   
>   TEST
> diff --git a/src/imm/immloadd/imm_loader.cc 
> b/src/imm/immloadd/imm_loader.cc index 4b6ad08..bfd02a7 100644
> --- a/src/imm/immloadd/imm_loader.cc
> +++ b/src/imm/immloadd/imm_loader.cc
> @@ -2507,7 +2507,7 @@ int main(int argc, char *argv[]) {
>   exit(1);
> }
>   
> -  if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) {
> +  if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) {
>   category_mask = 0x; /* TODO: set using env variable ? */
> } else {
>   logPath = defaultLog;


AndersW> Also remove PKGLOGDIR "/" from this line in the code (not
visible in the patch):
const char *defaultLog = PKGLOGDIR "/osafimmnd";


> diff --git a/src/imm/immnd/immnd.conf b/src/imm/immnd/immnd.conf index 
> 97af792..9172677 100644
> --- a/src/imm/immnd/immnd.conf
> +++ b/src/imm/immnd/immnd.conf
> @@ -10,8 +10,9 @@
>   # Uncomment the next line to enable trace for the imm-loader/sync
>   # and imm-pbe. When these are forked by the IMMND coordinator,
>   # they attach as IMMA clients. These processes will also route trace 
> to the -# IMMND trace-file as define here.
> -#export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd
> +# IMMND trace-file as define here. Traces are always stored in 
> +$PKGLOGDIR # directory and the directory component of the path name (if any) 
> is ignored.
> +#export IMMSV_TRACE_FILENAME=osafimmnd
>   
>   # The directory where the imm.xml files and persistend backend files are
>   # stored. Imm dump files may also be stored here or in a subdirectory.
> diff --git a/src/imm/immpbed/immpbe.cc b/src/imm/immpbed/immpbe.cc 
> index 964086f..6e9b933 100644
> --- a/src/imm/immpbed/immpbe.cc
> +++ b/src/imm/immpbed/immpbe.cc
> @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) {
> const SaImmAdminOperationParamsT_2* params[] = {NULL};
> SaImmAdminOperationParamsT_2** retParams = NULL;
>   
> -  if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) {
> +  if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) {
>   category_mask = 0x; /* TODO: set using -t flag ? */
> } else {
>   logPath = defaultLog;
> diff --git a/src/imm/tools/imm_dumper.cc b/src/imm/tools/imm_dumper.cc 
> index 0365fc7..5e5dd00 100644
> --- a/src/imm/tools/imm_dumper.cc
> +++ b/src/imm/tools/imm_dumper.cc
> @@ -123,7 +123,7 @@ int main(int argc, char* argv[]) {
>  * osaf_extended_name_* before saImmOmInitialize and saImmOiInitialize */
> osaf_extended_name_init();
>   
> -  if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) {
> +  if 

Re: [devel] [PATCH 0/1] Review Request for ntfd: Correct counting by in decode_reader_info [#2781]

2018-02-12 Thread Srinivas Mangipudy
Hi Minh,

Ack from my end.

Thank you
Srinivas

-Original Message-
From: Minh Chau [mailto:minh.c...@dektech.com.au] 
Sent: Monday, February 12, 2018 8:38 AM
To: canh.v.tru...@dektech.com.au
Cc: Minh Chau ; opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0/1] Review Request for ntfd: Correct counting by in 
decode_reader_info [#2781]

Summary: ntfd: Correct counting by in decode_reader_info [#2781] Review request 
for Ticket(s): 2781 Peer Reviewer(s): Canh Pull request to: *** LIST THE PERSON 
WITH PUSH ACCESS HERE *** Affected branch(es): develop Development branch: 
ticket-2781 Base revision: 0005efbd2284a62847fe0aea4d1c8a2571bc
Personal repository: git://git.code.sf.net/u/minh-chau/review


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):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision d09532c11ad56910c6de5c2503fe790806bd299b
Author: Minh Chau 
Date:   Mon, 12 Feb 2018 14:00:55 +1100

ntfd: Correct counting by in decode_reader_info [#2781]



Complete diffstat:
--
 src/ntf/ntfd/ntfs_mbcsv.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
ack from reviewer


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


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


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

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

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

___ Your patches do not have proper short+long header

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

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

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

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

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

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

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

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

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

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

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

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

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

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

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

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

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

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


--
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! 
https://urldefense.proofpoint.com/v2/url?u=http-3A__sdm.link_slashdot=DwICAg=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=oFI749HSS5__EaZ0L67sBbGQlUjBXF5iyNvW8DcLWew=j4fA1A3ARgmFxy-F6aNeqckYsZ-nz29cWXHIzIxq6jg=
___

Re: [devel] [PATCH 0/1] Review Request for imm: changes to generate trace files in configured dir [#2776]

2018-02-06 Thread Srinivas Mangipudy
Hi Anders, 

The “src/imm/README” has the following statement:

"This would be processes for loading, sync and dump/pbe.
To enable such trace uncomment:
#export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd"
 
The "src/imm/immnd/immnd.conf" has the following section:

"# Uncomment the next line to enable trace for the imm-loader/sync
# and imm-pbe. When these are forked by the IMMND coordinator,
# they attach as IMMA clients. These processes will also route trace to the
# IMMND trace-file as define here.
#export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd"

In case if we are going to create trace files only in "/var/log/opensaf", then 
I think we should update the README and conf files and make it clear that the 
users can enter only the filename rather than the entire path.
Should we also update the variable name to "IMMSV_TRACE_FILENAME" from 
"IMMSV_TRACE_PATHNAME"?


Please let me know your thoughts about this.

thank you

-Original Message-
From: Anders Widell [mailto:anders.wid...@ericsson.com] 
Sent: Tuesday, February 6, 2018 4:38 PM
To: srinivas ; vu.m.ngu...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/1] Review Request for imm: changes to generate trace 
files in configured dir [#2776]

Hi!

Is it a problem that trace files are stored under /var/log/opensaf ? The trace 
functionality has been implemented like this on purpose.

/ Anders Widell


On 02/06/2018 11:00 AM, srinivas wrote:
> Summary: imm: changes to generate trace files in configured dir 
> [#2776] Review request for Ticket(s): 2776 Peer Reviewer(s): 
> Vu.M.NGUYEN , Anders, Ravi Pull request to: *** LIST THE PERSON WITH 
> PUSH ACCESS HERE *** Affected branch(es): develop Development branch: 
> ticket-2776 Base revision: a53f5615dc7c2ece6669edd82949168982ae4355
> Personal repository: git://git.code.sf.net/u/sri-mangipudy/review
>
> 
> Impacted area   Impact y/n
> 
>   Docsn
>   Build systemn
>   RPM/packaging   n
>   Configuration files n
>   Startup scripts n
>   SAF servicesn
>   OpenSAF servicesn
>   Core libraries  y
>   Samples n
>   Tests   n
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
> *** EXPLAIN/COMMENT THE PATCH SERIES HERE ***
>
> revision a4047c17c73a0271e6ee23266e3398841895995b
> Author:   srinivas 
> Date: Tue, 6 Feb 2018 13:59:20 +0530
>
> imm: changes to generate trace files in configured dir [#2776]
>
>
>
> Complete diffstat:
> --
>   src/base/logtrace.cc|  2 +-
>   src/dtm/transport/log_server.cc |  7 ++-
>   src/dtm/transport/log_writer.cc | 12 ++--
>   3 files changed, 17 insertions(+), 4 deletions(-)
>
>
> Testing Commands:
> -
> change the trace dir in the conf dir and test if the traces are generated in 
> the configured dir.
>
> Testing, Expected Results:
> --
> *** PASTE COMMAND OUTPUTS / TEST RESULTS ***
>
>
> Conditions of Submission:
> -
> *** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***
>
>
> 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 

Re: [devel] [PATCH 0/1] Review Request for msg: implement metadata size and limit fetch operations [#2626]

2018-02-02 Thread Srinivas Mangipudy
Hi Alex,

 

Ack from me, code review only.

 

Thank you

Srinivas

 

From: Alex Jones [mailto:ajo...@rbbn.com] 
Sent: Wednesday, January 31, 2018 8:02 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/1] Review Request for msg: implement metadata size and 
limit fetch operations [#2626]

 

Hi Srinivas,

    If you have no comments, I will push this tomorrow.

Alex

 

On 01/26/2018 02:53 PM, Alex Jones wrote:

Summary: msg: implement metadata size and limit fetch operations [#2626]
Review request for Ticket(s): 2626
Peer Reviewer(s): Srinivas
Pull request to:
Affected branch(es): develop
Development branch: ticket-2626
Base revision: c1daa9cc8e583d0a6024b28241f2b671bfa615d8
Personal repository: git://git.code.sf.net/u/trguitar/review
 

Impacted area   Impact y/n

 Docs    n
 Build system    n
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF services    y
 OpenSAF services    n
 Core libraries  n
 Samples n
 Tests   n
 Other   n
 
NOTE: Patch(es) contain lines longer than 80 characers
 
Comments (indicate scope for each "y" above):
-
 
revision 6645a53f6323d39afb5e4de64b7429b6e7893d63
Author:  Alex Jones HYPERLINK "mailto:ajo...@rbbn.com;<ajo...@rbbn.com>
Date:    Fri, 26 Jan 2018 14:30:13 -0500
 
msg: implement metadata size and limit fetch operations [#2626]
 
This checkin implements metadata size and limit fetch operations, and
enforces them in other saMsg calls.
 
 
 
Added Files:

 src/msg/apitest/test_LimitGet.cc
 src/msg/apitest/test_MetaDataSize.cc
 
 
Complete diffstat:
--
 src/msg/Makefile.am    |   2 +
 src/msg/agent/mqa_api.cc   | 319 ++-
 src/msg/apitest/test_ErrUnavailable.cc |  68 ++-
 src/msg/apitest/test_LimitGet.cc   | 941 +
 src/msg/apitest/test_MetaDataSize.cc   |  94 
 src/msg/common/mqsv_def.h  |   3 +
 src/msg/common/mqsv_edu.c  |  33 +-
 src/msg/common/mqsv_evt.h  |  25 +-
 src/msg/msgd/mqd_asapi.c   |  18 +
 src/msg/msgd/mqd_db.h  |   1 +
 src/msg/msgd/mqd_imm.c |  10 +-
 src/msg/msgnd/mqnd_evt.c   | 153 ++
 src/msg/msgnd/mqnd_proc.c  |  28 +
 13 files changed, 1667 insertions(+), 28 deletions(-)
 
 
Testing Commands:
-
run msgtest on payload
 
 
Testing, Expected Results:
--
all tests should pass
 
 
Conditions of Submission:
-
Feb 1 or ack from developer
 
 
Arch  Built Started    Linux distro
---
mips    n  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
    c

Re: [devel] [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync reader information [#2757]

2018-02-01 Thread Srinivas Mangipudy
Hi Minh,

 

The LD_LIBRARY_PATH env was pointing to the old .so and hence I got the 
problem. Now it is resolved and the code built successfully.

 

Thank you

Srinivas

 

From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: Thursday, February 1, 2018 2:27 AM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>; Lennart Lund 
<lennart.l...@ericsson.com>; Canh Van Truong <canh.v.tru...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

 

Hi Srinivas,

Thanks for that, but I don't think we should add libntf_common.la to the 
Makefile.am.

These new reader encode/decode functions are introduced in the same way as 
other existing enc/dec functions, e.g., subscribe_msg, not_msg, and we haven't 
needed the libntf_common.la so far.

Can you try "ldd lib/.libs/libSaNtf.so" to see if it points to correct or old 
libntf_common.so.0 file?

Thanks
Minh

On 30/01/18 22:01, Srinivas Mangipudy wrote:

Hi Minh,

 

The symbols are defined in the libntf_common.so, but ntfread was not able to 
refer to these symbols.

 

After I added “libntf_common.la” in the lib dependency list of ntfread, it 
worked fine.

 

I made the below change in Makefile.am file in  “/opensaf-code678/src/ntf” 
(highlighted in GREEN)

bin_ntfread_LDADD = \

    lib/libntfclient.la \

    lib/libntf_common.la \

    lib/libSaNtf.la \

    lib/libopensaf_core.la

 

Similar change was required for ntfsend and ntfsubscribe as well.

 

Thank you

Srinivas

 

 

From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: Tuesday, January 30, 2018 4:17 AM
To: Srinivas Mangipudy HYPERLINK 
"mailto:srinivas.mangip...@oracle.com;<srinivas.mangip...@oracle.com>; Lennart 
Lund HYPERLINK "mailto:lennart.l...@ericsson.com;<lennart.l...@ericsson.com>; 
Canh Van Truong HYPERLINK 
"mailto:canh.v.tru...@dektech.com.au;<canh.v.tru...@dektech.com.au>
Cc: HYPERLINK 
"mailto:opensaf-devel@lists.sourceforge.net"opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

 

Hi Srinivas,

Those symbols should be defined in libntf_common.so, which the libSaNtf.so 
depends on

One possible case I try to see your error, is that I remove the implementation 
of ntfsv_enc_read_finalize_msg in ntfsv_enc_dec.c, so I got your error:

make -C ../../.. bin/ntfread bin/ntfsend bin/ntfsubscribe
make[1]: Entering directory '/home/minhchau/osaftest/opensaf-code'
  CCLD bin/ntfread
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'
collect2: error: ld returned 1 exit status
Makefile:8740: recipe for target 'bin/ntfread' failed
make[1]: *** [bin/ntfread] Error 1

But I suppose those functions should have been in ntfsv_enc_dec.c. Can you 
please try to build again with branch ticket-2757 in my review repo?

Thanks,

Minh

 

On 30/01/18 00:17, Srinivas Mangipudy wrote:

Hi Minh,

I got a build error. Below is the error;

CCLD bin/ntfread

lib/.libs/libSaNtf.so: undefined reference to 
`ntfsv_enc_reader_initialize_2_msg'

lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_next_msg'

lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'

collect2: error: ld returned 1 exit status

Makefile:8740: recipe for target 'bin/ntfread' failed

All the above symbols are undefined in the libSaNtf.so.0.1.2 shared library  

/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_reader_initialize_2_msg

 U ntfsv_enc_reader_initialize_2_msg

opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep ntfsv_enc_read_next_msg

 U ntfsv_enc_read_next_msg

/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_read_finalize_msg

 U ntfsv_enc_read_finalize_msg

Thank you

Srinivas

-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au]
Sent: Monday, January 29, 2018 9:31 AM
To: Lennart Lund HYPERLINK 
"mailto:lennart.l...@ericsson.com;<lennart.l...@ericsson.com>; Srinivas 
Mangipudy HYPERLINK 
"mailto:srinivas.mangip...@oracle.com;<srinivas.mangip...@oracle.com>; Canh Van 
Truong HYPERLINK 
"mailto:canh.v.tru...@dektech.com.au;<canh.v.tru...@dektech.com.au>
Cc: HYPERLINK 
"mailto:opensaf-devel@lists.sourceforge.net"opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

Hi all,

If the patch look ok to you, I would like to push it tomorrow.

I have updated the README and PR doc at the below links, if you have time 
please have a look.

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_77619155_0a9b_attachment_2757-5FREADME.diff=DwICaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAg

Re: [devel] [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync reader information [#2757]

2018-01-30 Thread Srinivas Mangipudy
Hi Minh,

 

The symbols are defined in the libntf_common.so, but ntfread was not able to 
refer to these symbols.

 

After I added “libntf_common.la” in the lib dependency list of ntfread, it 
worked fine.

 

I made the below change in Makefile.am file in  “/opensaf-code678/src/ntf” 
(highlighted in GREEN)

bin_ntfread_LDADD = \

    lib/libntfclient.la \

    lib/libntf_common.la \

    lib/libSaNtf.la \

    lib/libopensaf_core.la

 

Similar change was required for ntfsend and ntfsubscribe as well.

 

Thank you

Srinivas

 

 

From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: Tuesday, January 30, 2018 4:17 AM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>; Lennart Lund 
<lennart.l...@ericsson.com>; Canh Van Truong <canh.v.tru...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

 

Hi Srinivas,

Those symbols should be defined in libntf_common.so, which the libSaNtf.so 
depends on

One possible case I try to see your error, is that I remove the implementation 
of ntfsv_enc_read_finalize_msg in ntfsv_enc_dec.c, so I got your error:

make -C ../../.. bin/ntfread bin/ntfsend bin/ntfsubscribe
make[1]: Entering directory '/home/minhchau/osaftest/opensaf-code'
  CCLD bin/ntfread
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'
collect2: error: ld returned 1 exit status
Makefile:8740: recipe for target 'bin/ntfread' failed
make[1]: *** [bin/ntfread] Error 1

But I suppose those functions should have been in ntfsv_enc_dec.c. Can you 
please try to build again with branch ticket-2757 in my review repo?

Thanks,

Minh

 

On 30/01/18 00:17, Srinivas Mangipudy wrote:

Hi Minh,

I got a build error. Below is the error;

CCLD bin/ntfread

lib/.libs/libSaNtf.so: undefined reference to 
`ntfsv_enc_reader_initialize_2_msg'

lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_next_msg'

lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'

collect2: error: ld returned 1 exit status

Makefile:8740: recipe for target 'bin/ntfread' failed

All the above symbols are undefined in the libSaNtf.so.0.1.2 shared library  

/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_reader_initialize_2_msg

 U ntfsv_enc_reader_initialize_2_msg

opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep ntfsv_enc_read_next_msg

 U ntfsv_enc_read_next_msg

/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_read_finalize_msg

 U ntfsv_enc_read_finalize_msg

Thank you

Srinivas

-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au]
Sent: Monday, January 29, 2018 9:31 AM
To: Lennart Lund HYPERLINK 
"mailto:lennart.l...@ericsson.com;<lennart.l...@ericsson.com>; Srinivas 
Mangipudy HYPERLINK 
"mailto:srinivas.mangip...@oracle.com;<srinivas.mangip...@oracle.com>; Canh Van 
Truong HYPERLINK 
"mailto:canh.v.tru...@dektech.com.au;<canh.v.tru...@dektech.com.au>
Cc: HYPERLINK 
"mailto:opensaf-devel@lists.sourceforge.net"opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

Hi all,

If the patch look ok to you, I would like to push it tomorrow.

I have updated the README and PR doc at the below links, if you have time 
please have a look.

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_77619155_0a9b_attachment_2757-5FREADME.diff=DwICaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc=osczasl2Lxg-StyK-9Qs8XrvtTj1nnJlBEL2dDIxGEA=

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_5671255e_16a4_attachment_OpenSAF-5FNTFSv-5FPR-5F2735.odt=DwICaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc=riEHgZ3x2z9W8UtUxMo2tiD03svlKxireGpdVHRegvw=

Thanks,

Minh

 

On 24/01/18 12:49, HYPERLINK 
"mailto:minh.c...@dektech.com.au"minh.c...@dektech.com.au wrote:

> Hi Lennart,

> 

> I tested the APIs between versions with/without the changes. I will 

> send out for review the README and PR change after the code review is 

> done. One limitation is that both active and standby require the patches to 
> work.

> 

> Thanks,

> Minh

> 

>> Hi Minh

>> 

>> Ack. I have not tested much

>> 

>> Have you tested using the reader API while running old version on 

>> standby and new version on active and vice versa (upgrade case)? Limitations?

>> PR documentation update?

>> 

>> Thanks

>> Lennart

>> 

>>> -Original Message-

>>> Fro

Re: [devel] [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync reader information [#2757]

2018-01-29 Thread Srinivas Mangipudy
Hi Minh,

I got a build error. Below is the error;

CCLD bin/ntfread
lib/.libs/libSaNtf.so: undefined reference to 
`ntfsv_enc_reader_initialize_2_msg'
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_next_msg'
lib/.libs/libSaNtf.so: undefined reference to `ntfsv_enc_read_finalize_msg'
collect2: error: ld returned 1 exit status
Makefile:8740: recipe for target 'bin/ntfread' failed

All the above symbols are undefined in the libSaNtf.so.0.1.2 shared library  

/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_reader_initialize_2_msg
 U ntfsv_enc_reader_initialize_2_msg
opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep ntfsv_enc_read_next_msg
 U ntfsv_enc_read_next_msg
/opensaf-code124/lib/.libs# nm libSaNtf.so.0.1.2 | grep 
ntfsv_enc_read_finalize_msg
 U ntfsv_enc_read_finalize_msg


Thank you
Srinivas


-Original Message-
From: Minh Hon Chau [mailto:minh.c...@dektech.com.au] 
Sent: Monday, January 29, 2018 9:31 AM
To: Lennart Lund <lennart.l...@ericsson.com>; Srinivas Mangipudy 
<srinivas.mangip...@oracle.com>; Canh Van Truong <canh.v.tru...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/3] Review Request for ntf: Checkpoint and cold sync 
reader information [#2757]

Hi all,

If the patch look ok to you, I would like to push it tomorrow.

I have updated the README and PR doc at the below links, if you have time 
please have a look.

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_77619155_0a9b_attachment_2757-5FREADME.diff=DwICaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc=osczasl2Lxg-StyK-9Qs8XrvtTj1nnJlBEL2dDIxGEA=

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_opensaf_tickets_-5Fdiscuss_thread_5671255e_16a4_attachment_OpenSAF-5FNTFSv-5FPR-5F2735.odt=DwICaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=Il9ed4kUdHBl1sTtKy3I0G6rJMuUcnoSKhdIxIWTFfc=riEHgZ3x2z9W8UtUxMo2tiD03svlKxireGpdVHRegvw=

Thanks,

Minh


On 24/01/18 12:49,  HYPERLINK "mailto:minh.c...@dektech.com.au; 
minh.c...@dektech.com.au wrote:
> Hi Lennart,
>
> I tested the APIs between versions with/without the changes. I will 
> send out for review the README and PR change after the code review is 
> done. One limitation is that both active and standby require the patches to 
> work.
>
> Thanks,
> Minh
>
>> Hi Minh
>>
>> Ack. I have not tested much
>>
>> Have you tested using the reader API while running old version on 
>> standby and new version on active and vice versa (upgrade case)? Limitations?
>> PR documentation update?
>>
>> Thanks
>> Lennart
>>
>>> -Original Message-
>>> From: Minh Hon Chau
>>> Sent: den 22 januari 2018 05:19
>>> To: Lennart Lund < HYPERLINK "mailto:lennart.l...@ericsson.com; 
>>> lennart.l...@ericsson.com>; 
>>>  HYPERLINK "mailto:srinivas.mangip...@oracle.com; 
>>> srinivas.mangip...@oracle.com; Canh Van Truong 
>>> < HYPERLINK "mailto:canh.v.tru...@dektech.com.au; 
>>> canh.v.tru...@dektech.com.au>
>>> Cc:  HYPERLINK "mailto:opensaf-devel@lists.sourceforge.net; 
>>> opensaf-devel@lists.sourceforge.net; Minh Hon Chau 
>>> < HYPERLINK "mailto:minh.c...@dektech.com.au; minh.c...@dektech.com.au>
>>> Subject: [PATCH 0/3] Review Request for ntf: Checkpoint and cold 
>>> sync reader information [#2757]
>>>
>>> Summary: ntfd: Checkpoint reader to the standby when processes 
>>> reader API requests [#2757] Review request for Ticket(s): 2757 Peer 
>>> Reviewer(s): Lennart, Srinivas, Canh Pull request to: *** LIST THE 
>>> PERSON WITH PUSH ACCESS HERE *** Affected branch(es): develop 
>>> Development branch: ticket-2757 Base revision: 
>>> ee105cb3bf44eee4e8785e3de7d24f907641e2ab
>>> Personal repository: git://git.code.sf.net/u/minh-chau/review
>>>
>>> 
>>> 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
>>>
>>> NOTE: Patch(es) contain lines longer than 80 characers
>>>
>>> Comments (indica

Re: [devel] [PATCH 1/1] log: fix to reject creating log streams with same file name in same CCB [#2752]

2018-01-17 Thread Srinivas Mangipudy
Hi Canh,

Ack from my end, but I suspect a potential memory leak.

Say we are creating many log streams in a single CCB operation and there is a 
switch over, then we will not delete the elements in the vector, since we will 
call "goto done" and the memory is cleared before the "done" label.

if (lgs_cb->ha_state != SA_AMF_HA_ACTIVE) {
TRACE("State Not Active. Nothing to do, we are an applier");
goto done;
  }

Thank you
Srinivas

-Original Message-
From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au] 
Sent: Thursday, January 11, 2018 3:04 PM
To: lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au; 
srinivas.mangip...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Canh Van Truong 

Subject: [PATCH 1/1] log: fix to reject creating log streams with same file 
name in same CCB [#2752]

LOG server should not allow creating streams which have the same target local 
log file
---
 src/log/logd/lgs_imm.cc | 49 +
 1 file changed, 37 insertions(+), 12 deletions(-)

diff --git a/src/log/logd/lgs_imm.cc b/src/log/logd/lgs_imm.cc index 
2c918555b..84411fc0e 100644
--- a/src/log/logd/lgs_imm.cc
+++ b/src/log/logd/lgs_imm.cc
@@ -82,6 +82,11 @@ static const SaImmClassNameT logConfig_str =  static const 
SaImmClassNameT streamConfig_str =
 const_cast("SaLogStreamConfig");
 
+// The list contains path-file names when validating its name in CCB 
+completed // callback. This help for log service prevents that creating 
+any streams // in same CCB with duplicated log path-file name 
+std::vector file_path_list;
+
 /* FUNCTIONS
  * -
  */
@@ -1034,8 +1039,8 @@ static lgs_stream_defval_t 
*get_SaLogStreamConfig_default() {  }
 
 /**
- * Check if a stream with the same file name and relative path already
- * exist
+ * Check if file name and relative path of new stream are duplicated 
+ with
+ * a stream that already exists or in same CCB
  *
  * @param immOiHandle
  * @param fileName
@@ -1044,9 +1049,10 @@ static lgs_stream_defval_t 
*get_SaLogStreamConfig_default() {
  * @param operationType
  * @return true if exists
  */
-bool chk_filepath_stream_exist(std::string , std::string ,
-   log_stream_t *stream,
-   enum CcbUtilOperationType operationType) {
+static bool check_duplicated_file_path(
+std::string , std::string ,
+log_stream_t *stream,
+enum CcbUtilOperationType operationType) {
   log_stream_t *i_stream = NULL;
   std::string i_fileName;
   std::string i_pathName;
@@ -1097,9 +1103,18 @@ bool chk_filepath_stream_exist(std::string , 
std::string ,
 osafassert(0);
   }
 
-  /* Check if any stream has given filename and path */
-  TRACE("Check if any stream has given filename and path");
-  // Iterate all existing log streams in cluster.
+  TRACE("Check if filename and pathname are duplicated");
+
+  // Check if any streams in the same CCB has given filename and 
+ pathname  for (auto file_path : file_path_list) {
+if (*file_path == (i_pathName + i_fileName)) {
+  return true;
+}
+  }
+  std::string *file_path_name = new std::string(i_pathName + 
+ i_fileName);  file_path_list.push_back(file_path_name);
+
+  // Check if any current streams has given filename and pathname
   SaBoolT endloop = SA_FALSE, jstart = SA_TRUE;
   while ((i_stream = iterate_all_streams(endloop, jstart)) && !endloop) {
 jstart = SA_FALSE;
@@ -1562,13 +1577,13 @@ static SaAisErrorT check_attr_validity(
 goto done;
   }
 
-  if (chk_filepath_stream_exist(i_fileName, i_pathName, stream,
-opdata->operationType)) {
+  if (check_duplicated_file_path(i_fileName, i_pathName, stream,
+ opdata->operationType)) {
 report_oi_error(immOiHandle, opdata->ccbId,
-"Path/file %s/%s already exist", i_pathName.c_str(),
+"Path/file %s/%s is duplicated", 
+ i_pathName.c_str(),
 i_fileName.c_str());
 rc = SA_AIS_ERR_BAD_OPERATION;
-TRACE("Path/file %s/%s already exist", i_pathName.c_str(),
+TRACE("Path/file %s/%s is duplicated", i_pathName.c_str(),
   i_fileName.c_str());
 goto done;
   }
@@ -1864,6 +1879,15 @@ static SaAisErrorT ccbCompletedCallback(SaImmOiHandleT 
immOiHandle,
 assert(0);
 break;
 }
+
+if (rc != SA_AIS_OK) break;
+  }
+
+  // Deleting all elements in "file_path_list" list  for (auto it = 
+ file_path_list.begin(); it != file_path_list.end();) {
+std::string *name = *it;
+it = file_path_list.erase(it);
+delete name;
   }
 
 done:
@@ -1875,6 +1899,7 @@ done:
   TRACE_LEAVE2("rc = %u", cb_rc);
   return cb_rc;
 }
+
 /**
  * Set logRootDirectory to new value
  *   - Close all open logfiles
--
2.15.1

--
Check out the vibrant 

Re: [devel] [PATCH 0/2] Review Request for ntf: Support cold sync for cached alarms [#2375]

2018-01-10 Thread Srinivas Mangipudy
Hi Minh,

Ack from my end.

Thank you
Srinivas

-Original Message-
From: Minh Chau [mailto:minh.c...@dektech.com.au] 
Sent: Thursday, January 4, 2018 12:06 PM
To: lennart.l...@ericsson.com; srinivas.mangip...@oracle.com; 
canh.v.tru...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net; Minh Chau 
Subject: [PATCH 0/2] Review Request for ntf: Support cold sync for cached 
alarms [#2375]

Summary: ntfd: Add cached alarms for cold sync [#2735] Review request for 
Ticket(s): 2735 Peer Reviewer(s): Lennart, Srinivas, Canh Pull request to: *** 
LIST THE PERSON WITH PUSH ACCESS HERE *** Affected branch(es): develop 
Development branch: ticket-2735 Base revision: 
60f929be8d7414257ecf90461f923b6f40ed3ac7
Personal repository: git://git.code.sf.net/u/minh-chau/review


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

NOTE: Patch(es) contain lines longer than 80 characers

Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 725139c5df3cc0e208679f18a73ef874c5302755
Author: Minh Chau 
Date:   Thu, 4 Jan 2018 17:28:25 +1100

ntftest: Add new test case for cold sync of cached alarms [#2735]

Patch add new test case of new suite 41 to test saNtfNotificationReadNext after 
the cold sync of cached alarm



revision 2e45ed8d798857c0613954a77f7b7169ca74f3bf
Author: Minh Chau 
Date:   Wed, 3 Jan 2018 15:35:19 +1100

ntfd: Add cached alarms for cold sync [#2735]

Patch adds the alarm and security alarm notifications to cold sync towards the 
standby NTFD, increase mbcsv version to avoid confusion with old NTFD



Added Files:

 src/ntf/apitest/tet_coldsync.c


Complete diffstat:
--
 src/ntf/Makefile.am   |   3 +-
 src/ntf/apitest/tet_coldsync.c| 211 ++
 src/ntf/apitest/tet_ntf.h |   2 +
 src/ntf/apitest/tet_ntf_common.c  |  97 +-
 src/ntf/apitest/tet_ntf_common.h  |   2 +
 src/ntf/apitest/tet_ntf_main.c|   3 +
 src/ntf/apitest/tet_scOutage_reinitializeHandle.c |  77 +---
 src/ntf/ntfd/NtfAdmin.cc  |  33 +++-
 src/ntf/ntfd/NtfAdmin.h   |   3 +
 src/ntf/ntfd/NtfLogger.cc |  16 ++
 src/ntf/ntfd/NtfLogger.h  |   1 +
 src/ntf/ntfd/NtfNotification.cc   |  15 ++
 src/ntf/ntfd/NtfNotification.h|   1 +
 src/ntf/ntfd/ntfs_com.c   |  11 ++
 src/ntf/ntfd/ntfs_com.h   |   5 +
 src/ntf/ntfd/ntfs_mbcsv.c |  45 -
 src/ntf/ntfd/ntfs_mbcsv.h |   3 +-
 17 files changed, 446 insertions(+), 82 deletions(-)


Testing Commands:
-
Run legacy ntftest and new test of suite 41


Testing, Expected Results:
--
All pass


Conditions of Submission:
-
ack from reviewers


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


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


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

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

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

___ Your patches do not have proper short+long header

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

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

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

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

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

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

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

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

___ You need to refactor your 

Re: [devel] [PATCH 1/1] ntf: fix NtfAdmin is null [#2747]

2017-12-26 Thread Srinivas Mangipudy
Hi Canh,

Ack from my end, not tested.

Regards
Srinivas

-Original Message-
From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au] 
Sent: Friday, December 22, 2017 12:00 PM
To: minh.c...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1/1] ntf: fix NtfAdmin is null [#2747]

NtfAdmin object has not yet created before ntf_mds has callback during ntfd 
start.

NtfAdmin should be created before initialize mds in ntfd
---
 src/ntf/ntfd/ntfs_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/ntf/ntfd/ntfs_main.c b/src/ntf/ntfd/ntfs_main.c index 
c892656..2054205 100644
--- a/src/ntf/ntfd/ntfs_main.c
+++ b/src/ntf/ntfd/ntfs_main.c
@@ -270,6 +270,8 @@ uint32_t initialize_for_assignment(ntfs_cb_t *cb, 
SaAmfHAStateT ha_state)
}
cb->ha_state = ha_state;
init_ntfimcn(ha_state);
+   initAdmin();
+   saflog_init();
if ((rc = ntfs_mds_init(cb, ha_state)) != NCSCC_RC_SUCCESS) {
LOG_ER("ntfs_mds_init FAILED %d", rc);
goto done;
@@ -279,8 +281,6 @@ uint32_t initialize_for_assignment(ntfs_cb_t *cb, 
SaAmfHAStateT ha_state)
ntfs_mds_finalize(cb);
goto done;
}
-   initAdmin();
-   saflog_init();
 
cb->fully_initialized = true;
 done:
--
1.9.1


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! 
https://urldefense.proofpoint.com/v2/url?u=http-3A__sdm.link_slashdot=DwICAg=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=zuzeiap3LDa4Biu5vbvGjJfhVjtOfDfU3VzjdoPSeNQ=QJsnLXDDR30_nfJm4gKEmXeme80TOlXDNUjUeYwhiGo=
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_opensaf-2Ddevel=DwICAg=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=rU6x356sikQZSi7Ttc2DuiqAgbc0QIeANg72N5AllVc=zuzeiap3LDa4Biu5vbvGjJfhVjtOfDfU3VzjdoPSeNQ=9asLdnVJ1HWksI6BnYVzwrh826uNJwvVbWlE3S60o-0=

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


Re: [devel] [PATCH 1/1] ntf: fix [fix ntfd remove client in standby node while not finalize in active node [#2705]

2017-12-19 Thread Srinivas Mangipudy
Hi Canh,

Ack from my end, did not test.

Thank you
Srinivas

-Original Message-
From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au] 
Sent: Monday, December 18, 2017 10:22 AM
To: minh.c...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1/1] ntf: fix [fix ntfd remove client in standby node 
while not finalize in active node [#2705]

The issue happen because the clients are removed in both active and standby 
node when getting NCSMDS_DOWN event. In standby node, ntfd get NCSMDS_DOWN 
event is slower than next initialize request.
This cause the ntfd will removed all client from data base including new client 
of next initialze.
Any action relate to this client will fail.

Before putting NCSMDS_DOWN event down in mbx, the patch set  clients down flag. 
And standby ntfd only remove the clients belong of mds_dest down and have flag 
down
---
 src/ntf/ntfd/NtfAdmin.cc  | 62 +++
 src/ntf/ntfd/NtfAdmin.h   |  6 +
 src/ntf/ntfd/NtfClient.cc | 11 ++---  src/ntf/ntfd/NtfClient.h  |  6 +
 src/ntf/ntfd/ntfs_com.h   |  2 ++
 src/ntf/ntfd/ntfs_evt.c   |  8 --
 src/ntf/ntfd/ntfs_mds.c   | 11 -
 7 files changed, 100 insertions(+), 6 deletions(-)

diff --git a/src/ntf/ntfd/NtfAdmin.cc b/src/ntf/ntfd/NtfAdmin.cc index 
dad00383d..cfba836fd 100644
--- a/src/ntf/ntfd/NtfAdmin.cc
+++ b/src/ntf/ntfd/NtfAdmin.cc
@@ -29,6 +29,7 @@
 
 #include "ntf/ntfd/NtfAdmin.h"
 #include "base/logtrace.h"
+#include "base/osaf_utility.h"
 #include "ntf/common/ntfsv_mem.h"
 
 NtfAdmin *NtfAdmin::theNtfAdmin = NULL; @@ -42,6 +43,9 @@ NtfAdmin::NtfAdmin() 
{
   // initilalize variables
   notificationIdCounter = 0;
   clientIdCounter = 0;
+
+  // Initialize @client_down_mutex
+  pthread_mutex_init(_down_mutex, nullptr);
 }
 
 NtfAdmin::~NtfAdmin() {}
@@ -95,10 +99,13 @@ void NtfAdmin::clientAdded(unsigned int clientId, MDS_DEST 
mdsDest,
 rc = SA_AIS_ERR_EXIST;
   } else {
 // store new client in clientMap
+osaf_mutex_lock_ordie(_down_mutex);
 clientMap[client->getClientId()] = client;
+osaf_mutex_unlock_ordie(_down_mutex);
 TRACE_1("NtfAdmin::clientAdded client %u added, clientMap size is %u",
 client->getClientId(), (unsigned int)clientMap.size());
   }
+
   if (NULL != mdsCtxt) {
 client_added_res_lib(rc, clientId, mdsDest, mdsCtxt, version);
   }
@@ -418,18 +425,22 @@ void 
NtfAdmin::notificationLoggedConfirmed(SaNtfIdentifierT notificationId) {
  */
 void NtfAdmin::clientRemoved(unsigned int clientId) {
   // find client
+  TRACE_ENTER2("client_id: %d", clientId);
   ClientMap::iterator pos;
   pos = clientMap.find(clientId);
   if (pos != clientMap.end()) {
 // client found
+osaf_mutex_lock_ordie(_down_mutex);
 NtfClient *client = pos->second;
 delete client;
 // remove client from client map
 clientMap.erase(pos);
+osaf_mutex_unlock_ordie(_down_mutex);
   } else {
 TRACE_2("NtfAdmin::clientRemoved client %u not found", clientId);
 return;
   }
+
   // notifications do not need to be sent to that client, remove them
   // scan through all notifications, remove subscriptions belonging to
   //  the removed client
@@ -467,6 +478,46 @@ void NtfAdmin::clientRemoveMDS(MDS_DEST mds_dest) {  }
 
 /**
+  * Remove the clients that belong to the ntfa down at standby node.
+  *
+  * @param mds_dest
+  */
+void NtfAdmin::ClientsDownRemoved(MDS_DEST mds_dest) {
+  TRACE_ENTER2("MDS_DEST: %" PRIu64, mds_dest);
+  auto it = clientMap.begin();
+
+  while (it != clientMap.end()) {
+NtfClient *client = it->second;
+++it;  // Increase here to avoid invalid iterator after client removed
+if (client->getMdsDest() == mds_dest && client->GetClientDownFlag()) {
+  clientRemoved(client->getClientId());
+}
+  }
+  TRACE_LEAVE();
+}
+
+/**
+ * Set flag for the clients that belong to the ntfa down. This is set 
+on mds
+ * thread and the clients are removed in ntfd thread.
+ * Help to prevent the disorder of coming between 
+NTFSV_NTFS_EVT_NTFA_DOWN event
+ * and checkpoint of NTFSV_NTFS_NTFSV_MSG requests. (Ticket #2705)
+ *
+ * @param mds_dest
+ */
+void NtfAdmin::SetClientsDownFlag(MDS_DEST mds_dest) {
+  TRACE_ENTER();
+  osaf_mutex_lock_ordie(_down_mutex);
+  for (const auto  : clientMap) {
+NtfClient *client = it.second;
+if (client->getMdsDest() == mds_dest) {
+  client->SetClientDownFlag();
+}
+  }
+  osaf_mutex_unlock_ordie(_down_mutex);
+  TRACE_LEAVE();
+}
+
+/**
  * The node object where the client who had the subscription is notified
  * so it can delete the appropriate subscription and filter object.
  *
@@ -987,11 +1038,22 @@ void clientRemoved(unsigned int clientId) {
   osafassert(NtfAdmin::theNtfAdmin != NULL);
   NtfAdmin::theNtfAdmin->clientRemoved(clientId);
 }
+
 void clientRemoveMDS(MDS_DEST mds_dest) {
   osafassert(NtfAdmin::theNtfAdmin != NULL);
   NtfAdmin::theNtfAdmin->clientRemoveMDS(mds_dest);
 }
 
+void 

Re: [devel] [PATCH 0/1] Review Request for log: Added retry logic for RT object creation call fails due to timeout error [#2711]

2017-12-13 Thread Srinivas Mangipudy
Hi Lennart,

I agree.  Since there is already a ticket 1531 to handle this scenario in a 
separate thread, I will close this issue as duplicate.

Thank you
Srinivas

-Original Message-
From: Lennart Lund [mailto:lennart.l...@ericsson.com] 
Sent: Wednesday, December 13, 2017 4:30 PM
To: Srinivas ; Vu Minh Nguyen 
; Canh Van Truong 
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 0/1] Review Request for log: Added retry logic for RT 
object creation call fails due to timeout error [#2711]

Hi Srinivas

Is this really a defect?
The API for creating a new log stream is synchronous and if the log server 
fails to create the stream, in this case because the stream object could not be 
created, it will report the fail back to the agent and the agent will reply 
with TRY AGAIN to the client. The basic thinking around recoverable problems is 
to let the client decide whether it is relevant to try again or not.

Thanks
Lennart

> -Original Message-
> From: Srinivas [mailto:srinivas.mangip...@oracle.com]
> Sent: den 4 december 2017 10:34
> To: Lennart Lund ; Vu Minh Nguyen 
> 
> Cc: opensaf-devel@lists.sourceforge.net; Srinivas 
> 
> Subject: [PATCH 0/1] Review Request for log: Added retry logic for RT 
> object creation call fails due to timeout error [#2711]
> 
> Summary: log: Added retry logic for RT object creation call fails due 
> to timeout error [#2711] Review request for Ticket(s): 2711 Peer 
> Reviewer(s): *** LIST THE TECH REVIEWER(S) / MAINTAINER(S) HERE
> ***
> Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE *** 
> Affected branch(es): develop Development branch: ticket-2711 Base 
> revision: d40172a1afb2f95afdb6b6b5cf4804d559ac6c50
> Personal repository: git://git.code.sf.net/u/sri-mangipudy/review
> 
> 
> 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):
> -
> Added retry logic for RT object creation call fails due to timeout 
> error
> 
> revision 18ade0da54361ca3655daac7542c87eac56dadd7
> Author:   Srinivas 
> Date: Mon, 4 Dec 2017 14:14:07 +0530
> 
> log: Added retry logic for RT object creation call fails due to 
> timeout error [#2711]
> 
> 
> 
> Complete diffstat:
> --
>  src/log/logd/lgs_stream.cc | 44 +++-
> 
>  1 file changed, 31 insertions(+), 13 deletions(-)
> 
> 
> Testing Commands:
> -
> 1. Keep only SC-1 up.
> 2. Trigger to suspend immnd(e.i, use SIGSTOP) in the time log client 
> processing saLogStreamOpen_2() to create runtime stream.
> 3. Continue immnd(e.i, SIGCONT) after catching 
> "saImmOiRtObjectCreate_2 returned 5" in syslog.
> 
> Testing, Expected Results:
> --
> *** PASTE COMMAND OUTPUTS / TEST RESULTS ***
> 
> 
> Conditions of Submission:
> -
> *** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***
> 
> 
> 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 

Re: [devel] [PATCH 1/1] log: fix coredump when stop cluster [#2700]

2017-12-07 Thread Srinivas Mangipudy
Hi Canh,

Ack from my end, not tested.


Thank you
Srinivas

-Original Message-
From: Canh Van Truong [mailto:canh.v.tru...@dektech.com.au] 
Sent: Thursday, November 23, 2017 4:17 PM
To: lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au; 
srinivas.mangip...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Canh Van Truong 

Subject: [PATCH 1/1] log: fix coredump when stop cluster [#2700]

The problem happen because the iterator after erasing the element will be 
invalid.

The patch fix to increase the iterator before delete client
---
 src/log/logd/lgs_evt.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/log/logd/lgs_evt.cc b/src/log/logd/lgs_evt.cc index 
94a94b646..c01680c49 100644
--- a/src/log/logd/lgs_evt.cc
+++ b/src/log/logd/lgs_evt.cc
@@ -333,9 +333,9 @@ int lgs_client_delete_by_mds_dest(MDS_DEST mds_dest, time_t 
*closetime_ptr) {
   TRACE_ENTER2("mds_dest %" PRIx64, mds_dest);
   /* Loop through Client DB */
   ClientMap *clientMap(reinterpret_cast(client_db));
-  for (const auto  : *clientMap) {
-rp = value.second;
-
+  for (auto it = clientMap->begin(); it != clientMap->end(); ) {
+rp = it->second;
+it++;
 if (m_NCS_MDS_DEST_EQUAL(>mds_dest, _dest))
   rc = lgs_client_delete(rp->client_id, closetime_ptr);
   }
--
2.13.0

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


Re: [devel] [PATCH 1/1] msgd: fix double delete of node info [#2712]

2017-11-30 Thread Srinivas Mangipudy
Hi Alex,

Ack, Code review only.

Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Thursday, November 30, 2017 1:14 AM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 1/1] msgd: fix double delete of node info [#2712]

msgd can crash if multiple nodes in the cluster are rebooted at the same time.

"is_node_down" and "is_clm_down" can both be set to true, if the CLM tracking 
callback comes in quickly. If this occurs during middleware failover, the 
cleanup code in msgd can cause a crash because it tries to delete the same node 
twice.

Don't delete the same node twice.
---
 src/msg/msgd/mqd_saf.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/msg/msgd/mqd_saf.c b/src/msg/msgd/mqd_saf.c index 
10ac817..28a8338 100644
--- a/src/msg/msgd/mqd_saf.c
+++ b/src/msg/msgd/mqd_saf.c
@@ -268,12 +268,12 @@ void mqd_saf_csi_set_cb(SaInvocationT invocation, const 
SaNameT *compName,
}
}
}
-   if (pNdNode->info.is_node_down == true) {
+
+   if (pNdNode->info.is_node_down == true)
mqd_tmr_stop(>info.timer);
-   mqd_del_node_down_info(pMqd, nodeid);
-   mqd_red_db_node_del(pMqd, pNdNode);
-   }
-   if (pNdNode->info.is_clm_down == true) {
+
+   if (pNdNode->info.is_clm_down ||
+   pNdNode->info.is_node_down) {
mqd_red_db_node_del(pMqd, pNdNode);
mqd_del_node_down_info(pMqd, nodeid);
}
--
2.9.5


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


Re: [devel] [PATCH 1/1] msg: add support for critical capacity thresholds [#2625]

2017-11-10 Thread Srinivas Mangipudy
Hi Alex,

ACK from my side.

Thank you
Srinivas


-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Tuesday, November 7, 2017 11:45 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 1/1] msg: add support for critical capacity thresholds [#2625]

This commit implements Sections 3.4.12 and 6.2.2 of the B.03.01 MSG spec.
---
 src/msg/Makefile.am|8 +-
 src/msg/agent/mqa_api.c|  330 +
 src/msg/apitest/test_CapacityThresholds.cc | 1049 
 src/msg/apitest/test_ErrUnavailable.cc |  110 ++-
 src/msg/common/mqsv_edu.c  |   74 +-
 src/msg/common/mqsv_evt.h  |   15 +-
 src/msg/msgd/mqd_api.c |   64 +-
 src/msg/msgd/mqd_db.h  |4 +
 src/msg/msgd/mqd_ntf.cc|  310 
 src/msg/msgd/mqd_ntf.h |   49 ++
 src/msg/msgnd/mqnd_db.h|6 +
 src/msg/msgnd/mqnd_evt.c   |  359 +-
 src/msg/msgnd/mqnd_imm.c   |5 +-
 src/msg/msgnd/mqnd_util.c  |4 +
 14 files changed, 2374 insertions(+), 13 deletions(-)
 create mode 100644 src/msg/apitest/test_CapacityThresholds.cc
 create mode 100644 src/msg/msgd/mqd_ntf.cc
 create mode 100644 src/msg/msgd/mqd_ntf.h

diff --git a/src/msg/Makefile.am b/src/msg/Makefile.am
index aeec6ca..c308072 100644
--- a/src/msg/Makefile.am
+++ b/src/msg/Makefile.am
@@ -97,6 +97,7 @@ noinst_HEADERS += \
src/msg/msgd/mqd_dl_api.h \
src/msg/msgd/mqd_imm.h \
src/msg/msgd/mqd_mem.h \
+   src/msg/msgd/mqd_ntf.h \
src/msg/msgd/mqd_red.h \
src/msg/msgd/mqd_saf.h \
src/msg/msgd/mqd_tmr.h \
@@ -158,6 +159,7 @@ bin_osafmsgnd_LDADD = \
lib/libmsg_common.la \
lib/libSaAmf.la \
lib/libSaClm.la \
+   lib/libSaNtf.la \
lib/libosaf_common.la \
lib/libSaImmOi.la \
lib/libSaImmOm.la \
@@ -182,7 +184,8 @@ bin_osafmsgd_SOURCES = \
src/msg/msgd/mqd_mds.c \
src/msg/msgd/mqd_red.c \
src/msg/msgd/mqd_saf.c \
-   src/msg/msgd/mqd_tmr.c
+   src/msg/msgd/mqd_tmr.c \
+   src/msg/msgd/mqd_ntf.cc
 
 bin_osafmsgd_LDADD = \
lib/libmsg_common.la \
@@ -191,6 +194,7 @@ bin_osafmsgd_LDADD = \
lib/libosaf_common.la \
lib/libSaImmOi.la \
lib/libSaImmOm.la \
+   lib/libSaNtf.la \
lib/libopensaf_core.la
 
 if ENABLE_TESTS
@@ -205,6 +209,7 @@ noinst_HEADERS += \
 bin_msgtest_SOURCES = \
   src/msg/apitest/msgtest.c \
   src/msg/apitest/test_saMsgVersionT.cc \
+  src/msg/apitest/test_CapacityThresholds.cc \
   src/msg/apitest/test_ErrUnavailable.cc \
   src/msg/apitest/tet_mqa_conf.c \
   src/msg/apitest/tet_mqsv_util.c \
@@ -212,6 +217,7 @@ bin_msgtest_SOURCES = \
 
 bin_msgtest_LDADD = \
   lib/libSaMsg.la \
+  lib/libSaNtf.la \
   lib/libopensaf_core.la \
   lib/libapitest.la
 
diff --git a/src/msg/agent/mqa_api.c b/src/msg/agent/mqa_api.c
index eeec00e..0070aaf 100644
--- a/src/msg/agent/mqa_api.c
+++ b/src/msg/agent/mqa_api.c
@@ -5600,6 +5600,336 @@ done:
return rc;
 }
 
+/
+  Name  : saMsgQueueCapacityThresholdsSet
+
+  Description   : This routine sets the critical capacity thresholds for the
+ queue.
+
+  Arguments : SaMsgQueueHandleT queueHandle
+   : const SaMsgQueueThresholdsT *thresholds
+
+  Return Values : SaAisErrorT
+
+  Notes : None
+**/
+SaAisErrorT saMsgQueueCapacityThresholdsSet(SaMsgQueueHandleT queueHandle,
+   const SaMsgQueueThresholdsT *thresholds)
+{
+   SaAisErrorT rc = SA_AIS_OK;
+   MQA_CB *mqa_cb;
+   bool locked = false;
+
+   do {
+   MQSV_EVT cap_evt;
+   MQSV_EVT *out_evt = 0;
+   MQA_QUEUE_INFO *queue_node;
+   uint8_t mds_rc;
+   int i;
+
+   TRACE_ENTER2("SaMsgQueueHandle %llu ", queueHandle);
+
+   /* retrieve MQA CB */
+   mqa_cb = (MQA_CB *)m_MQSV_MQA_RETRIEVE_MQA_CB;
+   if (!mqa_cb) {
+   TRACE_2("ERR_BAD_HANDLE: Control block retrieval "
+   "failed");
+   rc = SA_AIS_ERR_BAD_HANDLE;
+   break;
+   }
+
+   if (m_NCS_LOCK(_cb->cb_lock, NCS_LOCK_WRITE) !=
+   NCSCC_RC_SUCCESS) {
+   TRACE_4("ERR_LIBRARY: Lock failed for control block "
+   "write");
+   rc = SA_AIS_ERR_LIBRARY;
+  

Re: [devel] [PATCH 1/1] msg: add support for critical capacity thresholds [#2625]

2017-11-08 Thread Srinivas Mangipudy
Hi Alex,

 

I agree, but should we not skip running this test, in case if we are executing 
it on active controller?

 

Thank you

Srinivas

 

From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Wednesday, November 8, 2017 6:44 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] msg: add support for critical capacity thresholds 
[#2625]

 

Hi Srinivas,

 

  You need to run that test on a node that is not the active controller.

 

Alex

  _  

From: Srinivas Mangipudy mailto:srinivas.mangip...@oracle.com"srinivas.mangip...@oracle.com>
Sent: Wednesday, November 8, 2017 4:19:14 AM
To: Alex Jones
Cc: HYPERLINK 
"mailto:opensaf-devel@lists.sourceforge.net"opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] msg: add support for critical capacity thresholds 
[#2625] 

 

  _  

NOTICE: This email was received from an EXTERNAL sender

  _  

 

Hi Alex,

I executed "msgtest" and it failed with the below error:

Suite 26: SA_AIS_ERR_UNAVAILABLE Test Suite

error - saImmOmAdminOperationInvoke_2 admin-op RETURNED: 
SA_AIS_ERR_NOT_SUPPORTED (19)

The process tried to execute the command "immadm -o 2 
safNode=SC-2,safCluster=myClmCluster" and it returned SA_AIS_ERR_NOT_SUPPORTED 
error.

Logs had below info:

Nov  8 14:42:45 osaf-VirtualBox osafclmd[3943]: NO Lock on active node not 
allowed

Nov  8 14:42:45 osaf-VirtualBox osafclmd[3943]: NO clms_imm_node_lock failed

Nov  8 14:43:20 osaf-VirtualBox osafclmd[3943]: NO Lock on active node not 
allowed

Nov  8 14:43:20 osaf-VirtualBox osafclmd[3943]: NO clms_imm_node_lock failed

Thank you

Srinivas

-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com]
Sent: Tuesday, November 7, 2017 11:45 PM
To: Srinivas Mangipudy mailto:srinivas.mangip...@oracle.com"srinivas.mangip...@oracle.com>
Cc: HYPERLINK 
"mailto:opensaf-devel@lists.sourceforge.net"opensaf-devel@lists.sourceforge.net;
 Alex Jones mailto:alex.jo...@genband.com"alex.jo...@genband.com>
Subject: [PATCH 1/1] msg: add support for critical capacity thresholds [#2625]

This commit implements Sections 3.4.12 and 6.2.2 of the B.03.01 MSG spec.

---

 src/msg/Makefile.am|8 +-

 src/msg/agent/mqa_api.c|  330 +

 src/msg/apitest/test_CapacityThresholds.cc | 1049 

 src/msg/apitest/test_ErrUnavailable.cc |  110 ++-

 src/msg/common/mqsv_edu.c  |   74 +-

 src/msg/common/mqsv_evt.h  |   15 +-

 src/msg/msgd/mqd_api.c |   64 +-

 src/msg/msgd/mqd_db.h  |4 +

 src/msg/msgd/mqd_ntf.cc|  310 

 src/msg/msgd/mqd_ntf.h |   49 ++

 src/msg/msgnd/mqnd_db.h|6 +

 src/msg/msgnd/mqnd_evt.c   |  359 +-

 src/msg/msgnd/mqnd_imm.c   |5 +-

 src/msg/msgnd/mqnd_util.c  |4 +

 14 files changed, 2374 insertions(+), 13 deletions(-)

 create mode 100644 src/msg/apitest/test_CapacityThresholds.cc

 create mode 100644 src/msg/msgd/mqd_ntf.cc

 create mode 100644 src/msg/msgd/mqd_ntf.h

diff --git a/src/msg/Makefile.am b/src/msg/Makefile.am

index aeec6ca..c308072 100644

--- a/src/msg/Makefile.am

+++ b/src/msg/Makefile.am

@@ -97,6 +97,7 @@ noinst_HEADERS += \

src/msg/msgd/mqd_dl_api.h \

src/msg/msgd/mqd_imm.h \

src/msg/msgd/mqd_mem.h \

+   src/msg/msgd/mqd_ntf.h \

src/msg/msgd/mqd_red.h \

src/msg/msgd/mqd_saf.h \

src/msg/msgd/mqd_tmr.h \

@@ -158,6 +159,7 @@ bin_osafmsgnd_LDADD = \

lib/libmsg_common.la \

lib/libSaAmf.la \

lib/libSaClm.la \

+   lib/libSaNtf.la \

lib/libosaf_common.la \

lib/libSaImmOi.la \

lib/libSaImmOm.la \

@@ -182,7 +184,8 @@ bin_osafmsgd_SOURCES = \

src/msg/msgd/mqd_mds.c \

src/msg/msgd/mqd_red.c \

src/msg/msgd/mqd_saf.c \

-   src/msg/msgd/mqd_tmr.c

+   src/msg/msgd/mqd_tmr.c \

+   src/msg/msgd/mqd_ntf.cc

 

 bin_osafmsgd_LDADD = \

lib/libmsg_common.la \

@@ -191,6 +194,7 @@ bin_osafmsgd_LDADD = \

lib/libosaf_common.la \

lib/libSaImmOi.la \

lib/libSaImmOm.la \

+   lib/libSaNtf.la \

lib/libopensaf_core.la

 

 if ENABLE_TESTS

@@ -205,6 +209,7 @@ noinst_HEADERS += \

 bin_msgtest_SOURCES = \

   src/msg/apitest/msgtest.c \

   src/msg/apitest/test_saMsgVersionT.cc \

+  src/msg/apitest/test_CapacityThresholds.cc \

   src/msg/apitest/test_ErrUnavailable.cc \

   src/msg/apitest/tet_mqa_conf.c \

   src/msg/apitest/tet_mqsv_util.c \

@@ -212,6 +217,7 @@ bin_msgtest_SOURCES = \

 

 bin_msgtest_LDADD = \

   lib/libSaMsg.la \

+  lib/libSaNtf.la \

   lib/libopensaf_core.la \

   lib/libapitest.la

 

diff --git a/src/msg/agent/mqa_api

Re: [devel] [PATCH 1/1] msg: add support for critical capacity thresholds [#2625]

2017-11-08 Thread Srinivas Mangipudy
Hi Alex,

I executed "msgtest" and it failed with the below error:

Suite 26: SA_AIS_ERR_UNAVAILABLE Test Suite
error - saImmOmAdminOperationInvoke_2 admin-op RETURNED: 
SA_AIS_ERR_NOT_SUPPORTED (19)

The process tried to execute the command "immadm -o 2 
safNode=SC-2,safCluster=myClmCluster" and it returned SA_AIS_ERR_NOT_SUPPORTED 
error.

Logs had below info:
Nov  8 14:42:45 osaf-VirtualBox osafclmd[3943]: NO Lock on active node not 
allowed
Nov  8 14:42:45 osaf-VirtualBox osafclmd[3943]: NO clms_imm_node_lock failed
Nov  8 14:43:20 osaf-VirtualBox osafclmd[3943]: NO Lock on active node not 
allowed
Nov  8 14:43:20 osaf-VirtualBox osafclmd[3943]: NO clms_imm_node_lock failed

Thank you
Srinivas


-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Tuesday, November 7, 2017 11:45 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 1/1] msg: add support for critical capacity thresholds [#2625]

This commit implements Sections 3.4.12 and 6.2.2 of the B.03.01 MSG spec.
---
 src/msg/Makefile.am|8 +-
 src/msg/agent/mqa_api.c|  330 +
 src/msg/apitest/test_CapacityThresholds.cc | 1049 
 src/msg/apitest/test_ErrUnavailable.cc |  110 ++-
 src/msg/common/mqsv_edu.c  |   74 +-
 src/msg/common/mqsv_evt.h  |   15 +-
 src/msg/msgd/mqd_api.c |   64 +-
 src/msg/msgd/mqd_db.h  |4 +
 src/msg/msgd/mqd_ntf.cc|  310 
 src/msg/msgd/mqd_ntf.h |   49 ++
 src/msg/msgnd/mqnd_db.h|6 +
 src/msg/msgnd/mqnd_evt.c   |  359 +-
 src/msg/msgnd/mqnd_imm.c   |5 +-
 src/msg/msgnd/mqnd_util.c  |4 +
 14 files changed, 2374 insertions(+), 13 deletions(-)
 create mode 100644 src/msg/apitest/test_CapacityThresholds.cc
 create mode 100644 src/msg/msgd/mqd_ntf.cc
 create mode 100644 src/msg/msgd/mqd_ntf.h

diff --git a/src/msg/Makefile.am b/src/msg/Makefile.am
index aeec6ca..c308072 100644
--- a/src/msg/Makefile.am
+++ b/src/msg/Makefile.am
@@ -97,6 +97,7 @@ noinst_HEADERS += \
src/msg/msgd/mqd_dl_api.h \
src/msg/msgd/mqd_imm.h \
src/msg/msgd/mqd_mem.h \
+   src/msg/msgd/mqd_ntf.h \
src/msg/msgd/mqd_red.h \
src/msg/msgd/mqd_saf.h \
src/msg/msgd/mqd_tmr.h \
@@ -158,6 +159,7 @@ bin_osafmsgnd_LDADD = \
lib/libmsg_common.la \
lib/libSaAmf.la \
lib/libSaClm.la \
+   lib/libSaNtf.la \
lib/libosaf_common.la \
lib/libSaImmOi.la \
lib/libSaImmOm.la \
@@ -182,7 +184,8 @@ bin_osafmsgd_SOURCES = \
src/msg/msgd/mqd_mds.c \
src/msg/msgd/mqd_red.c \
src/msg/msgd/mqd_saf.c \
-   src/msg/msgd/mqd_tmr.c
+   src/msg/msgd/mqd_tmr.c \
+   src/msg/msgd/mqd_ntf.cc
 
 bin_osafmsgd_LDADD = \
lib/libmsg_common.la \
@@ -191,6 +194,7 @@ bin_osafmsgd_LDADD = \
lib/libosaf_common.la \
lib/libSaImmOi.la \
lib/libSaImmOm.la \
+   lib/libSaNtf.la \
lib/libopensaf_core.la
 
 if ENABLE_TESTS
@@ -205,6 +209,7 @@ noinst_HEADERS += \
 bin_msgtest_SOURCES = \
   src/msg/apitest/msgtest.c \
   src/msg/apitest/test_saMsgVersionT.cc \
+  src/msg/apitest/test_CapacityThresholds.cc \
   src/msg/apitest/test_ErrUnavailable.cc \
   src/msg/apitest/tet_mqa_conf.c \
   src/msg/apitest/tet_mqsv_util.c \
@@ -212,6 +217,7 @@ bin_msgtest_SOURCES = \
 
 bin_msgtest_LDADD = \
   lib/libSaMsg.la \
+  lib/libSaNtf.la \
   lib/libopensaf_core.la \
   lib/libapitest.la
 
diff --git a/src/msg/agent/mqa_api.c b/src/msg/agent/mqa_api.c
index eeec00e..0070aaf 100644
--- a/src/msg/agent/mqa_api.c
+++ b/src/msg/agent/mqa_api.c
@@ -5600,6 +5600,336 @@ done:
return rc;
 }
 
+/
+  Name  : saMsgQueueCapacityThresholdsSet
+
+  Description   : This routine sets the critical capacity thresholds for the
+ queue.
+
+  Arguments : SaMsgQueueHandleT queueHandle
+   : const SaMsgQueueThresholdsT *thresholds
+
+  Return Values : SaAisErrorT
+
+  Notes : None
+**/
+SaAisErrorT saMsgQueueCapacityThresholdsSet(SaMsgQueueHandleT queueHandle,
+   const SaMsgQueueThresholdsT *thresholds)
+{
+   SaAisErrorT rc = SA_AIS_OK;
+   MQA_CB *mqa_cb;
+   bool locked = false;
+
+   do {
+   MQSV_EVT cap_evt;
+   MQSV_EVT *out_evt = 0;
+   MQA_QUEUE_INFO *queue_node;
+   uint8_t mds_rc;
+   int i;
+
+   TRACE_ENTER2("SaMsgQueueHandle %llu ", queueHandle);
+
+   /* retrieve 

Re: [devel] [PATCH 1/1] msg: fix ERR_UNAVAILABLE code when node leaves and rejoins cluster [#2655]

2017-11-03 Thread Srinivas Mangipudy
Hi Alex,

Ack, code review only.


Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Friday, October 27, 2017 7:30 PM
To: srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 1/1] msg: fix ERR_UNAVAILABLE code when node leaves and rejoins 
cluster [#2655]

APIs return SA_AIS_OK after the node leaves then rejoins cluster.

Section 3.2 of the MSG B.03.01 spec states that if a node leaves then rejoins 
the cluster, APIs need to return ERR_UNAVAILABLE for handles that were obtained 
before the node left the cluster.

APIs need to return ERR_UNAVAILABLE for handles that were obtained before the 
node left the cluster.
---
 src/msg/Makefile.am|1 +
 src/msg/agent/mqa_api.c|   97 +--
 src/msg/agent/mqa_db.h |1 +
 src/msg/agent/mqa_def.h|1 +
 src/msg/agent/mqa_init.c   |   26 +
 src/msg/agent/mqa_mds.c|   14 +
 src/msg/apitest/test_ErrUnavailable.cc | 1009 
 src/msg/msgnd/mqnd_evt.c   |   42 +-
 8 files changed, 1139 insertions(+), 52 deletions(-)  create mode 100644 
src/msg/apitest/test_ErrUnavailable.cc

diff --git a/src/msg/Makefile.am b/src/msg/Makefile.am index 9ec9e59..aeec6ca 
100644
--- a/src/msg/Makefile.am
+++ b/src/msg/Makefile.am
@@ -205,6 +205,7 @@ noinst_HEADERS += \
 bin_msgtest_SOURCES = \
   src/msg/apitest/msgtest.c \
   src/msg/apitest/test_saMsgVersionT.cc \
+  src/msg/apitest/test_ErrUnavailable.cc \
   src/msg/apitest/tet_mqa_conf.c \
   src/msg/apitest/tet_mqsv_util.c \
   src/msg/apitest/tet_mqa.c
diff --git a/src/msg/agent/mqa_api.c b/src/msg/agent/mqa_api.c index 
5ef238a..eeec00e 100644
--- a/src/msg/agent/mqa_api.c
+++ b/src/msg/agent/mqa_api.c
@@ -256,6 +256,7 @@ SaAisErrorT saMsgInitialize(SaMsgHandleT *msgHandle,
}
 
if (rc == SA_AIS_OK) {
+   mqa_cb->clm_node_joined = true;
 
/* create the client node and populate it */
client_info = mqa_client_tree_find_and_add(mqa_cb, 0, true); @@ 
-281,6 +282,8 @@ SaAisErrorT saMsgInitialize(SaMsgHandleT *msgHandle,
goto final3;
}
 
+   client_info->isStale = false;
+
if (msgCallbacks)
client_info->msgCallbacks = *msgCallbacks;
else
@@ -373,8 +376,8 @@ SaAisErrorT saMsgSelectionObjectGet(SaMsgHandleT msgHandle,
goto done;
}
if (client_info->version.majorVersion == MQA_MAJOR_VERSION) {
-   if (!mqa_cb->clm_node_joined) {
-   TRACE_2("ERR_UNAVAILABLE: MQD or MQND is down");
+   if (!mqa_cb->clm_node_joined || client_info->isStale) {
+   TRACE_2("ERR_UNAVAILABLE: node is not cluster member");
rc = SA_AIS_ERR_UNAVAILABLE;
goto done;
}
@@ -461,8 +464,8 @@ SaAisErrorT saMsgDispatch(SaMsgHandleT msgHandle,
}
 
if (client_info->version.majorVersion == MQA_MAJOR_VERSION) {
-   if (!mqa_cb->clm_node_joined) {
-   TRACE_2("ERR_UNAVAILABLE: MQD or MQND is down");
+   if (!mqa_cb->clm_node_joined || client_info->isStale) {
+   TRACE_2("ERR_UNAVAILABLE: node is not cluster member");
rc = SA_AIS_ERR_UNAVAILABLE;
m_NCS_UNLOCK(_cb->cb_lock, NCS_LOCK_WRITE);
goto done;
@@ -805,8 +808,8 @@ saMsgQueueOpen(SaMsgHandleT msgHandle, const SaNameT 
*queueName,
}
 
if (client_info->version.majorVersion == MQA_MAJOR_VERSION) {
-   if (!mqa_cb->clm_node_joined) {
-   TRACE_2("ERR_UNAVAILABLE: MQD or MQND is down");
+   if (!mqa_cb->clm_node_joined || client_info->isStale) {
+   TRACE_2("ERR_UNAVAILABLE: node is not cluster member");
rc = SA_AIS_ERR_UNAVAILABLE;
goto done;
}
@@ -1086,8 +1089,8 @@ saMsgQueueOpenAsync(SaMsgHandleT msgHandle, SaInvocationT 
invocation,
}
 
if (client_info->version.majorVersion == MQA_MAJOR_VERSION) {
-   if (!mqa_cb->clm_node_joined) {
-   TRACE_2("ERR_UNAVAILABLE: MQD or MQND is down");
+   if (!mqa_cb->clm_node_joined || client_info->isStale) {
+   TRACE_2("ERR_UNAVAILABLE: node is not cluster member");
rc = SA_AIS_ERR_UNAVAILABLE;
goto done;
}
@@ -1240,9 +1243,10 @@ SaAisErrorT saMsgQueueClose(SaMsgQueueHandleT 
queueHandle)
 
if (queue_no

Re: [devel] [PATCH 0/1] Review Request for msg: fix ERR_UNAVAILABLE code when node leaves and rejoins cluster [#2655]

2017-11-02 Thread Srinivas Mangipudy
Hi Alex,

 

I need one more day to complete my review.

 

Thank you

Srinivas

 

 

From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Wednesday, November 1, 2017 8:07 PM
To: srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 0/1] Review Request for msg: fix ERR_UNAVAILABLE code when 
node leaves and rejoins cluster [#2655]

 

Hi Srinivas,

    If you have no comments, I will push this tomorrow.

Alex

 

On 10/27/2017 10:00 AM, Alex Jones wrote:

Summary: msg: fix ERR_UNAVAILABLE code when node leaves and rejoins cluster 
[#2655]
Review request for Ticket(s): 2655
Peer Reviewer(s): Srinivas
Pull request to: 
Affected branch(es): develop
Development branch: ticket-2655
Base revision: 2a7a20bafa7f189fca79bd73e6d678c58fda64dd
Personal repository: git://git.code.sf.net/u/trguitar/review
 

Impacted area   Impact y/n

 Docs    n
 Build system    n
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF services    y
 OpenSAF services    n
 Core libraries  n
 Samples n
 Tests   n
 Other   n
 
NOTE: Patch(es) contain lines longer than 80 characers
 
Comments (indicate scope for each "y" above):
-
 
revision bbf728124ac8efe8789a6a9758be84fb3300e9e9
Author:  Alex Jones HYPERLINK 
"mailto:alex.jo...@genband.com;<alex.jo...@genband.com>
Date:    Fri, 27 Oct 2017 09:44:26 -0400
 
msg: fix ERR_UNAVAILABLE code when node leaves and rejoins cluster [#2655]
 
APIs return SA_AIS_OK after the node leaves then rejoins cluster.
 
Section 3.2 of the MSG B.03.01 spec states that if a node leaves then
rejoins the cluster, APIs need to return ERR_UNAVAILABLE for handles that
were obtained before the node left the cluster.
 
APIs need to return ERR_UNAVAILABLE for handles that were obtained
before the node left the cluster.
 
 
 
Added Files:

 src/msg/apitest/test_ErrUnavailable.cc
 
 
Complete diffstat:
--
 src/msg/Makefile.am    |    1 +
 src/msg/agent/mqa_api.c    |   97 +--
 src/msg/agent/mqa_db.h |    1 +
 src/msg/agent/mqa_def.h    |    1 +
 src/msg/agent/mqa_init.c   |   26 +
 src/msg/agent/mqa_mds.c    |   14 +
 src/msg/apitest/test_ErrUnavailable.cc | 1009 
 src/msg/msgnd/mqnd_evt.c   |   42 +-
 8 files changed, 1139 insertions(+), 52 deletions(-)
 
 
Testing Commands:
-
run "msgtest"
 
 
Testing, Expected Results:
--
All tests should pass.
 
 
Conditions of Submission:
-
Nov 2, 2017, or ack from developer.
 
 
Arch  Built Started    Linux distro
---
mips    n  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 ad

Re: [devel] [PATCH 1/1] msg: allow real "const SaNameT" to be used in API calls [#2630]

2017-10-23 Thread Srinivas Mangipudy
Ack from my side ( code review only ).

Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Wednesday, October 18, 2017 9:44 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 1/1] msg: allow real "const SaNameT" to be used in API calls 
[#2630]

If a real "const SaNameT" is passed into API calls, the agent seg faults.

Code in the agent is writing into the "const SaNameT" pointer which is stored 
in read-only memory.

Allow a real "const SaNameT" to be passed into API calls.
---
 src/msg/agent/mqa_api.c   | 32 
 src/msg/agent/mqa_def.h   |  7 ---
 src/msg/apitest/test_saMsgVersionT.cc |  4 ++--
 3 files changed, 2 insertions(+), 41 deletions(-)

diff --git a/src/msg/agent/mqa_api.c b/src/msg/agent/mqa_api.c index 
d211b77..5ef238a 100644
--- a/src/msg/agent/mqa_api.c
+++ b/src/msg/agent/mqa_api.c
@@ -711,7 +711,6 @@ saMsgQueueOpen(SaMsgHandleT msgHandle, const SaNameT 
*queueName,
return rc;
}
 
-   m_MQSV_SET_SANAMET(queueName);
TRACE_1("queueName %s", queueName->value);
 
if (strncmp((char *)queueName->value, "safMq=", 6)) { @@ -1011,7 
+1010,6 @@ saMsgQueueOpenAsync(SaMsgHandleT msgHandle, SaInvocationT invocation,
return rc;
}
 
-   m_MQSV_SET_SANAMET(queueName);
TRACE_1("queueName %s ", queueName->value);
 
if (strncmp((char *)queueName->value, "safMq=", 6)) { @@ -1370,7 
+1368,6 @@ SaAisErrorT saMsgQueueStatusGet(SaMsgHandleT msgHandle,
return rc;
}
 
-   m_MQSV_SET_SANAMET(queueName);
TRACE_1("queueName %s ", queueName->value);
 
/* retrieve MQA CB */
@@ -1667,7 +1664,6 @@ SaAisErrorT saMsgQueueUnlink(SaMsgHandleT msgHandle, 
const SaNameT *queueName)
return rc;
}
 
-   m_MQSV_SET_SANAMET(queueName);
TRACE_1("queueName %s ", queueName->value);
 
/* retrieve MQA CB */
@@ -2189,9 +2185,6 @@ SaAisErrorT mqa_send_message(SaMsgHandleT msgHandle, 
const SaNameT *destination,
return rc;
}
 
-   /* To memset the bytes to zero other than the length bytes in the
-* SaNameT Structure */
-   m_MQSV_SET_SANAMET(destination);
TRACE_1("destination queue name %s", destination->value);
 
if (m_MQSV_IS_ACKFLAGS_NOT_VALID(ackFlags)) { @@ -3527,9 +3520,6 @@ 
SaAisErrorT saMsgMessageSendReceive(SaMsgHandleT msgHandle,
return rc;
}
 
-   /* To memset the bytes to zero other than the length bytes in the
-* SaNameT Structure */
-   m_MQSV_SET_SANAMET(destination);
TRACE_1("Message send to queueName %s", destination->value);
 
if (m_NCS_SA_IS_VALID_TIME_DURATION(timeout) == false) { @@ -4487,9 
+4477,6 @@ SaAisErrorT saMsgQueueGroupCreate(SaMsgHandleT msgHandle,
return SA_AIS_ERR_INVALID_PARAM;
}
 
-   /* To memset the bytes to zero other than the length bytes in the
-* SaNameT Structure */
-   m_MQSV_SET_SANAMET(queueGroupName);
TRACE_1("queueGroupName %s", queueGroupName->value);
 
if (queueGroupName->length == 0) {
@@ -4636,9 +4623,6 @@ SaAisErrorT saMsgQueueGroupDelete(SaMsgHandleT msgHandle,
"ERR_INVALID_PARAM: queueGroupName exceeds character 256");
return SA_AIS_ERR_INVALID_PARAM;
}
-   /* To memset the bytes to zero other than the length bytes in the
-* SaNameT Structure */
-   m_MQSV_SET_SANAMET(queueGroupName);
TRACE_1("queueGroupName %s", queueGroupName->value);
 
/* retrieve MQA CB */
@@ -4771,11 +4755,6 @@ SaAisErrorT saMsgQueueGroupInsert(SaMsgHandleT msgHandle,
return SA_AIS_ERR_INVALID_PARAM;
}
 
-   /* To memset the bytes to zero other than the length bytes in the
-* SaNameT Structure */
-   m_MQSV_SET_SANAMET(queueGroupName);
-
-   m_MQSV_SET_SANAMET(queueName);
TRACE_1("queueGroupName %s queueName %s", queueGroupName->value,
queueName->value);
 
@@ -4907,11 +4886,6 @@ SaAisErrorT saMsgQueueGroupRemove(SaMsgHandleT msgHandle,
return SA_AIS_ERR_INVALID_PARAM;
}
 
-   /* To memset the bytes to zero other than the length bytes in the
-* SaNameT Structure */
-   m_MQSV_SET_SANAMET(queueGroupName);
-
-   m_MQSV_SET_SANAMET(queueName);
TRACE_1("queueGroupName %s queueName %s", queueGroupName->value,
queueName->value);
 
@@ -5045,9 +5019,6 @@ saMsgQueueGroupTrack(SaMsgHandleT msgHandle, const 
SaNameT *queueGroupName,
re

Re: [devel] [PATCH 1/1] pyosaf: Invalid exception used in ImmObject (object.py) [#1410]

2017-10-16 Thread Srinivas Mangipudy
Hi Hieu,

Reviewed and tested.  
I am fine with the patch.

Thank you
Srinivas. 

-Original Message-
From: Hieu Nguyen [mailto:hieu.t.ngu...@dektech.com.au] 
Sent: Tuesday, October 3, 2017 9:20 AM
To: hans.nordeb...@ericsson.com; anders.wid...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1/1] pyosaf: Invalid exception used in ImmObject 
(object.py) [#1410]

---
 python/pyosaf/utils/immom/object.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/pyosaf/utils/immom/object.py 
b/python/pyosaf/utils/immom/object.py
index c2924d3..30cd63c 100644
--- a/python/pyosaf/utils/immom/object.py
+++ b/python/pyosaf/utils/immom/object.py
@@ -59,7 +59,7 @@ class ImmObject(object):
 self.class_desc[class_name] = \
 pyosaf.utils.immom.class_description_get(class_name)
 else:
-raise
+raise Exception("ERROR: class and attributes are None")
 
 self.__dict__["rdn_attribute"] = \
 pyosaf.utils.immom.get_rdn_attribute_for_class(class_name)
-- 
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! 
https://urldefense.proofpoint.com/v2/url?u=http-3A__sdm.link_slashdot=DwICAg=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=JfwZbiSY19b5J19rDeSKt00rK2wWHkoCYtw6qH4qSnU=j7sZt0LSEPbft-gnTOtgRJgiyoK0Z3sKAOHxDU9kA4k=qlwc5Ynj91Sodhu7qAPwfJYu9uCSkcSxFxJSABwEXJA=
 
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_opensaf-2Ddevel=DwICAg=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=JfwZbiSY19b5J19rDeSKt00rK2wWHkoCYtw6qH4qSnU=j7sZt0LSEPbft-gnTOtgRJgiyoK0Z3sKAOHxDU9kA4k=rh98QhseayXfMopRIk8zfBwtxPwnb4uLTODxOCANvQQ=
 

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


Re: [devel] [PATCH 2/2] msg: don't create cache entry during delete operation [#2619]

2017-10-13 Thread Srinivas Mangipudy
Hi Alex, 

Ack from my side ( review only ) , I tried to reproduce the issue, but could 
not.

Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Tuesday, October 10, 2017 4:55 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>
Cc: opensaf-devel@lists.sourceforge.net; Alex Jones <alex.jo...@genband.com>
Subject: [PATCH 2/2] msg: don't create cache entry during delete operation 
[#2619]

Fix typo.
---
 src/msg/common/mqsv_asapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/msg/common/mqsv_asapi.c b/src/msg/common/mqsv_asapi.c index 
8b6fb65..1d5d629 100644
--- a/src/msg/common/mqsv_asapi.c
+++ b/src/msg/common/mqsv_asapi.c
@@ -649,7 +649,7 @@ static uint32_t asapi_cache_update(ASAPi_OBJECT_INFO *pInfo,
m_NCS_UNLOCK(>clock,
 NCS_LOCK_WRITE); /* Unlock the cache */
} else {  /* Node deosn't exist */
-if (ASAPi_QUEUE_DEL == opr || ASAPi_GROUP_DEL) {
+if (ASAPi_QUEUE_DEL == opr || ASAPi_GROUP_DEL == opr) {
   /* no need to add node as this is a deletion */
   return rc;
 }
--
2.9.5


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


Re: [devel] [PATCH 1/1] msg: don't create cache entry if operation is delete [#2619]

2017-10-10 Thread Srinivas Mangipudy
Hi Alex, 

Please find my comments below, preceded with [Srinivas].


Thank you
Srinivas

-Original Message-
From: Alex Jones [mailto:alex.jo...@genband.com] 
Sent: Friday, October 6, 2017 7:05 PM
To: Venkata Mahesh Alla 
Cc: Alex Jones ; opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1/1] msg: don't create cache entry if operation is 
delete [#2619]

saMsgMessageSend and Async calls return TRY_AGAIN forever after controller 
failover.

If more than 1 ASAPi_MSG_TRACK_NTFY for deletion is processed by the cache, the 
first time the cache entry will be deleted. When the second one comes in, 
before a new queue registration message has been received, the cache entry will 
be created with bad information, even though this is a delete operation.

Don't create cache entries for delete operations.
---
 src/msg/common/mqsv_asapi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/msg/common/mqsv_asapi.c b/src/msg/common/mqsv_asapi.c index 
f39d564..8b6fb65 100644
--- a/src/msg/common/mqsv_asapi.c
+++ b/src/msg/common/mqsv_asapi.c
@@ -649,6 +649,11 @@ static uint32_t asapi_cache_update(ASAPi_OBJECT_INFO 
*pInfo,
m_NCS_UNLOCK(>clock,
 NCS_LOCK_WRITE); /* Unlock the cache */
} else {  /* Node deosn't exist */
+if (ASAPi_QUEUE_DEL == opr || ASAPi_GROUP_DEL) {
[Srinivas] : This "if" condition seems to be wrong.  ASAPi_GROUP_DEL is a part 
of an enum and has value greater then 0, so this "if" condition will always be 
satisfied and we will "return"  from this function for all the operations.
+  /* no need to add node as this is a deletion */
+  return rc;
+}
+
/* Allocate the Cache Informaton node */
pCache = m_MMGR_ALLOC_ASAPi_CACHE_INFO(asapi.my_svc_id);
if (!pCache) {
--
2.9.5


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! 
https://urldefense.proofpoint.com/v2/url?u=http-3A__sdm.link_slashdot=DwICAg=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=JfwZbiSY19b5J19rDeSKt00rK2wWHkoCYtw6qH4qSnU=hA9_X6k30fxk8ZhhUvIBq3eYbnDEDcT6yvcyVss_lX8=axIea0t0xuGp13RJxO4UCTjoD3AN2PHXVspSuQC2wPc=
 
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_opensaf-2Ddevel=DwICAg=RoP1YumCXCgaWHvlZYR8PQcxBKCX5YTpkKY057SbK10=JfwZbiSY19b5J19rDeSKt00rK2wWHkoCYtw6qH4qSnU=hA9_X6k30fxk8ZhhUvIBq3eYbnDEDcT6yvcyVss_lX8=cOK_XAThgRORQFin1lLX_gkIEKcVtzixVLBXn4OxX9E=
 

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


Re: [devel] [PATCH 1/1] log: corrected parsing of command logtest with option -e [#2121]

2017-10-03 Thread Srinivas Mangipudy
Hi Minh,

Thank you for your comments, I will incorporate the comments and will push the 
file.

Thank you
Srinivas

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: Tuesday, October 3, 2017 1:10 PM
To: Srinivas Mangipudy <srinivas.mangip...@oracle.com>; 
lennart.l...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] log: corrected parsing of command logtest with option 
-e [#2121]

Hi Srinivas,

Ack with a minor comment, tagged [Vu].

Regards, Vu

> -Original Message-
> From: Srinivas Mangipudy [mailto:srinivas.mangip...@oracle.com]
> Sent: Tuesday, October 3, 2017 2:04 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/1] log: corrected parsing of command logtest 
> with option -e [#2121]
> 
> Hi Minh,
> 
> I have corrected the permissions of the file.
> 
> Thank you
> Srinivas
> 
> -Original Message-
> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> Sent: Tuesday, October 3, 2017 7:21 AM
> To: Srinivas <srinivas.mangip...@oracle.com>; 
> lennart.l...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: RE: [PATCH 1/1] log: corrected parsing of command logtest 
> with option -e [#2121]
> 
> Hi,
> 
> >  1 file changed, 14 insertions(+), 26 deletions(-)  mode change 
> > 100644 => 100755 src/log/apitest/logtest.c
> 
> Any reason of changing the file permission?
> 
> Regards, Vu
> 
> > -Original Message-
> > From: Srinivas [mailto:srinivas.mangip...@oracle.com]
> > Sent: Thursday, September 21, 2017 5:38 PM
> > To: lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
> > Cc: opensaf-devel@lists.sourceforge.net; Srinivas 
> > <srinivas.mangip...@oracle.com>
> > Subject: [PATCH 1/1] log: corrected parsing of command logtest with 
> > option -e [#2121]
> >
> > ---
> >  src/log/apitest/logtest.c | 40
> > ++--
> >  1 file changed, 14 insertions(+), 26 deletions(-)  mode change 
> > 100644 => 100755 src/log/apitest/logtest.c
> >
> > diff --git a/src/log/apitest/logtest.c b/src/log/apitest/logtest.c 
> > old mode 100644 new mode 100755 index 2564957..6777549
> > --- a/src/log/apitest/logtest.c
> > +++ b/src/log/apitest/logtest.c
> > @@ -420,9 +420,6 @@ int main(int argc, char **argv)
> > int suite = ALL_SUITES, tcase = ALL_TESTS;
> > int opt_val = 0;
> > bool etst_flg = false;
> > -   int i = 0;
> > -   char *opt_str_ptr;
> > -   char *tok_str_ptr = NULL;
> >
> > if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
> > fprintf(stderr, "Failed to set SA_ENABLE_EXTENDED_NAMES
> (%s)", @@
> > -468,31 +465,22 @@ int main(int argc, char **argv)
> > test_list();
> > exit(0);
> > case 'e':
> > -   opt_str_ptr = argv[optind - 1];
> > -
> > -   tok_str_ptr = strtok(opt_str_ptr, " ");
> > -   for (i = 0; i < 2; i++) {
> > -   if (tok_str_ptr == NULL)
> > -   break;
> > -
> > -   if (i == 0) {
> > -   suite = atoi(tok_str_ptr);
> > -   if (suite == 0) {
> > -   /* Argument is not numeric
> > or 0
> > -*/
> > -   err_exit();
> > -   }
> > -   } else {
> > -   tcase = atoi(tok_str_ptr);
> > -   if (tcase == 0) {
> > -   /* Argument is not numeric
> > or 0
> > -*/
> > -   err_exit();
> > -   }
> > +   if (argv[optind - 1] != NULL) {
> > +   suite = atoi(argv[optind - 1]);
> > +   if (suite == 0) {
> > +   /* Argument is not numeric or 0
> > +*/
> > +   err_exit();
> > }
> > -   tok_str_ptr = strtok(NULL, " ");
> >

Re: [devel] [PATCH 1/1] log: corrected parsing of command logtest with option -e [#2121]

2017-10-03 Thread Srinivas Mangipudy
Hi Minh,

I have corrected the permissions of the file.

Thank you
Srinivas

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: Tuesday, October 3, 2017 7:21 AM
To: Srinivas ; lennart.l...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] log: corrected parsing of command logtest with option 
-e [#2121]

Hi,

>  1 file changed, 14 insertions(+), 26 deletions(-)  mode change 100644 
> => 100755 src/log/apitest/logtest.c

Any reason of changing the file permission?

Regards, Vu

> -Original Message-
> From: Srinivas [mailto:srinivas.mangip...@oracle.com]
> Sent: Thursday, September 21, 2017 5:38 PM
> To: lennart.l...@ericsson.com; vu.m.ngu...@dektech.com.au
> Cc: opensaf-devel@lists.sourceforge.net; Srinivas 
> 
> Subject: [PATCH 1/1] log: corrected parsing of command logtest with 
> option -e [#2121]
> 
> ---
>  src/log/apitest/logtest.c | 40 
> ++--
>  1 file changed, 14 insertions(+), 26 deletions(-)  mode change 100644 
> => 100755 src/log/apitest/logtest.c
> 
> diff --git a/src/log/apitest/logtest.c b/src/log/apitest/logtest.c old 
> mode 100644 new mode 100755 index 2564957..6777549
> --- a/src/log/apitest/logtest.c
> +++ b/src/log/apitest/logtest.c
> @@ -420,9 +420,6 @@ int main(int argc, char **argv)
>   int suite = ALL_SUITES, tcase = ALL_TESTS;
>   int opt_val = 0;
>   bool etst_flg = false;
> - int i = 0;
> - char *opt_str_ptr;
> - char *tok_str_ptr = NULL;
> 
>   if (setenv("SA_ENABLE_EXTENDED_NAMES", "1", 1) != 0) {
>   fprintf(stderr, "Failed to set SA_ENABLE_EXTENDED_NAMES (%s)", 
> @@ 
> -468,31 +465,22 @@ int main(int argc, char **argv)
>   test_list();
>   exit(0);
>   case 'e':
> - opt_str_ptr = argv[optind - 1];
> -
> - tok_str_ptr = strtok(opt_str_ptr, " ");
> - for (i = 0; i < 2; i++) {
> - if (tok_str_ptr == NULL)
> - break;
> -
> - if (i == 0) {
> - suite = atoi(tok_str_ptr);
> - if (suite == 0) {
> - /* Argument is not numeric
> or 0
> -  */
> - err_exit();
> - }
> - } else {
> - tcase = atoi(tok_str_ptr);
> - if (tcase == 0) {
> - /* Argument is not numeric
> or 0
> -  */
> - err_exit();
> - }
> + if (argv[optind - 1] != NULL) {
> + suite = atoi(argv[optind - 1]);
> + if (suite == 0) {
> + /* Argument is not numeric or 0
> +  */
> + err_exit();
>   }
> - tok_str_ptr = strtok(NULL, " ");
> + } else
> + err_exit();
> + if (optind < argc && argv[optind] != NULL)
> + tcase = atoi(argv[optind]);
> + if (tcase == 0) {
> + /* Argument is not numeric or 0
> +  */
> + err_exit();
>   }
> -
>   etst_flg = true;
>   add_suite_9();
>   add_suite_10();
> --
> 2.7.4



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


Re: [devel] [PATCH 1/1] ntf: correct return code is returned [#2039]

2017-10-02 Thread Srinivas Mangipudy
Hi Minh,

Please find below my comments inline.

Thank you
Srinivas

-Original Message-
From: minh chau [mailto:minh.c...@dektech.com.au] 
Sent: Thursday, September 28, 2017 6:49 AM
To: Srinivas 
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] ntf: correct return code is returned [#2039]

Hi Srinivas,

ack with minor comments.

Thanks
Minh

On 15/09/17 21:10, Srinivas wrote:
> ---
>   src/ntf/apitest/tet_scOutage_reinitializeHandle.c | 18 --
>   1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/src/ntf/apitest/tet_scOutage_reinitializeHandle.c 
> b/src/ntf/apitest/tet_scOutage_reinitializeHandle.c
> index 63dfae9..4af22ef 100644
> --- a/src/ntf/apitest/tet_scOutage_reinitializeHandle.c
> +++ b/src/ntf/apitest/tet_scOutage_reinitializeHandle.c
> @@ -100,6 +100,7 @@ static SaNtfObjectCreateDeleteNotificationT 
> myObjCrDelNotification;
>   static SaNtfAttributeChangeNotificationT myAttrChangeNotification;
>   static SaNtfStateChangeNotificationT myStateChangeNotification;
>   static SaNtfSecurityAlarmNotificationT mySecAlarmNotification;
> +static SaAisErrorT global_error_id = SA_AIS_OK;
>   
>   extern int gl_tag_mode;
>   
> @@ -147,7 +148,7 @@ static SaAisErrorT check_errors()
>   errors = 0;
>   glob_errors += errors;
>   if (glob_errors) {
> - rc = SA_AIS_ERR_FAILED_OPERATION;
> + rc = global_error_id;
>   fprintf_v(stdout, "num of failed notifications: %d\n",
> glob_errors);
>   }
> @@ -156,8 +157,10 @@ static SaAisErrorT check_errors()
>   
>   void saferror(SaAisErrorT rc, SaAisErrorT exp)
>   {
> - if (rc != exp)
> + if (rc != exp){
>   glob_errors++;
> + global_error_id = rc;
> + }
>   }
>   
>   static void resetCounters()
> @@ -170,6 +173,7 @@ static void resetCounters()
>   ntfRecieved.objectCreateDeleteFilterHandle = 0;
>   ntfRecieved.securityAlarmFilterHandle = 0;
>   ntfRecieved.stateChangeFilterHandle = 0;
> + global_error_id = SA_AIS_OK;
>   }
>   
>   /**
> @@ -825,10 +829,12 @@ void producer_life_cycle(int test_api)
>);
>   saferror(rc, SA_AIS_OK);
>   
> - rc = scoutage_saNtfPtrValAllocate(
> - ,
> - myAlarmNotification.notificationHandle);
> - saferror(rc, SA_AIS_OK);
> + if (glob_errors == 0) {
> + rc = scoutage_saNtfPtrValAllocate(
> + ,
> + myAlarmNotification.notificationHandle);
> + saferror(rc, SA_AIS_OK);
> + }
[Minh]: Do we need this change in producer_life_cycle? I think this patch let 
all api(s) called as currently and only memorize the last error code if any
[Srinivas]: Without this condition, the process was dumping core.
The reason for core dump was scoutage_saNtfAlarmNotificationAllocate() returned 
error and myAlarmNotification was not initialized properly.
Below is the backtrace:
(gdb) where
#0  0x800ad68e in scoutage_saNtfPtrValAllocate ()
#1  0x800ae18d in producer_life_cycle ()
#2  0x800ae509 in test_sc_outage_producer_1 ()
#3  0x800c24a9 in run_test_case ()
#4  0x800c2a28 in test_run ()
#5  0x800912db in main ()

>   
>   /* Create security alarm notification */
>   rc = scoutage_saNtfSecurityAlarmNotificationAllocate(


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