[devel] [PATCH 1 of 1] log: Deadlock in log agent makes client hang [#1805]

2016-05-04 Thread Vu Minh Nguyen
 osaf/libs/agents/saf/lga/lga.h   |   1 +
 osaf/libs/agents/saf/lga/lga_api.c   |  12 
 osaf/libs/agents/saf/lga/lga_mds.c   |  10 ++-
 osaf/libs/agents/saf/lga/lga_state.c |  87 
 osaf/libs/agents/saf/lga/lga_state.h |   3 -
 osaf/libs/agents/saf/lga/lga_util.c  |  23 +
 6 files changed, 72 insertions(+), 64 deletions(-)


Remove deadlock when two mutexes conflict in MDS and log agent.
Make sure that cb_lock is not taken when calling any MDS API
Some cleaning of code e.g. removing "dead" code and moving functions from 
lga_state.c
that are not related to lga_state.c

diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h
--- a/osaf/libs/agents/saf/lga/lga.h
+++ b/osaf/libs/agents/saf/lga/lga.h
@@ -122,6 +122,7 @@ typedef struct {
 
 /* lga_saf_api.c */
 extern lga_cb_t lga_cb;
+bool is_lgs_state(lgs_state_t state);
 
 /* lga_mds.c */
 extern uint32_t lga_mds_init(lga_cb_t *cb);
diff --git a/osaf/libs/agents/saf/lga/lga_api.c 
b/osaf/libs/agents/saf/lga/lga_api.c
--- a/osaf/libs/agents/saf/lga/lga_api.c
+++ b/osaf/libs/agents/saf/lga/lga_api.c
@@ -44,6 +44,18 @@ lga_cb_t lga_cb = {
.lgs_state = LGS_START
 };
 
+bool is_lgs_state(lgs_state_t state)
+{
+   bool rc = false;
+
+   osaf_mutex_lock_ordie(_cb.cb_lock);
+   if (state == lga_cb.lgs_state)
+   rc = true;
+   osaf_mutex_unlock_ordie(_cb.cb_lock);
+
+   return rc;
+}
+
 static void populate_open_params(lgsv_stream_open_req_t *open_param,
 const SaNameT *logStreamName,
 lga_client_hdl_rec_t *hdl_rec,
diff --git a/osaf/libs/agents/saf/lga/lga_mds.c 
b/osaf/libs/agents/saf/lga/lga_mds.c
--- a/osaf/libs/agents/saf/lga/lga_mds.c
+++ b/osaf/libs/agents/saf/lga/lga_mds.c
@@ -16,6 +16,7 @@
  */
 
 #include 
+#include 
 #include "lga.h"
 #include "lga_state.h"
 
@@ -446,8 +447,9 @@ static uint32_t lga_lgs_msg_proc(lga_cb_
{
lga_client_hdl_rec_t *lga_hdl_rec;
 
-   TRACE_2("LGSV_LGS_WRITE_LOG_CBK: inv = %d, 
error = %d",
-   (int)lgsv_msg->info.cbk_info.inv, 
(int)lgsv_msg->info.cbk_info.write_cbk.error);
+   TRACE_2("LGSV_LGS_WRITE_LOG_CBK: inv_id = %d, 
cbk_error %s",
+   (int)lgsv_msg->info.cbk_info.inv,
+   
saf_error((int)lgsv_msg->info.cbk_info.write_cbk.error));
 
/** Create the chan hdl record here before 
  ** queing this message onto the priority queue
@@ -590,6 +592,7 @@ static uint32_t lga_mds_rcv(struct ncsmd
lgsv_msg_t *lgsv_msg = (lgsv_msg_t *)mds_cb_info->info.receive.i_msg;
uint32_t rc;
 
+   /* TBD Probably incorrect usage of this mutex here */
osaf_mutex_lock_ordie(_cb.cb_lock);
 
/* process the message */
@@ -930,7 +933,8 @@ static uint32_t lga_mds_dec(struct ncsmd
TRACE_2("LGSV_LGS_CBK_MSG");
switch (msg->info.cbk_info.type) {
case LGSV_WRITE_LOG_CALLBACK_IND:
-   TRACE_2("decode writelog message");
+   TRACE_2("decode writelog message, 
lgs_client_id=%d",
+   msg->info.cbk_info.lgs_client_id);
total_bytes += lga_dec_write_cbk_msg(uba, msg);
break;
default:
diff --git a/osaf/libs/agents/saf/lga/lga_state.c 
b/osaf/libs/agents/saf/lga/lga_state.c
--- a/osaf/libs/agents/saf/lga/lga_state.c
+++ b/osaf/libs/agents/saf/lga/lga_state.c
@@ -28,13 +28,6 @@
  * Common data
  */
 
-/* And critical sections. Clients APIs must not pass recovery 2 state check if
- * recovery 2 thread is started but state has not yet been changed by the
- * thread. Also the thread must not start recovery if an API is executing and
- * has passed the recovery 2 check
- */
-static pthread_mutex_t lga_recov2_lock = PTHREAD_MUTEX_INITIALIZER;
-
 /* Selection object for terminating recovery thread for state 2 (after timeout)
  * NOTE: Only for recovery2_thread
  */
@@ -228,7 +221,10 @@ static int initialize_one_client(lga_cli
 
TRACE_ENTER();
 
-   if (p_client->initialized_flag == true) {
+   osaf_mutex_lock_ordie(_cb.cb_lock);
+   bool initialized_flag = p_client->initialized_flag;
+   osaf_mutex_unlock_ordie(_cb.cb_lock);
+   if (initialized_flag == true) {
/* The client is already initialized */
rc = 1;
goto done;
@@ -242,11 +238,13 @@ static int initialize_one_client(lga_cli
/* Restore the client Id with the one returned by the LGS and
 * set the initialized flag
 */
+   osaf_mutex_lock_ordie(_cb.cb_lock);
p_client->lgs_client_id = 

Re: [devel] [PATCH 1 of 1] amfd: Segv in ng_ccb_completed_delete_hdlr [#1766]

2016-05-04 Thread Gary Lee
Hi Hans

ack (review only)

On 30/04/16 00:28, Hans Nordebäck wrote:
> Gentle reminder for review!/Thanks Hans
>
> -Original Message-
> From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
> Sent: den 15 april 2016 10:26
> To: praveen.malv...@oracle.com; nagendr...@oracle.com; Gary Lee
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [devel] [PATCH 1 of 1] amfd: Segv in ng_ccb_completed_delete_hdlr 
> [#1766]
>
>   osaf/services/saf/amf/amfd/nodegroup.cc |  10 ++
>   osaf/services/saf/amf/amfd/su.cc|  12 +++-
>   2 files changed, 21 insertions(+), 1 deletions(-)
>
>
> When running SMF tests that creates and deletes nodegrups, the nodegroup_db 
> sometimes do not contain the nodegroup given in parameter opdata->objectName.
>
> diff --git a/osaf/services/saf/amf/amfd/nodegroup.cc 
> b/osaf/services/saf/amf/amfd/nodegroup.cc
> --- a/osaf/services/saf/amf/amfd/nodegroup.cc
> +++ b/osaf/services/saf/amf/amfd/nodegroup.cc
> @@ -453,6 +453,11 @@ static SaAisErrorT ng_ccb_completed_dele
>   AVD_AVND *node;
>   AVD_AMF_NG *ng = avd_ng_get(>objectName);
>   
> +if (ng == nullptr) {
> +  LOG_WA("Could not find %s in nodegroup_db", 
> opdata->objectName.value);
> +  return SA_AIS_OK;
> +}
> +
>   TRACE_ENTER2("%u", ng->number_nodes());
>   std::set::const_iterator iter;
>   if ((ng->saAmfNGAdminState != SA_AMF_ADMIN_LOCKED) && @@ -579,6 +584,11 
> @@ static void ng_ccb_apply_delete_hdlr(Ccb  {
>   TRACE_ENTER();
>   AVD_AMF_NG *ng = avd_ng_get(>objectName);
> + if (ng == nullptr) {
> + LOG_WA("Could not find %s in nodegroup_db", 
> opdata->objectName.value);
> + return;
> + }
> +
>   SaAmfAdminStateT old_admin_state = ng->saAmfNGAdminState;
>   if (avd_cb->avail_state_avd != SA_AMF_HA_ACTIVE) {
>   //Since AMF will delete NG, clear its pointers in node.
> diff --git a/osaf/services/saf/amf/amfd/su.cc 
> b/osaf/services/saf/amf/amfd/su.cc
> --- a/osaf/services/saf/amf/amfd/su.cc
> +++ b/osaf/services/saf/amf/amfd/su.cc
> @@ -457,6 +457,10 @@ static AVD_AVND *map_su_to_node(AVD_SU *
>   /* If node is configured in SU we are done */
>   if (strstr((char *)su->saAmfSUHostNodeOrNodeGroup.value, "safAmfNode=") 
> != nullptr) {
>   node = avd_node_get(>saAmfSUHostNodeOrNodeGroup);
> + if (node == nullptr) {
> + LOG_WA("Could not find: %s in su: %s", 
> su->saAmfSUHostNodeOrNodeGroup.value, su->name.value);
> + return node;
> + }
>   goto done;
>   }
>   
> @@ -495,7 +499,13 @@ static AVD_AVND *map_su_to_node(AVD_SU *
>   }
>   
>   /* All nodes already have an SU mapped for the SG. Return a node in the 
> node group. */
> - node = avd_node_get(*ng->saAmfNGNodeList.begin());
> +node_iter = ng->saAmfNGNodeList.begin();
> +if (node_iter != ng->saAmfNGNodeList.end()) {
> + node = avd_node_get(*ng->saAmfNGNodeList.begin());
> +} else {
> + LOG_WA("%s is empty", su->saAmfSUHostNodeOrNodeGroup.value);
> + return nullptr;
> + }
>   done:
>   memcpy(>saAmfSUHostedByNode, >name, sizeof(SaNameT));
>   TRACE_LEAVE2("hosted by %s", node->name.value);
>
> --
> Find and fix application performance issues faster with Applications Manager 
> Applications Manager provides deep performance insights into multiple tiers 
> of your business applications. It resolves application problems quickly and 
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel


--
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1 of 1] log: verify logBufSize to avoid node malfunctioned [#1789]

2016-05-04 Thread Vu Minh Nguyen
 osaf/libs/agents/saf/lga/lga_api.c   |  18 +
 tests/logsv/tet_saLogStreamOpen_2.c  |   4 +++
 tests/logsv/tet_saLogWriteLogAsync.c |  38 
 3 files changed, 60 insertions(+), 0 deletions(-)


When accidentally passing an invalid value of logBufSize to saLogWriteLogAsync()
such as a very large number which is caused by not using strlen() on logBuf,
it will cause a lot of troubles.

Add code to verify if logBufSize is calculated based on logBuf or not
and also prevent too big data sent to server side.

diff --git a/osaf/libs/agents/saf/lga/lga_api.c 
b/osaf/libs/agents/saf/lga/lga_api.c
--- a/osaf/libs/agents/saf/lga/lga_api.c
+++ b/osaf/libs/agents/saf/lga/lga_api.c
@@ -996,6 +996,24 @@ static SaAisErrorT handle_log_record(con
ais_rc = SA_AIS_ERR_INVALID_PARAM;
goto done;
}
+
+   if (logRecord->logBuffer->logBuf != NULL) {
+   SaSizeT size = logRecord->logBuffer->logBufSize;
+   bool sizeOver = size > strlen((char 
*)logRecord->logBuffer->logBuf) + 1;
+   /* Prevent log client accidently assign too big number 
to logBufSize */
+   if (sizeOver == true) {
+   TRACE("logBufSize > strlen(logBuf) + 1");
+   ais_rc = SA_AIS_ERR_INVALID_PARAM;
+   goto done;
+   }
+
+   /* Prevent sending too big data to server side */
+   if (size > SA_LOG_MAX_RECORD_SIZE) {
+   TRACE("logBuf data is too big (max: %d)", 
SA_LOG_MAX_RECORD_SIZE);
+   ais_rc = SA_AIS_ERR_INVALID_PARAM;
+   goto done;
+   }
+   }
}
 
/* Set timeStamp data if not provided by application user */
diff --git a/tests/logsv/tet_saLogStreamOpen_2.c 
b/tests/logsv/tet_saLogStreamOpen_2.c
--- a/tests/logsv/tet_saLogStreamOpen_2.c
+++ b/tests/logsv/tet_saLogStreamOpen_2.c
@@ -724,6 +724,8 @@ extern void saLogWriteLogAsync_14(void);
 extern void saLogWriteLogAsync_15(void);
 extern void saLogWriteLogAsync_16(void);
 extern void saLogWriteLogAsync_17(void);
+extern void saLogWriteLogAsync_18(void);
+extern void saLogWriteLogAsync_19(void);
 extern void saLogWriteLogCallbackT_01(void);
 extern void saLogWriteLogCallbackT_02(void);
 extern void saLogWriteLogCallbackT_03(void);
@@ -774,6 +776,8 @@ extern void saLogStreamClose_01(void);
 test_case_add(2, saLogWriteLogAsync_15, "saLogWriteAsyncLog() NTF 
notificationObject length == 256");
 test_case_add(2, saLogWriteLogAsync_16, "saLogWriteAsyncLog() NTF 
notifyingObject length == 256");
 test_case_add(2, saLogWriteLogAsync_17, "saLogWriteLogAsync() Generic 
logSvcUsrName length == 256");
+test_case_add(2, saLogWriteLogAsync_18, "saLogWriteLogAsync() logBufSize > 
strlen(logBuf) + 1");
+test_case_add(2, saLogWriteLogAsync_19, "saLogWriteLogAsync() logBufSize > 
SA_LOG_MAX_RECORD_SIZE");
 test_case_add(2, saLogWriteLogCallbackT_01, "saLogWriteLogCallbackT() 
SA_DISPATCH_ONE");
 test_case_add(2, saLogWriteLogCallbackT_02, "saLogWriteLogCallbackT() 
SA_DISPATCH_ALL");
 test_case_add(2, saLogFilterSetCallbackT_01, "saLogFilterSetCallbackT OK");
diff --git a/tests/logsv/tet_saLogWriteLogAsync.c 
b/tests/logsv/tet_saLogWriteLogAsync.c
--- a/tests/logsv/tet_saLogWriteLogAsync.c
+++ b/tests/logsv/tet_saLogWriteLogAsync.c
@@ -514,3 +514,41 @@ void saLogWriteLogAsync_17(void)
test_validate(rc1, SA_AIS_ERR_INVALID_PARAM);
}
 }
+
+/**
+ * saLogWriteAsyncLog() - logBufSize > strlen(logBuf) + 1
+ */
+void saLogWriteLogAsync_18(void)
+{
+   SaInvocationT invocation = 0;
+
+   strcpy((char*)genLogRecord.logBuffer->logBuf, __FUNCTION__);
+   genLogRecord.logBuffer->logBufSize = strlen(__FUNCTION__) + 2;
+   safassert(saLogInitialize(, , ), 
SA_AIS_OK);
+   safassert(saLogStreamOpen_2(logHandle, , NULL, 0,
+   SA_TIME_ONE_SECOND, ), 
SA_AIS_OK);
+   rc = saLogWriteLogAsync(logStreamHandle, invocation, 0, );
+   safassert(saLogFinalize(logHandle), SA_AIS_OK);
+   test_validate(rc, SA_AIS_ERR_INVALID_PARAM);
+}
+
+/**
+ * saLogWriteAsyncLog() - big logBufSize > SA_LOG_MAX_RECORD_SIZE
+ */
+void saLogWriteLogAsync_19(void)
+{
+   SaInvocationT invocation = 0;
+   char logBuf[SA_LOG_MAX_RECORD_SIZE + 10];
+
+   memset(logBuf, 'A', sizeof(logBuf));
+   logBuf[sizeof(logBuf) - 1] = '\0';
+
+   genLogRecord.logBuffer->logBuf = (SaUint8T *)
+   genLogRecord.logBuffer->logBufSize = SA_LOG_MAX_RECORD_SIZE + 10;
+   safassert(saLogInitialize(, , ), 
SA_AIS_OK);
+   safassert(saLogStreamOpen_2(logHandle, , NULL, 0,
+   SA_TIME_ONE_SECOND, ), 
SA_AIS_OK);
+   rc = 

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

2016-05-04 Thread Nhat Pham
 osaf/libs/common/cpsv/include/cpd_cb.h   |2 +
 osaf/libs/common/cpsv/include/cpd_proc.h |3 +
 osaf/libs/common/cpsv/include/cpd_red.h  |   14 ++
 osaf/libs/common/cpsv/include/cpsv_evt.h |8 +
 osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 ++-
 osaf/services/saf/cpsv/cpd/cpd_evt.c |8 +
 osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   90 +-
 osaf/services/saf/cpsv/cpd/cpd_proc.c|  148 +++
 osaf/services/saf/cpsv/cpd/cpd_red.c |   32 +-
 osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   68 ++
 10 files changed, 370 insertions(+), 17 deletions(-)


Problem:
---
The saCkptCheckpointNumOpeners is not updated when a node which has a 
checkpoint client restarts.

Solution:

Currently CPD doesn't store number of user on each node. This patch updates CPD 
to update information
about users on each node for each checkpoint. When a node restarts, the CPD 
update the total number of
users for a checkpoint accordingly. This is reflected on 
saCkptCheckpointNumOpeners attribute correctly.

diff --git a/osaf/libs/common/cpsv/include/cpd_cb.h 
b/osaf/libs/common/cpsv/include/cpd_cb.h
--- a/osaf/libs/common/cpsv/include/cpd_cb.h
+++ b/osaf/libs/common/cpsv/include/cpd_cb.h
@@ -92,6 +92,8 @@ typedef struct cpd_ckpt_info_node {
uint32_t num_users;
uint32_t num_readers;
uint32_t num_writers;
+   uint32_t node_users_cnt;
+   CPD_NODE_USER_INFO *node_users;
 
/* for imm */
SaUint32T ckpt_used_size;
diff --git a/osaf/libs/common/cpsv/include/cpd_proc.h 
b/osaf/libs/common/cpsv/include/cpd_proc.h
--- a/osaf/libs/common/cpsv/include/cpd_proc.h
+++ b/osaf/libs/common/cpsv/include/cpd_proc.h
@@ -108,5 +108,8 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_
 uint32_t cpd_mbcsv_close(CPD_CB *cb);
 bool cpd_is_noncollocated_replica_present_on_payload(CPD_CB *cb, 
CPD_CKPT_INFO_NODE *ckpt_node);
 uint32_t cpd_ckpt_reploc_imm_object_delete(CPD_CB *cb,  CPD_CKPT_REPLOC_INFO 
*ckpt_reploc_node ,bool is_unlink_set);
+void cpd_proc_increase_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node, MDS_DEST 
cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
+void cpd_proc_decrease_node_user_info(CPD_CKPT_INFO_NODE *ckpt_node, MDS_DEST 
cpnd_dest, SaCkptCheckpointOpenFlagsT open_flags);
+void cpd_proc_update_user_info_when_node_down(CPD_CB *cb, NODE_ID node_id);
 uint32_t cpd_proc_ckpt_update_post(CPD_CB *cb);
 #endif
diff --git a/osaf/libs/common/cpsv/include/cpd_red.h 
b/osaf/libs/common/cpsv/include/cpd_red.h
--- a/osaf/libs/common/cpsv/include/cpd_red.h
+++ b/osaf/libs/common/cpsv/include/cpd_red.h
@@ -28,6 +28,7 @@ typedef enum cpd_mbcsv_msg_type {
CPD_A2S_MSG_CKPT_UNLINK,
CPD_A2S_MSG_CKPT_USR_INFO,
CPD_A2S_MSG_CKPT_DEST_DOWN,
+   CPD_A2S_MSG_CKPT_USR_INFO_2,
CPD_A2S_MSG_MAX_EVT
 } CPD_MBCSV_MSG_TYPE;
 
@@ -64,6 +65,18 @@ typedef struct cpd_a2s_ckpt_usr_info {
 
 } CPD_A2S_CKPT_USR_INFO;
 
+typedef struct cpd_a2s_ckpt_usr_info_2 {
+   SaCkptCheckpointHandleT ckpt_id;
+   uint32_t num_user;
+   uint32_t num_writer;
+   uint32_t num_reader;
+   uint32_t num_sections;
+   uint32_t ckpt_on_scxb1;
+   uint32_t ckpt_on_scxb2;
+   uint32_t node_users_cnt;
+   CPD_NODE_USER_INFO *node_list;
+} CPD_A2S_CKPT_USR_INFO_2;
+
 typedef struct cpd_mbcsv_msg {
CPD_MBCSV_MSG_TYPE type;
union {
@@ -76,6 +89,7 @@ typedef struct cpd_mbcsv_msg {
CPD_A2S_CKPT_UNLINK ckpt_ulink;
CPD_A2S_CKPT_USR_INFO usr_info;
CPSV_CKPT_DEST_INFO dest_down;
+   CPD_A2S_CKPT_USR_INFO_2 usr_info_2;
} info;
 } CPD_MBCSV_MSG;
 
diff --git a/osaf/libs/common/cpsv/include/cpsv_evt.h 
b/osaf/libs/common/cpsv/include/cpsv_evt.h
--- a/osaf/libs/common/cpsv/include/cpsv_evt.h
+++ b/osaf/libs/common/cpsv/include/cpsv_evt.h
@@ -840,6 +840,14 @@ typedef struct cpd_tmr_info {
} info;
 } CPD_TMR_INFO;
 
+typedef struct cpd_node_user_info {
+   MDS_DEST dest;
+   uint32_t num_users;
+   uint32_t num_writers;
+   uint32_t num_readers;
+   struct cpd_node_user_info *next;
+} CPD_NODE_USER_INFO;
+
 /**
  CPD Event Data Structures
  
**/
diff --git a/osaf/services/saf/cpsv/cpd/cpd_db.c 
b/osaf/services/saf/cpsv/cpd/cpd_db.c
--- a/osaf/services/saf/cpsv/cpd/cpd_db.c
+++ b/osaf/services/saf/cpsv/cpd/cpd_db.c
@@ -137,6 +137,7 @@ uint32_t cpd_ckpt_node_delete(CPD_CB *cb
 {
uint32_t rc = NCSCC_RC_SUCCESS;
CPD_NODE_REF_INFO *nref_info, *next_info;
+   CPD_NODE_USER_INFO *node_user, *next_node_user;
 
TRACE_ENTER();
 
@@ -153,6 +154,13 @@ uint32_t cpd_ckpt_node_delete(CPD_CB *cb
nref_info = next_info;
}
 
+   node_user = ckpt_node->node_users;
+   while (node_user) {
+   

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

2016-05-04 Thread Nhat Pham
Summary: cpsv: To update checkpoint user number for each node [#1669] V3
Review request for Trac Ticket(s): 1669
Peer Reviewer(s): mahesh.va...@oracle.com; anders.wid...@ericsson.com
Pull request to: mahesh.va...@oracle.com
Affected branch(es): default, 5.0
Development branch: default


Impacted area   Impact y/n

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


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

changeset f24546e0ffac7511d0bbdac2c2209b95f6706bfe
Author: Nhat Pham 
Date:   Wed, 04 May 2016 13:04:07 +0700

cpsv: To update checkpoint user number for each node [#1669] V3

Problem:
--- 
The saCkptCheckpointNumOpeners is not updated when a node which has a
checkpoint client restarts.

Solution:
 
Currently CPD doesn't store number of user on each node. This patch
updates CPD to update information about users on each node for each
checkpoint. When a node restarts, the CPD update the total number of 
users
for a checkpoint accordingly. This is reflected on
saCkptCheckpointNumOpeners attribute correctly.


Complete diffstat:
--
 osaf/libs/common/cpsv/include/cpd_cb.h   |2 ++
 osaf/libs/common/cpsv/include/cpd_proc.h |3 +++
 osaf/libs/common/cpsv/include/cpd_red.h  |   14 ++
 osaf/libs/common/cpsv/include/cpsv_evt.h |8 
 osaf/services/saf/cpsv/cpd/cpd_db.c  |   14 --
 osaf/services/saf/cpsv/cpd/cpd_evt.c |8 
 osaf/services/saf/cpsv/cpd/cpd_mbcsv.c   |   90 
+++---
 osaf/services/saf/cpsv/cpd/cpd_proc.c|  148 

 osaf/services/saf/cpsv/cpd/cpd_red.c |   32 

 osaf/services/saf/cpsv/cpd/cpd_sbevt.c   |   68 

 10 files changed, 370 insertions(+), 17 deletions(-)


Testing Commands:
-
Following steps described in ticket


Testing, Expected Results:
--
Refer the ticket description


Conditions of Submission:
-
-


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


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


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

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

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

___ Your patches do not have proper short+long header

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

___