osaf/services/saf/cpsv/cpnd/cpnd_evt.c |  80 +++++++++++++++++++++++++++------
 1 files changed, 65 insertions(+), 15 deletions(-)


In current implementation  of non-collocated checkpoint,  If a  checkpoint is 
opened for the first time
by an application residing on a payload blade, the replicas will be created on 
the local payload blade
 and both the system controller nodes. In this case, the replica residing on 
the payload blade is designated as active replica.
If a non-collocated checkpoint is opened for the first time by an application 
residing on the system controller nodes,
the replica will be created only on the system controller blade. In this case, 
this replica on a system controller node will act as the active replica.
 If another application opens the same checkpoint from a payload node, the 
checkpoint service will not create the replica on that node.

Bug :
Based on current implementation  for NON_COLLOCATED CHECKPOINT application , if 
saCkptCheckpointTrackCallback is registered,
for  saCkptCheckpointWrite() & saCkptSectionOverwrite() TrackCallback are 
getting invoked properly ,
but for saCkptSectionCreate( With Initial Data) & saCkptSectionDelete() the 
TrackCallback is not getting invoked.

Fix :
Now trackcallback will be raised  even the replica is NOT residing on the 
payload blade for
saCkptSectionCreate( With Initial Data) & saCkptSectionDelete() .

diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c 
b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
--- a/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
+++ b/osaf/services/saf/cpsv/cpnd/cpnd_evt.c
@@ -643,7 +643,7 @@ static uint32_t cpnd_evt_proc_ckpt_open(
                                ((cp_node->open_active_sync_tmr.is_active) &&
                                 (cp_node->open_active_sync_tmr.lcl_ckpt_hdl == 
evt->info.openReq.lcl_ckpt_hdl))){
                        send_evt.info.cpa.info.openRsp.error = 
SA_AIS_ERR_TRY_AGAIN;
-                       LOG_ER("cpnd Open try again sync_tmr exist or ndrestart 
for lcl_ckpt_hdl:%llx ckpt:%llx",evt->info.openReq.lcl_ckpt_hdl, client_hdl);
+                       LOG_NO("cpnd Open try again sync_tmr exist or ndrestart 
for lcl_ckpt_hdl:%llx ckpt:%llx",evt->info.openReq.lcl_ckpt_hdl, client_hdl);
                        goto agent_rsp;
                }
 
@@ -2667,9 +2667,45 @@ static uint32_t cpnd_evt_proc_nd2nd_ckpt
                                    evt->info.active_sec_creat.ckpt_id;
                        }
                }
+       } else if (evt->info.active_sec_creat.init_data != NULL) {
+
+               if 
(!m_CPND_IS_COLLOCATED_ATTR_SET(cp_node->create_attrib.creationFlags)) {
+                       SaCkptSectionIdT *id = 
evt->info.active_sec_creat.sec_attri.sectionId;
+
+                       ckpt_data = m_MMGR_ALLOC_CPSV_CKPT_DATA;
+                       if (ckpt_data == NULL) {
+                               rc = NCSCC_RC_FAILURE;
+                               TRACE_4("cpnd ckpt data memory failed ");
+                               error = SA_AIS_ERR_NO_SPACE;
+                               goto nd_rsp;
+                       }
+
+                       memset(ckpt_data, '\0', sizeof(CPSV_CKPT_DATA));
+                       
+                       ckpt_data->sec_id.idLen = id->idLen;
+                       ckpt_data->sec_id.id = NULL;
+                       if (id->idLen > 0) {
+                               ckpt_data->sec_id.id = 
m_MMGR_ALLOC_CPND_DEFAULT(id->idLen);
+                               memcpy(ckpt_data->sec_id.id, id->id, 
ckpt_data->sec_id.idLen);
+                       }
+
+                       ckpt_data->data = evt->info.active_sec_creat.init_data;
+                       ckpt_data->dataSize = 
evt->info.active_sec_creat.init_size;
+                       ckpt_data->dataOffset = 0;
+
+                       memset(&ckpt_access, '\0', sizeof(CPSV_CKPT_ACCESS));
+                       ckpt_access.ckpt_id = cp_node->ckpt_id;
+                       ckpt_access.lcl_ckpt_id = 
evt->info.active_sec_creat.lcl_ckpt_id;
+                       ckpt_access.agent_mdest = 
evt->info.active_sec_creat.agent_mdest;
+                       ckpt_access.num_of_elmts = 1;
+                       ckpt_access.data = ckpt_data;
+
+                       cpnd_proc_ckpt_arrival_info_ntfy(cb, cp_node, 
&ckpt_access, sinfo);
+                       m_MMGR_FREE_CPSV_CKPT_DATA(ckpt_data);
+               }
        }
 
