osaf/libs/common/cpsv/include/cpd_proc.h |   2 ++
 osaf/services/saf/cpsv/cpd/cpd_evt.c     |   8 +++++++-
 osaf/services/saf/cpsv/cpd/cpd_proc.c    |  22 ++++++++++++++++++++++
 3 files changed, 31 insertions(+), 1 deletions(-)


Problem:
--------
A non-collocated checkpoint is firstly created on SC-2. Then the checkpoint is 
closed on SC-2.
The CPD broadcasts CPND_EVT_D2ND_CKPT_RDSET with START to start retention 
duration timer on CPND
because there is no user. During that time the checkpoint is opened again and 
using on PL-3.
After retention duration, the checkpoint is destroyed on both SC-1 and SC-2.

Solution:
---------
The problem happens because the CPD doesn't broadcasts CPND_EVT_D2ND_CKPT_RDSET 
with STOP when the
checkpoint is opened again on PL-3. The CPD is updated to broadcasts 
CPND_EVT_D2ND_CKPT_RDSET with
STOP when the checkpoint is opened again.

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
@@ -71,6 +71,8 @@ uint32_t cpd_proc_retention_set(CPD_CB *
 uint32_t cpd_proc_unlink_set(CPD_CB *cb, CPD_CKPT_INFO_NODE **ckpt_node,
                                   CPD_CKPT_MAP_INFO *map_info, SaNameT 
*ckpt_name);
 
+void cpd_proc_broadcast_RDSET_STOP(SaCkptCheckpointHandleT ckpt_id, CPD_CB 
*cb);
+
 void cpd_cb_dump(void);
 
 uint32_t cpd_mbcsv_chgrole(CPD_CB *cb);
diff --git a/osaf/services/saf/cpsv/cpd/cpd_evt.c 
b/osaf/services/saf/cpsv/cpd/cpd_evt.c
--- a/osaf/services/saf/cpsv/cpd/cpd_evt.c
+++ b/osaf/services/saf/cpsv/cpd/cpd_evt.c
@@ -355,8 +355,14 @@ static uint32_t cpd_evt_proc_ckpt_create
        }
        if (is_first_rep)
                TRACE_2("cpd ckpt create success for first replica 
ckpt_id:%llx,dest :%"PRIu64,map_info->ckpt_id,sinfo->dest);
-       else
+       else 
                TRACE_2("cpd ckpt create success ckpt_id:%llx,dest 
:%"PRIu64,map_info->ckpt_id,sinfo->dest);
+       
+
+       /* In case the first user re-creates the existing non-collocated 
checkpoint. All CPND should stop RD timer */
+       if ((is_first_rep == false) && (!(map_info->attributes.creationFlags & 
SA_CKPT_CHECKPOINT_COLLOCATED))) 
+               if (ckpt_node->num_users == 1)
+                       cpd_proc_broadcast_RDSET_STOP(ckpt_node->ckpt_id, cb);
 
        TRACE_LEAVE();
        return proc_rc;
diff --git a/osaf/services/saf/cpsv/cpd/cpd_proc.c 
b/osaf/services/saf/cpsv/cpd/cpd_proc.c
--- a/osaf/services/saf/cpsv/cpd/cpd_proc.c
+++ b/osaf/services/saf/cpsv/cpd/cpd_proc.c
@@ -1251,3 +1251,25 @@ uint32_t cpd_ckpt_reploc_imm_object_dele
        }
        return NCSCC_RC_SUCCESS;
 }
+
+/******************************************************************************************
+ * Name          : cpd_proc_broadcast_RDSET_STOP
+ *
+ * Description   : This routine broadcast message CPND_EVT_D2ND_CKPT_RDSET 
with STOP
+ *
+ * Return Values : None 
+ *
+ * Notes         : None
+******************************************************************************************/
+
+void cpd_proc_broadcast_RDSET_STOP(SaCkptCheckpointHandleT ckpt_id, CPD_CB *cb)
+{
+       CPSV_EVT send_evt;
+
+       memset(&send_evt, 0, sizeof(CPSV_EVT));
+       send_evt.type = CPSV_EVT_TYPE_CPND;
+       send_evt.info.cpnd.type = CPND_EVT_D2ND_CKPT_RDSET;
+       send_evt.info.cpnd.info.rdset.ckpt_id = ckpt_id;
+       send_evt.info.cpnd.info.rdset.type = CPSV_CKPT_RDSET_STOP;
+       cpd_mds_bcast_send(cb, &send_evt, NCSMDS_SVC_ID_CPND);
+}

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to