osaf/services/saf/cpsv/cpd/cpd_db.c | 4 ++++
osaf/services/saf/cpsv/cpd/cpd_proc.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)
Problem:
--------
The replica IMM objects are not created after opening a checkpoint in following
scenario:
1. Open a checkpoint with flag SA_CKPT_CHECKPOINT_CREATE
2. Unlink the checkpoint ( the checkpoint is still being used)
3. Open a checkpoint with flag SA_CKPT_CHECKPOINT_CREATE with same name as the
one in 1.
After step 3. although the checkpoint is opened successfully, the replica IMM
objects
are not created.
The problem happens because the CPD does not delete relating nodes from
ckpt_reploc_tree
when it unlinks the checkpoint in step 2.
Solution:
---------
The solution is to remove replica location node of that checkpoint from the
ckpt_reploc_tree
when unlinking the checkpoint.
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
@@ -420,6 +420,8 @@ uint32_t cpd_ckpt_reploc_node_delete(CPD
{
uint32_t rc = NCSCC_RC_SUCCESS;
+ TRACE_ENTER();
+
if (cb->ha_state == SA_AMF_HA_ACTIVE) {
rc = cpd_ckpt_reploc_imm_object_delete(cb, ckpt_reploc_node,
is_unlink_set);
@@ -441,6 +443,7 @@ uint32_t cpd_ckpt_reploc_node_delete(CPD
TRACE_4("cpd db node add failed ");
}
+ TRACE_LEAVE();
return NCSCC_RC_FAILURE;
}
@@ -448,6 +451,7 @@ uint32_t cpd_ckpt_reploc_node_delete(CPD
if (ckpt_reploc_node)
m_MMGR_FREE_CPD_CKPT_REPLOC_INFO(ckpt_reploc_node);
+ TRACE_LEAVE();
return 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
@@ -1021,6 +1021,36 @@ uint32_t cpd_proc_unlink_set(CPD_CB *cb,
(*ckpt_node)->attributes = map_info->attributes;
/* Delete the MAP Info */
rc = cpd_ckpt_map_node_delete(cb, map_info);
+
+ /* Delete replica location of the unlinked checkpoint from the
ckpt_reploc_tree */
+ CPD_NODE_REF_INFO *nref_info = (*ckpt_node)->node_list;
+
+ while (nref_info) {
+ SaClmNodeIdT node_id =
m_NCS_NODE_ID_FROM_MDS_DEST(nref_info->dest);
+ SaClmClusterNodeT cluster_node;
+ CPD_REP_KEY_INFO key_info;
+ CPD_CKPT_REPLOC_INFO *reploc_info = NULL;
+
+ memset(&cluster_node, 0, sizeof(SaClmClusterNodeT));
+ memset(&key_info, 0, sizeof(CPD_REP_KEY_INFO));
+
+ if (saClmClusterNodeGet(cb->clm_hdl, node_id,
CPD_CLM_API_TIMEOUT, &cluster_node) != SA_AIS_OK) {
+ LOG_ER("cpd unlink set - saClmClusterNodeGet failed for
node_id %u",node_id);
+ rc = SA_AIS_ERR_LIBRARY;
+ break;
+ }
+
+ key_info.node_name = cluster_node.nodeName;
+ key_info.ckpt_name = *ckpt_name;
+
+ cpd_ckpt_reploc_get(&cb->ckpt_reploc_tree, &key_info,
&reploc_info);
+ if (reploc_info) {
+ cpd_ckpt_reploc_node_delete(cb, reploc_info,
(*ckpt_node)->is_unlink_set);
+ }
+
+ nref_info = nref_info->next;
+ }
+
TRACE_LEAVE();
return rc;
}
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel