src/clm/clmd/clms_imm.c   |  24 ++++++++++--------------
 src/clm/clmd/clms_mbcsv.c |  23 +++++++++++++++++++++++
 src/clm/clmd/clms_mbcsv.h |   1 +
 3 files changed, 34 insertions(+), 14 deletions(-)


In the reported issue standby CLMD asserts while processing async update
related to node.

While standby controller is joining the cluster and a clm node is added
using CCB operations then standby may not read this object from IMM. This can
happen when active is still processing apply callback and standby has finised 
reading
from IMM. Also if standby CLMD is still not visible to active CLMD via MBCSV 
then
active will not checkpoint this newly added node. If this node does not come up
before standby CLMD joins cluster active will not get nodeid of new node and 
hence
it will not be added in node_id db. During cold sync phase active shares only 
node_id db
with standby. Thus this new node will not be available in standby db. Now if a 
user
modifies any attribute of this new node via CCB, active will checkpoint this 
information.
Since standby CLMD does not have this node it asserts while searching for node.

Patch fixes the problem by sending full record of newly added node during CCB 
modification.
Upon receiving this record, standby will add this new node in its db.

diff --git a/src/clm/clmd/clms_imm.c b/src/clm/clmd/clms_imm.c
--- a/src/clm/clmd/clms_imm.c
+++ b/src/clm/clmd/clms_imm.c
@@ -1751,7 +1751,14 @@ SaAisErrorT clms_node_ccb_apply_modify(C
        clms_node_reconfigured_ntf(clms_cb, node);
        node->change = SA_CLM_NODE_NO_CHANGE;
 
-       ckpt_node_rec(node);
+       /*
+          If node is also created through CCB when standby 
+          is coming up then standby may not read this node from IMM. Also 
Standby
+          will not get node information from COLD sync also (active shares
+          only node_id based db during cold sync).
+          So send full node record.
+        */
+       send_async_update_for_node_rec(node);
        ckpt_cluster_rec();
 
        TRACE_LEAVE();
@@ -1801,19 +1808,8 @@ SaAisErrorT clms_node_ccb_apply_cb(CcbUt
 
                /* Need to discuss - if need to send Clmtrack callback with 
node 
                   join from here as node create might not imply node member */
-               if (clms_cb->ha_state == SA_AMF_HA_ACTIVE) {
-
-                       memset(&ckpt, 0, sizeof(CLMS_CKPT_REC));
-                       ckpt.header.type = CLMS_CKPT_NODE_REC;
-                       ckpt.header.num_ckpt_records = 1;
-                       ckpt.header.data_len = 1;
-                       prepare_ckpt_node(&ckpt.param.node_csync_rec, 
opdata->userData);
-
-                       rc = clms_send_async_update(clms_cb, &ckpt, 
NCS_MBCSV_ACT_ADD);
-                       if (rc != NCSCC_RC_SUCCESS)
-                               TRACE("send_async_update FAILED rc = %u", 
(unsigned int)rc);
-               }
-
+               if (clms_cb->ha_state == SA_AMF_HA_ACTIVE)
+                       send_async_update_for_node_rec(opdata->userData);
                break;
        case CCBUTIL_MODIFY:
                saflog(LOG_NOTICE, clmSvcUsrName, "%s MODIFIED", 
opdata->objectName.value);
diff --git a/src/clm/clmd/clms_mbcsv.c b/src/clm/clmd/clms_mbcsv.c
--- a/src/clm/clmd/clms_mbcsv.c
+++ b/src/clm/clmd/clms_mbcsv.c
@@ -2719,3 +2719,26 @@ static uint32_t ckpt_err_ind_cbk_handler
        /* Currently nothing to be done. */
        return NCSCC_RC_SUCCESS;
 }
+
+/**
+ * @brief Sends async update for node record. It assumes that
+ *       standby does not have this record.
+ * @param  ptr to cluster_node( CLMS_CLUSTER_NODE).
+ */
+void send_async_update_for_node_rec(CLMS_CLUSTER_NODE *cluster_node)
+{
+       TRACE_ENTER();
+       CLMS_CKPT_REC ckpt;
+       uint32_t rc = NCSCC_RC_SUCCESS;
+
+       memset(&ckpt, 0, sizeof(CLMS_CKPT_REC));
+       ckpt.header.type = CLMS_CKPT_NODE_REC;
+       ckpt.header.num_ckpt_records = 1;
+       ckpt.header.data_len = 1;
+       prepare_ckpt_node(&ckpt.param.node_csync_rec, cluster_node);
+
+       rc = clms_send_async_update(clms_cb, &ckpt, NCS_MBCSV_ACT_ADD);
+       if (rc != NCSCC_RC_SUCCESS)
+               TRACE("send_async_update FAILED rc = %u", (unsigned int)rc);
+       TRACE_LEAVE();
+}
diff --git a/src/clm/clmd/clms_mbcsv.h b/src/clm/clmd/clms_mbcsv.h
--- a/src/clm/clmd/clms_mbcsv.h
+++ b/src/clm/clmd/clms_mbcsv.h
@@ -167,4 +167,5 @@ extern void prepare_ckpt_to_ckpt_config_
                                              CLMSV_CKPT_NODE_CONFIG_REC * 
cluster_node);
 extern uint32_t encodeNodeAddressT(NCS_UBAID *uba, SaClmNodeAddressT 
*nodeAddress);
 
+extern void send_async_update_for_node_rec(CLMS_CLUSTER_NODE *cluster_node);
 #endif  // CLM_CLMD_CLMS_MBCSV_H_

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to