- nd_rsp:
+nd_rsp:
        send_evt.type = CPSV_EVT_TYPE_CPND;
        send_evt.info.cpnd.type = CPSV_EVT_ND2ND_CKPT_SECT_ACTIVE_CREATE_RSP;
        send_evt.info.cpnd.info.active_sec_creat_rsp.error = error;
@@ -2715,21 +2751,34 @@ static uint32_t cpnd_evt_proc_nd2nd_ckpt
        }
        sec_info = cpnd_ckpt_sec_del(cp_node, &evt->info.sec_delete_req.sec_id);
        if (sec_info == NULL) {
-               TRACE_4("cpnd ckpt sect del failed for sec_id:%s,ckpt_id:%llx",
-                               evt->info.sec_delete_req.sec_id.id, 
evt->info.sec_delete_req.ckpt_id);
-               send_evt.type = CPSV_EVT_TYPE_CPND;
-               send_evt.info.cpnd.type = CPSV_EVT_ND2ND_CKPT_SECT_DELETE_RSP;
-               send_evt.info.cpnd.info.sec_delete_rsp.error = 
SA_AIS_ERR_NOT_EXIST;
-               goto nd_rsp;
-
+               if 
(m_CPND_IS_COLLOCATED_ATTR_SET(cp_node->create_attrib.creationFlags)) {
+                       TRACE_4("cpnd ckpt sect del failed for 
sec_id:%s,ckpt_id:%llx",
+                                       evt->info.sec_delete_req.sec_id.id, 
evt->info.sec_delete_req.ckpt_id);
+                       send_evt.type = CPSV_EVT_TYPE_CPND;
+                       send_evt.info.cpnd.type = 
CPSV_EVT_ND2ND_CKPT_SECT_DELETE_RSP;
+                       send_evt.info.cpnd.info.sec_delete_rsp.error = 
SA_AIS_ERR_NOT_EXIST;
+                       goto nd_rsp;
+               }
+       } else {
+               /* resetting lcl_sec_id mapping */
+               cp_node->replica_info.shm_sec_mapping[sec_info->lcl_sec_id] = 1;
        }
-       /* resetting lcl_sec_id mapping */
-       cp_node->replica_info.shm_sec_mapping[sec_info->lcl_sec_id] = 1;
 
        /* Send the arrival callback */
        memset(&ckpt_data, '\0', sizeof(CPSV_CKPT_DATA));
-       if (sec_info) {
-               ckpt_data.sec_id = sec_info->sec_id;
+       if ((sec_info) || 
(!m_CPND_IS_COLLOCATED_ATTR_SET(cp_node->create_attrib.creationFlags))) {
+               if (sec_info) {
+                       ckpt_data.sec_id = sec_info->sec_id;
+               } else {
+                       SaCkptSectionIdT *id = &evt->info.sec_delete_req.sec_id;
+                       ckpt_data.sec_id.idLen = id->idLen;
+                       ckpt_data.sec_id.id = NULL;
+                       if (id->idLen > 0) {
+                               ckpt_data.sec_id.id = 
m_MMGR_ALLOC_CPND_DEFAULT(id->idLen);
+                               memcpy(ckpt_data.sec_id.id, id->id, 
ckpt_data.sec_id.idLen);
+                       }
+               }
+
                ckpt_data.data = NULL;
                ckpt_data.dataSize = 0;
                ckpt_data.dataOffset = 0;
@@ -2742,8 +2791,9 @@ static uint32_t cpnd_evt_proc_nd2nd_ckpt
                ckpt_access.data = &ckpt_data;
                cpnd_proc_ckpt_arrival_info_ntfy(cb, cp_node, &ckpt_access, 
sinfo);
        }
-
-       m_CPND_FREE_CKPT_SECTION(sec_info);
+       
+       if (sec_info)
+               m_CPND_FREE_CKPT_SECTION(sec_info);
        send_evt.type = CPSV_EVT_TYPE_CPND;
        send_evt.info.cpnd.type = CPSV_EVT_ND2ND_CKPT_SECT_DELETE_RSP;
        send_evt.info.cpnd.info.sec_delete_rsp.error = SA_AIS_OK;

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to