osaf/services/saf/cpsv/cpd/cpd_db.c   |  15 +++++++++++++++
 osaf/services/saf/cpsv/cpd/cpd_evt.c  |   6 +++---
 osaf/services/saf/cpsv/cpd/cpd_proc.c |   9 +++++++--
 3 files changed, 25 insertions(+), 5 deletions(-)


Problem:
--------
In case a failover happens while a checkpoint is being unlinked, it might 
causes an unfinished
unlink operation (i.e the checkpoint IMM object is not deleted). Later on, when 
the checkpoint is
created again, it will not succeed because the CPD detects that the checkpoint 
IMM object existing.

Fix:
----
The solution is to delete the existing checkpoint IMM object and re-create a 
new object during
creating checkpoint process.

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
@@ -104,6 +104,21 @@ uint32_t cpd_ckpt_node_add(NCS_PATRICIA_
        /*create the imm runtime object */
        if (ha_state == SA_AMF_HA_ACTIVE) {
                err = create_runtime_ckpt_object(ckpt_node, immOiHandle);
+               
+               /* The Checkpoint IMM object exist due to unfinished previous 
opernation (e.g unlink)
+                * The action is to delete the old object and create a new one 
*/
+
+               if (err == SA_AIS_ERR_EXIST) {
+                       LOG_WA("cpd ckpt node add - the IMM object exits 
%s",ckpt_node->ckpt_name.value);
+
+                       if (immutil_saImmOiRtObjectDelete(immOiHandle, 
&ckpt_node->ckpt_name) != SA_AIS_OK) {
+                               LOG_ER("Deleting run time object %s 
FAILED",ckpt_node->ckpt_name.value);
+                               return NCSCC_RC_FAILURE;
+                       }
+
+                       err = create_runtime_ckpt_object(ckpt_node, 
immOiHandle);
+               }
+
                if (err != SA_AIS_OK) {
                        LOG_ER("create runtime ckpt object failed with error: 
%u",err);
                        return NCSCC_RC_FAILURE;
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
@@ -589,9 +589,9 @@ static uint32_t cpd_evt_proc_ckpt_unlink
 
                /* delete imm ckpt runtime object */
                if (cb->ha_state == SA_AMF_HA_ACTIVE) {
-                       if (immutil_saImmOiRtObjectDelete(cb->immOiHandle, 
&ckpt_node->ckpt_name) != SA_AIS_OK) {
-                               TRACE_4("Deleting run time object %s 
failed",ckpt_node->ckpt_name.value);
-                               /* Free the Client Node */
+                       SaAisErrorT result = 
immutil_saImmOiRtObjectDelete(cb->immOiHandle, &ckpt_node->ckpt_name);
+                       if (result != SA_AIS_OK) {
+                               LOG_ER("Deleting run time object %s failed - 
result = %d",ckpt_node->ckpt_name.value, result);
                        }
                }
        }
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
@@ -346,7 +346,8 @@ uint32_t cpd_ckpt_db_entry_update(CPD_CB
                        proc_rc = 
cpd_ckpt_reploc_node_add(&cb->ckpt_reploc_tree, reploc_info, cb->ha_state, 
cb->immOiHandle);
                        if (proc_rc != NCSCC_RC_SUCCESS) {
                                /* goto reploc_node_add_fail; */
-                               TRACE_4("cpd db add failed ");
+                               LOG_ER("cpd db replica add failed ");
+                               goto replica_node_add_fail;
                        }
                }
 
@@ -365,9 +366,13 @@ uint32_t cpd_ckpt_db_entry_update(CPD_CB
        TRACE_LEAVE();
        return NCSCC_RC_SUCCESS;
 
+ replica_node_add_fail:
+       cpd_ckpt_node_delete(cb, ckpt_node);
+
  ckpt_node_add_fail:
+       cpd_ckpt_map_node_delete(cb, map_info);
+
  map_node_add_fail:
-       /* This is the unexpected failure case, (Process TBD ) */
        TRACE("UNEXPECTED FAILURE");
        TRACE_LEAVE();
        return proc_rc;

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to