Re: [devel] [PATCH 1/1] clmd: not send sync respond to client if node down [#3004]
Hi Minh, There is NO node info in data base of CLM in both case node down and node unconfigured. So we can not use it to distingush b/w them. B.R /Thang -Original Message- From: Minh Hon Chau Sent: Wednesday, February 13, 2019 9:49 AM To: Tran Thuan ; 'thang.d.nguyen' ; gary@dektech.com.au Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [PATCH 1/1] clmd: not send sync respond to client if node down [#3004] Hi Thang, The patch looks ok, but I'm thinking of not introducing mds_node_down_list. In SAI-AIS-CLM-B.04.01: "The term unconfigured node is used in this document to designate an execution environment that is not configured to host a CLM node." May we add a check if a node is unconfigured because it's not in ee_lookup, to distinguish with if a node is down? Thanks Minh On 1/2/19 2:34 pm, Tran Thuan wrote: > Hi Thang, > > ACK from me for code review, not tested. > > Best Regards, > ThuanTr > > -Original Message- > From: thang.d.nguyen > Sent: Wednesday, January 30, 2019 1:20 AM > To: gary@dektech.com.au; minh.c...@dektech.com.au; > thuan.t...@dektech.com.au > Cc: opensaf-devel@lists.sourceforge.net; thang.d.nguyen > > Subject: [PATCH 1/1] clmd: not send sync respond to client if node > down [#3004] > > Clmd will not send sync respond to client if the node that client > resided on down. This will avoid timeout when clmd send via mds. > --- > src/clm/clmd/clms_cb.h | 3 +++ > src/clm/clmd/clms_evt.cc | 22 +- > src/clm/clmd/clms_mds.cc | 2 +- > 3 files changed, 21 insertions(+), 6 deletions(-) > > diff --git a/src/clm/clmd/clms_cb.h b/src/clm/clmd/clms_cb.h index > 4d7fdc7..637d53a 100644 > --- a/src/clm/clmd/clms_cb.h > +++ b/src/clm/clmd/clms_cb.h > @@ -22,6 +22,7 @@ > #include "osaf/config.h" > #endif > #include > +#include > #include > #include > #include > @@ -238,6 +239,8 @@ typedef struct clms_cb_t { > *node_down_list_head; /*NODE_DOWN record - Fix when active > node goes down >*/ > NODE_DOWN_LIST *node_down_list_tail; > + // Record node id when receive MDS node down std::set > + mds_node_down_list; > bool is_impl_set; > bool nid_started; /**< true if started by NID */ > NCS_PATRICIA_TREE iplist; /* To temporarily store ipaddress > information diff --git a/src/clm/clmd/clms_evt.cc > b/src/clm/clmd/clms_evt.cc index > c2b83c2..5265002 100644 > --- a/src/clm/clmd/clms_evt.cc > +++ b/src/clm/clmd/clms_evt.cc > @@ -943,6 +943,8 @@ static uint32_t proc_mds_node_evt(CLMSV_CLMS_EVT *evt) { > goto done; > } > > + clms_cb->mds_node_down_list.insert(node_id); > + > if ((clms_cb->ha_state == SA_AMF_HA_ACTIVE) || > (clms_cb->ha_state == SA_AMF_HA_QUIESCED)) { > clms_track_send_node_down(node); @@ -1531,19 +1533,24 @@ static > uint32_t proc_initialize_msg(CLMS_CB *cb, CLMSV_CLMS_EVT *evt) { > > TRACE_ENTER2("dest %" PRIx64, evt->fr_dest); > > - /*Handle the wrap around */ > - if (clms_cb->last_client_id == INT_MAX) clms_cb->last_client_id = > 0; > - > - clms_cb->last_client_id++; > - > node = clms_node_get_by_id(node_id); > TRACE("Node id = %d", node_id); > if (node == nullptr) { > LOG_IN("Initialize request of client on an unconfigured node: > node_id = %d", > node_id); > ais_rc = SA_AIS_ERR_UNAVAILABLE; > +std::set::iterator it = > + clms_cb->mds_node_down_list.find(node_id); > +if (it != clms_cb->mds_node_down_list.end()) { > + return (uint32_t)ais_rc; > +} > } > > + /*Handle the wrap around */ > + if (clms_cb->last_client_id == INT_MAX) clms_cb->last_client_id = > + 0; > + > + clms_cb->last_client_id++; > + > if ((client = clms_client_new(evt->fr_dest, clms_cb->last_client_id)) == > nullptr) { > TRACE("Creating a new client failed"); @@ -1564,6 +1571,11 @@ > static uint32_t proc_initialize_msg(CLMS_CB *cb, CLMSV_CLMS_EVT *evt) { > return rc; > } > > + std::set::iterator it = > + clms_cb->mds_node_down_list.find(node_id); > + if (it != clms_cb->mds_node_down_list.end()) { > +clms_cb->mds_node_down_list.erase(it); > + } > + > if (node) { > if (node->member == false) { > rc = clms_send_is_member_info(clms_cb, node->node_id, > node->member, diff --git a/src/clm/clmd/clms_mds.cc > b/src/clm/clmd/clms_mds.cc index 58552cc..833d18c 100644 > --- a/src/clm/clmd/clms_mds.cc > +++ b/src/clm/clmd/clms_mds.cc > @@ -1097,7 +1097,7 @@ static uint32_t clms_mds_node_event(struct > ncsmds_callback_info *mds_info) { > clmsv_evt->info.node_mds_info.node_id = > mds_info->info.node_evt.node_id; > clmsv_evt->info.node_mds_info.nodeup = SA_TRUE; > > -rc = m_NCS_IPC_SEND(_cb->mbx, clmsv_evt, NCS_IPC_PRIORITY_HIGH); > +rc = m_NCS_IPC_SEND(_cb->mbx, clmsv_evt, > + NCS_IPC_PRIORITY_VERY_HIGH); > if (rc != NCSCC_RC_SUCCESS) { > TRACE("IPC send failed
Re: [devel] Opensaf-devel Digest, Vol 69, Issue 11
Hi Shiva, Looks like your application is quite similar to an amf sample app, it's under samples/amf/sa_aware, you can try the sample app and then replace it with your confD. Thanks, Minh On 12/2/19 11:09 pm, opensaf-devel-requ...@lists.sourceforge.net wrote: Send Opensaf-devel mailing list submissions to opensaf-devel@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/opensaf-devel or, via email, send a message with subject or body 'help' to opensaf-devel-requ...@lists.sourceforge.net You can reach the person managing the list at opensaf-devel-ow...@lists.sourceforge.net When replying, please edit your Subject line so it is more specific than "Re: Contents of Opensaf-devel digest..." Today's Topics: 1. ConfD Integration with opensaf (shiva) -- Message: 1 Date: Tue, 12 Feb 2019 14:40:26 +0530 From: shiva To: opensaf-devel@lists.sourceforge.net Subject: [devel] ConfD Integration with opensaf Message-ID: Content-Type: text/plain; charset=utf-8; format=flowed Hello all, ??? I want to integrate confD with opensaf. Is there any document or example code that explains about the integration process? ??? ??? I want to configure opensaf to handle 2N nodes (master/slave) in confD. ??? ??? ??? My requirement is that when the master node goes down the slave node should automatically take over and become the master. ??? ??? ??? ??? Thanks in advance. Regards. -- -- Subject: Digest Footer ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel -- End of Opensaf-devel Digest, Vol 69, Issue 11 * ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1/1] clmd: not send sync respond to client if node down [#3004]
Hi Thang, The patch looks ok, but I'm thinking of not introducing mds_node_down_list. In SAI-AIS-CLM-B.04.01: "The term unconfigured node is used in this document to designate an execution environment that is not configured to host a CLM node." May we add a check if a node is unconfigured because it's not in ee_lookup, to distinguish with if a node is down? Thanks Minh On 1/2/19 2:34 pm, Tran Thuan wrote: Hi Thang, ACK from me for code review, not tested. Best Regards, ThuanTr -Original Message- From: thang.d.nguyen Sent: Wednesday, January 30, 2019 1:20 AM To: gary@dektech.com.au; minh.c...@dektech.com.au; thuan.t...@dektech.com.au Cc: opensaf-devel@lists.sourceforge.net; thang.d.nguyen Subject: [PATCH 1/1] clmd: not send sync respond to client if node down [#3004] Clmd will not send sync respond to client if the node that client resided on down. This will avoid timeout when clmd send via mds. --- src/clm/clmd/clms_cb.h | 3 +++ src/clm/clmd/clms_evt.cc | 22 +- src/clm/clmd/clms_mds.cc | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/clm/clmd/clms_cb.h b/src/clm/clmd/clms_cb.h index 4d7fdc7..637d53a 100644 --- a/src/clm/clmd/clms_cb.h +++ b/src/clm/clmd/clms_cb.h @@ -22,6 +22,7 @@ #include "osaf/config.h" #endif #include +#include #include #include #include @@ -238,6 +239,8 @@ typedef struct clms_cb_t { *node_down_list_head; /*NODE_DOWN record - Fix when active node goes down */ NODE_DOWN_LIST *node_down_list_tail; + // Record node id when receive MDS node down std::set + mds_node_down_list; bool is_impl_set; bool nid_started; /**< true if started by NID */ NCS_PATRICIA_TREE iplist; /* To temporarily store ipaddress information diff --git a/src/clm/clmd/clms_evt.cc b/src/clm/clmd/clms_evt.cc index c2b83c2..5265002 100644 --- a/src/clm/clmd/clms_evt.cc +++ b/src/clm/clmd/clms_evt.cc @@ -943,6 +943,8 @@ static uint32_t proc_mds_node_evt(CLMSV_CLMS_EVT *evt) { goto done; } + clms_cb->mds_node_down_list.insert(node_id); + if ((clms_cb->ha_state == SA_AMF_HA_ACTIVE) || (clms_cb->ha_state == SA_AMF_HA_QUIESCED)) { clms_track_send_node_down(node); @@ -1531,19 +1533,24 @@ static uint32_t proc_initialize_msg(CLMS_CB *cb, CLMSV_CLMS_EVT *evt) { TRACE_ENTER2("dest %" PRIx64, evt->fr_dest); - /*Handle the wrap around */ - if (clms_cb->last_client_id == INT_MAX) clms_cb->last_client_id = 0; - - clms_cb->last_client_id++; - node = clms_node_get_by_id(node_id); TRACE("Node id = %d", node_id); if (node == nullptr) { LOG_IN("Initialize request of client on an unconfigured node: node_id = %d", node_id); ais_rc = SA_AIS_ERR_UNAVAILABLE; +std::set::iterator it = + clms_cb->mds_node_down_list.find(node_id); +if (it != clms_cb->mds_node_down_list.end()) { + return (uint32_t)ais_rc; +} } + /*Handle the wrap around */ + if (clms_cb->last_client_id == INT_MAX) clms_cb->last_client_id = 0; + + clms_cb->last_client_id++; + if ((client = clms_client_new(evt->fr_dest, clms_cb->last_client_id)) == nullptr) { TRACE("Creating a new client failed"); @@ -1564,6 +1571,11 @@ static uint32_t proc_initialize_msg(CLMS_CB *cb, CLMSV_CLMS_EVT *evt) { return rc; } + std::set::iterator it = + clms_cb->mds_node_down_list.find(node_id); + if (it != clms_cb->mds_node_down_list.end()) { +clms_cb->mds_node_down_list.erase(it); + } + if (node) { if (node->member == false) { rc = clms_send_is_member_info(clms_cb, node->node_id, node->member, diff --git a/src/clm/clmd/clms_mds.cc b/src/clm/clmd/clms_mds.cc index 58552cc..833d18c 100644 --- a/src/clm/clmd/clms_mds.cc +++ b/src/clm/clmd/clms_mds.cc @@ -1097,7 +1097,7 @@ static uint32_t clms_mds_node_event(struct ncsmds_callback_info *mds_info) { clmsv_evt->info.node_mds_info.node_id = mds_info->info.node_evt.node_id; clmsv_evt->info.node_mds_info.nodeup = SA_TRUE; -rc = m_NCS_IPC_SEND(_cb->mbx, clmsv_evt, NCS_IPC_PRIORITY_HIGH); +rc = m_NCS_IPC_SEND(_cb->mbx, clmsv_evt, + NCS_IPC_PRIORITY_VERY_HIGH); if (rc != NCSCC_RC_SUCCESS) { TRACE("IPC send failed %d", rc); free(clmsv_evt); -- 2.7.4 ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] ConfD Integration with opensaf
Hello all, I want to integrate confD with opensaf. Is there any document or example code that explains about the integration process? I want to configure opensaf to handle 2N nodes (master/slave) in confD. My requirement is that when the master node goes down the slave node should automatically take over and become the master. Thanks in advance. Regards. ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel