Re: [devel] changing saAmfSGNumPrefActiveSUs for N+1 SG w/out bringing it down
Please do, that would be great. Thanks, Hans On 11 April 2014 17:37, Alex Jones ajo...@genband.com wrote: I notice that dynamically changing saAmfSGNumPrefActiveSUs for an N+1 service group is not supported, unless the service group is not unlocked. This prevents in-service capacity addition which really should be supported. Let's say you have a 6-slot ATCA chassis, but you only want to use 3 slots at first in a 2+1 setup. At some point in the future you want to add more active capacity, but still keep it N+1. Right now you would have to bring the SG down in order to add capacity, which is not desirable. Are there current plans to support this? If not, I am happy to take this on. Alex -- Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] amfd: use db_template for the SU db [#713]
One goal of refactoring I would say is to reduce code duplication with the help of good interfaces. In this case it is just a matter of having two insert methods, one that can fail and one that cannot, let's call it insert_unique. By using insert_unique asserts on the client side can be removed. About the comment on NCSCC_RC_SUCCESS/FAILURE I meant that we are trying to break out from the old legacy but in this case for not much reason use an error code from leap! Thanks, Hans -Original Message- From: Nagendra Kumar [mailto:nagendr...@oracle.com] Sent: den 22 april 2014 08:04 To: Hans Feldt Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [devel] [PATCH 1 of 1] amfd: use db_template for the SU db [#713] OK fixed before push but since this will become a pattern in about 20 places I think it would be better to have db-insert return void and internally do this check. What do you think? If we keep the check outside, it can give flexibility to the user whether to assert or not if insert fails. In some conditions if insert fails, function can return from there itself. Function() { If (Insert(su1) == fails) { Log(Duplicate SU1); Return; } Else { Continue } } As a side note, db-insert should not return NCSCC_RC_SUCCESS/FAILURE but a bool As far as description of insert says, it fails when it adds duplicate. Are we expecting other errors or did I get it wrong ? Thanks -Nagu -Original Message- From: Hans Feldt [mailto:osafde...@gmail.com] Sent: 22 April 2014 11:01 To: Nagendra Kumar Cc: Hans Nordeback; Praveen Malviya; opensaf-devel@lists.sourceforge.net Subject: Re: [PATCH 1 of 1] amfd: use db_template for the SU db [#713] OK fixed before push but since this will become a pattern in about 20 places I think it would be better to have db-insert return void and internally do this check. What do you think? As a side note, db-insert should not return NCSCC_RC_SUCCESS/FAILURE but a bool. Thanks, Hans On 18 April 2014 15:12, Nagendra Kumar nagendr...@oracle.com wrote: Ack with comment: We need to check for assert as done in avd_su_db_add when it fails to add. When insert returns NCSCC_RC_FAILURE, we need to assert or log error at all the places. - avd_su_db_add(su); + su_db-insert(su); Thanks -Nagu -Original Message- From: Hans Feldt [mailto:osafde...@gmail.com] Sent: 17 April 2014 15:45 To: hans.nordeb...@ericsson.com; Praveen Malviya; Nagendra Kumar Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] amfd: use db_template for the SU db [#713] osaf/services/saf/amf/amfd/ckpt_dec.cc| 20 +- osaf/services/saf/amf/amfd/ckpt_enc.cc| 13 +- osaf/services/saf/amf/amfd/ckpt_updt.cc | 12 +- osaf/services/saf/amf/amfd/comp.cc|2 +- osaf/services/saf/amf/amfd/imm.cc |8 +- osaf/services/saf/amf/amfd/include/su.h | 36 +-- osaf/services/saf/amf/amfd/include/susi.h |1 - osaf/services/saf/amf/amfd/ndproc.cc |2 +- osaf/services/saf/amf/amfd/sg_nway_fsm.cc |2 +- osaf/services/saf/amf/amfd/sgproc.cc |6 +- osaf/services/saf/amf/amfd/siass.cc | 78 +-- osaf/services/saf/amf/amfd/sirankedsu.cc |2 +- osaf/services/saf/amf/amfd/su.cc | 78 +++--- osaf/services/saf/amf/amfd/util.cc| 157 +++-- 14 files changed, 96 insertions(+), 321 deletions(-) diff --git a/osaf/services/saf/amf/amfd/ckpt_dec.cc b/osaf/services/saf/amf/amfd/ckpt_dec.cc --- a/osaf/services/saf/amf/amfd/ckpt_dec.cc +++ b/osaf/services/saf/amf/amfd/ckpt_dec.cc @@ -1452,7 +1452,7 @@ static uint32_t dec_su_preinstan(AVD_CL_ osafassert(status == NCSCC_RC_SUCCESS); - if (NULL == (su_struct = avd_su_get(su_ptr-name))) + if (NULL == (su_struct = su_db-find(su_ptr-name))) osafassert(0); /* Update the fields received in this checkpoint message */ @@ -1544,7 +1544,7 @@ static uint32_t dec_su_admin_state(AVD_C osafassert(status == NCSCC_RC_SUCCESS); - if (NULL == (su_struct = avd_su_get(su_ptr-name))) + if (NULL == (su_struct = su_db-find(su_ptr-name))) osafassert(0); /* Update the fields received in this checkpoint message */ @@ -1590,7 +1590,7 @@ static uint32_t dec_su_readiness_state(A osafassert(status == NCSCC_RC_SUCCESS); - if (NULL == (su_struct = avd_su_get(su_ptr-name))) + if (NULL == (su_struct = su_db-find(su_ptr-name))) osafassert(0); /* Update the fields received in this checkpoint message */ @@ -1636,7 +1636,7 @@ static uint32_t dec_su_pres_state(AVD_CL osafassert(status == NCSCC_RC_SUCCESS); - if (NULL ==
[devel] [PATCH 1 of 1] amfd: use db_template for the apptype db V1 [#713]
osaf/services/saf/amf/amfd/apptype.cc| 31 ++- osaf/services/saf/amf/amfd/include/app.h | 4 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/osaf/services/saf/amf/amfd/apptype.cc b/osaf/services/saf/amf/amfd/apptype.cc --- a/osaf/services/saf/amf/amfd/apptype.cc +++ b/osaf/services/saf/amf/amfd/apptype.cc @@ -23,22 +23,17 @@ #include si.h #include util.h -static NCS_PATRICIA_TREE apptype_db; +AmfDbAVD_APP_TYPE *app_type_db = 0; AVD_APP_TYPE *avd_apptype_get(const SaNameT *dn) { - SaNameT tmp = {0}; - - tmp.length = dn-length; - memcpy(tmp.value, dn-value, tmp.length); - - return (AVD_APP_TYPE *)ncs_patricia_tree_get(apptype_db, (uint8_t *)tmp); + return app_type_db-find(dn); } static void apptype_delete(AVD_APP_TYPE **apptype) { - unsigned int rc = ncs_patricia_tree_del(apptype_db, (*apptype)-tree_node); - osafassert(rc == NCSCC_RC_SUCCESS); + app_type_db-erase(*apptype); + delete [] (*apptype)-sgAmfApptSGTypes; delete *apptype; *apptype = NULL; @@ -46,13 +41,11 @@ static void apptype_delete(AVD_APP_TYPE static void apptype_add_to_model(AVD_APP_TYPE *app_type) { - unsigned int rc; - osafassert(app_type != NULL); TRACE('%s', app_type-name.value); - rc = ncs_patricia_tree_add(apptype_db, app_type-tree_node); - osafassert(rc == NCSCC_RC_SUCCESS); -} + + app_type_db-insert(app_type); + static int is_config_valid(const SaNameT *dn, const SaImmAttrValuesT_2 **attributes, const CcbUtilOperationData_t *opdata) @@ -113,11 +106,10 @@ static AVD_APP_TYPE *apptype_create(SaNa TRACE_ENTER2('%s', dn-value); app_type = new AVD_APP_TYPE(); - + memcpy(app_type-name.value, dn-value, dn-length); app_type-name.length = dn-length; - app_type-tree_node.key_info = (uint8_t *)(app_type-name); - + while ((attr = attributes[i++]) != NULL) if (!strcmp(attr-attrName, saAmfApptSGTypes)) break; @@ -291,10 +283,7 @@ void avd_apptype_remove_app(AVD_APP *app void avd_apptype_constructor(void) { - NCS_PATRICIA_PARAMS patricia_params; - - patricia_params.key_size = sizeof(SaNameT); - osafassert(ncs_patricia_tree_init(apptype_db, patricia_params) == NCSCC_RC_SUCCESS); + app_type_db = new AmfDbAVD_APP_TYPE; avd_class_impl_set(SaAmfAppBaseType, NULL, NULL, avd_imm_default_OK_completed_cb, NULL); diff --git a/osaf/services/saf/amf/amfd/include/app.h b/osaf/services/saf/amf/amfd/include/app.h --- a/osaf/services/saf/amf/amfd/include/app.h +++ b/osaf/services/saf/amf/amfd/include/app.h @@ -27,8 +27,6 @@ #include saAmf.h #include saImm.h -// TODO(hafe) remove include below when apptype is using map -#include ncspatricia.h #include sg.h #include si.h #include db_template.h @@ -37,8 +35,6 @@ struct avd_sg_tag; struct avd_si_tag; typedef struct avd_app_type_tag { - - NCS_PATRICIA_NODE tree_node;/* key is name */ SaNameT name; SaNameT *sgAmfApptSGTypes; uint32_t no_sg_types; -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] amfd: use db_template for the apptype db V1 [#713]
Ack with minor comment assert needed after insert :-) Please consider db as I suggested. Thanks, HansF -Original Message- From: Hans Nordebäck Sent: den 22 april 2014 10:03 To: Hans Feldt; praveen.malv...@oracle.com; nagendr...@oracle.com Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] amfd: use db_template for the apptype db V1 [#713] osaf/services/saf/amf/amfd/apptype.cc| 31 ++- osaf/services/saf/amf/amfd/include/app.h | 4 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/osaf/services/saf/amf/amfd/apptype.cc b/osaf/services/saf/amf/amfd/apptype.cc --- a/osaf/services/saf/amf/amfd/apptype.cc +++ b/osaf/services/saf/amf/amfd/apptype.cc @@ -23,22 +23,17 @@ #include si.h #include util.h -static NCS_PATRICIA_TREE apptype_db; +AmfDbAVD_APP_TYPE *app_type_db = 0; AVD_APP_TYPE *avd_apptype_get(const SaNameT *dn) { - SaNameT tmp = {0}; - - tmp.length = dn-length; - memcpy(tmp.value, dn-value, tmp.length); - - return (AVD_APP_TYPE *)ncs_patricia_tree_get(apptype_db, (uint8_t *)tmp); + return app_type_db-find(dn); } static void apptype_delete(AVD_APP_TYPE **apptype) { - unsigned int rc = ncs_patricia_tree_del(apptype_db, (*apptype)-tree_node); - osafassert(rc == NCSCC_RC_SUCCESS); + app_type_db-erase(*apptype); + delete [] (*apptype)-sgAmfApptSGTypes; delete *apptype; *apptype = NULL; @@ -46,13 +41,11 @@ static void apptype_delete(AVD_APP_TYPE static void apptype_add_to_model(AVD_APP_TYPE *app_type) { - unsigned int rc; - osafassert(app_type != NULL); TRACE('%s', app_type-name.value); - rc = ncs_patricia_tree_add(apptype_db, app_type-tree_node); - osafassert(rc == NCSCC_RC_SUCCESS); -} + + app_type_db-insert(app_type); + static int is_config_valid(const SaNameT *dn, const SaImmAttrValuesT_2 **attributes, const CcbUtilOperationData_t *opdata) @@ -113,11 +106,10 @@ static AVD_APP_TYPE *apptype_create(SaNa TRACE_ENTER2('%s', dn-value); app_type = new AVD_APP_TYPE(); - + memcpy(app_type-name.value, dn-value, dn-length); app_type-name.length = dn-length; - app_type-tree_node.key_info = (uint8_t *)(app_type-name); - + while ((attr = attributes[i++]) != NULL) if (!strcmp(attr-attrName, saAmfApptSGTypes)) break; @@ -291,10 +283,7 @@ void avd_apptype_remove_app(AVD_APP *app void avd_apptype_constructor(void) { - NCS_PATRICIA_PARAMS patricia_params; - - patricia_params.key_size = sizeof(SaNameT); - osafassert(ncs_patricia_tree_init(apptype_db, patricia_params) == NCSCC_RC_SUCCESS); + app_type_db = new AmfDbAVD_APP_TYPE; avd_class_impl_set(SaAmfAppBaseType, NULL, NULL, avd_imm_default_OK_completed_cb, NULL); diff --git a/osaf/services/saf/amf/amfd/include/app.h b/osaf/services/saf/amf/amfd/include/app.h --- a/osaf/services/saf/amf/amfd/include/app.h +++ b/osaf/services/saf/amf/amfd/include/app.h @@ -27,8 +27,6 @@ #include saAmf.h #include saImm.h -// TODO(hafe) remove include below when apptype is using map -#include ncspatricia.h #include sg.h #include si.h #include db_template.h @@ -37,8 +35,6 @@ struct avd_sg_tag; struct avd_si_tag; typedef struct avd_app_type_tag { - - NCS_PATRICIA_NODE tree_node;/* key is name */ SaNameT name; SaNameT *sgAmfApptSGTypes; uint32_t no_sg_types; -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over [#821]
Few comments: 1. report_admin_op_error could be used instead of avd_saImmOiAdminOperationResult stating appropriate reason. 2. The below code should be removed now from avd_sg_2n_siswap_func: if (susi-si-sg_of_si-sg_ncs_spec) { if (true == avd_cb-swap_switch ) { LOG_NO(SI Swap not possible, Controller role switch under progress); rc = SA_AIS_ERR_TRY_AGAIN; goto done; } } Thanks -Nagu -Original Message- From: Gary Lee [mailto:gary@dektech.com.au] Sent: 22 April 2014 09:36 To: hans.nordeb...@ericsson.com; Nagendra Kumar; Praveen Malviya; hans.fe...@ericsson.com Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over [#821] osaf/services/saf/amf/amfd/imm.cc | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) It has been found that an admin operation (other than controller switch-over) can be started after a controller switch-over has been initiated. The result of this can be that the admin operation response gets lost. The reason for it to get lost is that an IMM admin response has to be responded on the same node where it was initiated. The change is to disallow new admin operations when controller switch-over is in progress. This will result in TRYAGAIN to the issuing program which should stop once the AMF implementer has connected and the controller switch-over has finished. credit: Hans Feldt diff --git a/osaf/services/saf/amf/amfd/imm.cc b/osaf/services/saf/amf/amfd/imm.cc --- a/osaf/services/saf/amf/amfd/imm.cc +++ b/osaf/services/saf/amf/amfd/imm.cc @@ -650,6 +650,14 @@ static void admin_operation_cb(SaImmOiHa AVSV_AMF_CLASS_ID type = object_name_to_class_type(object_name); TRACE_ENTER2('%s', invocation: %llu, op: %llu, object_name-value, invocation, op_id); + + /* ignore admin ops if we are in the middle of a role switch */ + if (avd_cb-swap_switch == SA_TRUE) { + TRACE(Admin op received during a role switch); + avd_saImmOiAdminOperationResult(immoi_handle, invocation, SA_AIS_ERR_TRY_AGAIN); + goto done; + } + saflog(LOG_NOTICE, amfSvcUsrName, Admin op \%s\ initiated for '%s', invocation: %llu, admin_op_name(static_castSaAmfAdminOperationIdT(op_id)), object_name-value, invocation); @@ -659,6 +667,8 @@ static void admin_operation_cb(SaImmOiHa LOG_ER(Admin operation not supported for %s (%u), object_name-value, type); avd_saImmOiAdminOperationResult(immoi_handle, invocation, SA_AIS_ERR_INVALID_PARAM); } + +done: TRACE_LEAVE(); } -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 0 of 5] Review Request for AMF SU refactoring #713
Summary: amfd SU refactoring Review request for Trac Ticket(s): 713 Peer Reviewer(s): AMF developers Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE Affected branch(es): default Development branch: IF ANY GIVE THE REPO URL Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each y above): - changeset 89d505f5680924bcf384ff6a4130658751184923 Author: Hans Feldt hans.fe...@ericsson.com Date: Tue, 22 Apr 2014 12:53:56 +0200 amfd: cleanup SU [#713] su_act_state is not used thus can be made a dummy (not removed because of EDU usage). The corresponding enum AVD_SU_STATE removed. Checkpointing of su_act_state kept for backwards compatibility but reduced to a minimum. The use of this- is removed from some setters. Some non existing function signatures removed from the header file. changeset e81dc53b0733dee2b2bbe4d2ec1e3aa6d9dd9ca8 Author: Hans Feldt hans.fe...@ericsson.com Date: Tue, 22 Apr 2014 12:53:57 +0200 amfd: add and use SU method set_pres_state [#713] changeset 87d7fb15e249c363b2531f43df18d94fa1fa60fe Author: Hans Feldt hans.fe...@ericsson.com Date: Tue, 22 Apr 2014 12:53:57 +0200 amfd: add and use SU method set_admin_state [#713] changeset d2c7b29d6113153841ddaaa3ec4ae70784f89ac3 Author: Hans Feldt hans.fe...@ericsson.com Date: Tue, 22 Apr 2014 12:53:58 +0200 amfd: add and use SU methods add_comp/remove_comp [#713] changeset 4d6d0708b6923a306b9a5ae44be2ddda2cc016a9 Author: Hans Feldt hans.fe...@ericsson.com Date: Tue, 22 Apr 2014 12:54:00 +0200 amfd: add and use SU method no_assignments_of_hastate [#713] Complete diffstat: -- osaf/services/saf/amf/amfd/ckpt_dec.cc | 28 + osaf/services/saf/amf/amfd/ckpt_updt.cc |1 - osaf/services/saf/amf/amfd/comp.cc | 11 + osaf/services/saf/amf/amfd/include/su.h | 53 ++ osaf/services/saf/amf/amfd/ndproc.cc |2 +- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 14 ++-- osaf/services/saf/amf/amfd/sg_nored_fsm.cc | 16 +++--- osaf/services/saf/amf/amfd/sg_npm_fsm.cc | 16 +++--- osaf/services/saf/amf/amfd/sg_nway_fsm.cc| 22 ++-- osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc | 16 +++--- osaf/services/saf/amf/amfd/sgproc.cc |4 +- osaf/services/saf/amf/amfd/su.cc | 140 +++- osaf/services/saf/amf/amfd/util.cc |1 - 13 files changed, 135 insertions(+), 189 deletions(-) Testing Commands: - Build and start Testing, Expected Results: -- PASTE COMMAND OUTPUTS / TEST RESULTS Conditions of Submission: - HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single
[devel] [PATCH 1 of 5] amfd: cleanup SU [#713]
osaf/services/saf/amf/amfd/ckpt_dec.cc | 28 + osaf/services/saf/amf/amfd/ckpt_updt.cc | 1 - osaf/services/saf/amf/amfd/include/su.h | 38 + osaf/services/saf/amf/amfd/su.cc| 41 osaf/services/saf/amf/amfd/util.cc | 1 - 5 files changed, 29 insertions(+), 80 deletions(-) su_act_state is not used thus can be made a dummy (not removed because of EDU usage). The corresponding enum AVD_SU_STATE removed. Checkpointing of su_act_state kept for backwards compatibility but reduced to a minimum. The use of this- is removed from some setters. Some non existing function signatures removed from the header file. diff --git a/osaf/services/saf/amf/amfd/ckpt_dec.cc b/osaf/services/saf/amf/amfd/ckpt_dec.cc --- a/osaf/services/saf/amf/amfd/ckpt_dec.cc +++ b/osaf/services/saf/amf/amfd/ckpt_dec.cc @@ -1846,34 +1846,10 @@ static uint32_t dec_su_switch(AVD_CL_CB \**/ static uint32_t dec_su_act_state(AVD_CL_CB *cb, NCS_MBCSV_CB_DEC *dec) { - uint32_t status = NCSCC_RC_SUCCESS; - AVD_SU *su_ptr; - AVD_SU dec_su; - EDU_ERR ederror = static_castEDU_ERR(0); - AVD_SU *su_struct; - TRACE_ENTER(); - - su_ptr = dec_su; - - /* -* Action in this case is just to update. -*/ - status = ncs_edu_exec(cb-edu_hdl, avsv_edp_ckpt_msg_su, - dec-i_uba, EDP_OP_TYPE_DEC, (AVD_SU **)su_ptr, ederror, 2, 1, 13); - - osafassert(status == NCSCC_RC_SUCCESS); - - if (NULL == (su_struct = su_db-find(su_ptr-name))) - osafassert(0); - - /* Update the fields received in this checkpoint message */ - su_struct-su_act_state = su_ptr-su_act_state; - cb-async_updt_cnt.su_updt++; - - TRACE_LEAVE2(status '%u', status); - return status; + TRACE_LEAVE(); + return NCSCC_RC_SUCCESS; } /\ diff --git a/osaf/services/saf/amf/amfd/ckpt_updt.cc b/osaf/services/saf/amf/amfd/ckpt_updt.cc --- a/osaf/services/saf/amf/amfd/ckpt_updt.cc +++ b/osaf/services/saf/amf/amfd/ckpt_updt.cc @@ -200,7 +200,6 @@ uint32_t avd_ckpt_su(AVD_CL_CB *cb, AVD_ memcpy(su-saAmfSUHostedByNode, ckpt_su-saAmfSUHostedByNode, sizeof(SaNameT)); su-term_state = ckpt_su-term_state; su-su_switch = ckpt_su-su_switch; - su-su_act_state = ckpt_su-su_act_state; su-saAmfSURestartCount = ckpt_su-saAmfSURestartCount; done: diff --git a/osaf/services/saf/amf/amfd/include/su.h b/osaf/services/saf/amf/amfd/include/su.h --- a/osaf/services/saf/amf/amfd/include/su.h +++ b/osaf/services/saf/amf/amfd/include/su.h @@ -16,21 +16,12 @@ */ /* -.. -.. - - DESCRIPTION: - - This module is the include file for handling Availability Directors - service unit structure. + DESCRIPTION: Service Unit class definition ** */ -/* - * Module Inclusion Control... - */ #ifndef AVD_SU_H #define AVD_SU_H @@ -44,16 +35,8 @@ #include comp.h #include include/db_template.h -/* The semantics the SU is undergoing. */ -typedef enum { - AVD_SU_NO_STATE = 0, - AVD_SU_OPER, - AVD_SU_NODE_OPER -} AVD_SU_STATE; - -/* Avialability directors Service Unit structure(AVD_SU): - * This data structure lives in the AvD and reflects data points - * associated with the Service Unit (SU) on the AvD. +/** + * AMF director Service Unit representation. */ class AVD_SU { public: @@ -62,7 +45,8 @@ class AVD_SU { uint32_t saAmfSURank; SaNameT saAmfSUHostNodeOrNodeGroup; bool saAmfSUFailover; - bool saAmfSUFailover_configured; /* True when user configures saAmfSUFailover else false */ + /* true when user has configured saAmfSUFailover */ + bool saAmfSUFailover_configured; SaNameT saAmfSUMaintenanceCampaign; /* runtime attributes */ @@ -71,11 +55,10 @@ class AVD_SU { SaAmfAdminStateT saAmfSUAdminState; SaAmfReadinessStateT saAmfSuReadinessState; SaAmfPresenceStateT saAmfSUPresenceState; - SaNameT **saAmfSUAssignedSIs; SaNameT saAmfSUHostedByNode; SaUint32T saAmfSUNumCurrActiveSIs; SaUint32T saAmfSUNumCurrStandbySIs; - SaUint32T saAmfSURestartCount; // TODO use this! + SaUint32T saAmfSURestartCount; AVD_ADMIN_OPER_CBK pend_cbk;/* Stores zero invocation value of imm adm cbk * when no admin operation is going on. @@ -94,10 +77,7 @@ class AVD_SU { bool su_is_external;/* indicates
[devel] [PATCH 4 of 5] amfd: add and use SU methods add_comp/remove_comp [#713]
osaf/services/saf/amf/amfd/comp.cc | 11 ++- osaf/services/saf/amf/amfd/include/su.h | 8 +--- osaf/services/saf/amf/amfd/su.cc| 6 ++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/osaf/services/saf/amf/amfd/comp.cc b/osaf/services/saf/amf/amfd/comp.cc --- a/osaf/services/saf/amf/amfd/comp.cc +++ b/osaf/services/saf/amf/amfd/comp.cc @@ -188,8 +188,9 @@ AVD_COMP *avd_comp_getnext(const SaNameT void avd_comp_delete(AVD_COMP *comp) { + AVD_SU *su = comp-su; m_AVSV_SEND_CKPT_UPDT_ASYNC_RMV(avd_cb, comp, AVSV_CKPT_AVD_COMP_CONFIG); - avd_su_remove_comp(comp); + su-remove_comp(comp); avd_comptype_remove_comp(comp); (void)ncs_patricia_tree_del(comp_db, comp-tree_node); delete comp; @@ -219,7 +220,7 @@ static void comp_add_to_model(AVD_COMP * comp-comp_type = avd_comptype_get(comp-saAmfCompType); osafassert(comp-comp_type); avd_comptype_add_comp(comp); - avd_su_add_comp(comp); + su-add_comp(comp); /* check if the * corresponding node is UP send the component information @@ -238,7 +239,7 @@ static void comp_add_to_model(AVD_COMP * } else { /* This is not a valid external component. External SU has been assigned a cluster component. */ - avd_su_remove_comp(comp); + su-remove_comp(comp); LOG_ER(Not A Valid External Component: Category '%u'configured, comp-comp_info.category); return; @@ -1199,9 +1200,9 @@ static void comp_ccb_apply_modify_hdlr(s comp-comp_info.inst_level, *((SaUint32T *)value), comp-comp_info.name.value); comp-comp_info.inst_level = *((SaUint32T *)value); - avd_su_remove_comp(comp); + su-remove_comp(comp); comp-su = su; - avd_su_add_comp(comp); + su-add_comp(comp); } else if (!strcmp(attribute-attrName, saAmfCompNumMaxInstantiateWithoutDelay)) { diff --git a/osaf/services/saf/amf/amfd/include/su.h b/osaf/services/saf/amf/amfd/include/su.h --- a/osaf/services/saf/amf/amfd/include/su.h +++ b/osaf/services/saf/amf/amfd/include/su.h @@ -82,12 +82,17 @@ class AVD_SU { struct avd_sg_tag *sg_of_su;/* the service group of this SU */ struct avd_avnd_tag *su_on_node;/* the node on which this SU resides */ struct avd_su_si_rel_tag *list_of_susi; /* the list of su si relationship elements */ + + // TODO: use some container for the comp list struct avd_comp_tag *list_of_comp; /* the list of components in this SU */ + AVD_SU *sg_list_su_next;/* the next SU in the SG */ AVD_SU *avnd_list_su_next; /* the next SU in the AvND */ struct avd_sutype *su_type; AVD_SU *su_list_su_type_next; + void add_comp(struct avd_comp_tag *comp); + void remove_comp(struct avd_comp_tag *comp); void set_admin_state(SaAmfAdminStateT admin_state); void set_pres_state(SaAmfPresenceStateT state); void set_readiness_state(SaAmfReadinessStateT readiness_state); @@ -148,9 +153,6 @@ extern AVD_SU *avd_su_new(const SaNameT */ extern void avd_su_delete(AVD_SU *su); -extern void avd_su_remove_comp(struct avd_comp_tag *comp); -extern void avd_su_add_comp(struct avd_comp_tag *comp); - /** * Get SUs from IMM and create internal objects * diff --git a/osaf/services/saf/amf/amfd/su.cc b/osaf/services/saf/amf/amfd/su.cc --- a/osaf/services/saf/amf/amfd/su.cc +++ b/osaf/services/saf/amf/amfd/su.cc @@ -123,8 +123,7 @@ uint32_t avd_su_get_current_no_of_assign return curr_assignment_cnt; } -void avd_su_remove_comp(AVD_COMP *comp) -{ +void AVD_SU::remove_comp(AVD_COMP *comp) { AVD_COMP *i_comp = NULL; AVD_COMP *prev_comp = NULL; AVD_SU *su_ref = comp-su; @@ -159,8 +158,7 @@ void avd_su_remove_comp(AVD_COMP *comp) } } -void avd_su_add_comp(AVD_COMP *comp) -{ +void AVD_SU::add_comp(AVD_COMP *comp) { AVD_COMP *i_comp = comp-su-list_of_comp; AVD_COMP *prev_comp = NULL; bool found_pos= false; -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 2 of 5] amfd: add and use SU method set_pres_state [#713]
osaf/services/saf/amf/amfd/include/su.h | 2 +- osaf/services/saf/amf/amfd/ndproc.cc| 2 +- osaf/services/saf/amf/amfd/sgproc.cc| 4 ++-- osaf/services/saf/amf/amfd/su.cc| 30 ++ 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/osaf/services/saf/amf/amfd/include/su.h b/osaf/services/saf/amf/amfd/include/su.h --- a/osaf/services/saf/amf/amfd/include/su.h +++ b/osaf/services/saf/amf/amfd/include/su.h @@ -88,6 +88,7 @@ class AVD_SU { struct avd_sutype *su_type; AVD_SU *su_list_su_type_next; + void set_pres_state(SaAmfPresenceStateT state); void set_readiness_state(SaAmfReadinessStateT readiness_state); void set_oper_state(SaAmfOperationalStateT state); void set_oper_state(uint32_t state) { @@ -156,7 +157,6 @@ extern void avd_su_add_comp(struct avd_c */ extern SaAisErrorT avd_su_config_get(const SaNameT *sg_name, struct avd_sg_tag *sg); -extern void avd_su_pres_state_set(AVD_SU *su, SaAmfPresenceStateT pres_state); extern void avd_su_admin_state_set(AVD_SU *su, SaAmfAdminStateT admin_state); /** diff --git a/osaf/services/saf/amf/amfd/ndproc.cc b/osaf/services/saf/amf/amfd/ndproc.cc --- a/osaf/services/saf/amf/amfd/ndproc.cc +++ b/osaf/services/saf/amf/amfd/ndproc.cc @@ -734,7 +734,7 @@ void avd_data_update_req_evh(AVD_CL_CB * TRACE(su pres state); if (n2d_msg-msg_info.n2d_data_req.param_info.value_len == sizeof(uint32_t)) { l_val = ntohl(*((uint32_t *)n2d_msg-msg_info.n2d_data_req.param_info.value[0])); - avd_su_pres_state_set(su, static_castSaAmfPresenceStateT(l_val)); + su-set_pres_state(static_castSaAmfPresenceStateT(l_val)); /* Send response to any admin callbacks delivered by IMM if not sent already. */ if (su-su_on_node-admin_node_pend_cbk.invocation != 0) { diff --git a/osaf/services/saf/amf/amfd/sgproc.cc b/osaf/services/saf/amf/amfd/sgproc.cc --- a/osaf/services/saf/amf/amfd/sgproc.cc +++ b/osaf/services/saf/amf/amfd/sgproc.cc @@ -1552,7 +1552,7 @@ void avd_node_down_mw_susi_failover(AVD_ osafassert(i_su != 0); while (i_su != NULL) { i_su-set_oper_state(SA_AMF_OPERATIONAL_DISABLED); - avd_su_pres_state_set(i_su, SA_AMF_PRESENCE_UNINSTANTIATED); + i_su-set_pres_state(SA_AMF_PRESENCE_UNINSTANTIATED); i_su-set_readiness_state(SA_AMF_READINESS_OUT_OF_SERVICE); su_complete_admin_op(i_su, SA_AIS_ERR_TIMEOUT); su_disable_comps(i_su, SA_AIS_ERR_TIMEOUT); @@ -1603,7 +1603,7 @@ void avd_node_down_appl_susi_failover(AV i_su = avnd-list_of_su; while (i_su != NULL) { i_su-set_oper_state(SA_AMF_OPERATIONAL_DISABLED); - avd_su_pres_state_set(i_su, SA_AMF_PRESENCE_UNINSTANTIATED); + i_su-set_pres_state(SA_AMF_PRESENCE_UNINSTANTIATED); i_su-set_readiness_state(SA_AMF_READINESS_OUT_OF_SERVICE); /* Check if there was any admin operations going on this SU. */ diff --git a/osaf/services/saf/amf/amfd/su.cc b/osaf/services/saf/amf/amfd/su.cc --- a/osaf/services/saf/amf/amfd/su.cc +++ b/osaf/services/saf/amf/amfd/su.cc @@ -712,34 +712,32 @@ SaAisErrorT avd_su_config_get(const SaNa return error; } -void avd_su_pres_state_set(AVD_SU *su, SaAmfPresenceStateT pres_state) -{ - SaAmfPresenceStateT old_state; - - if (su-saAmfSUPresenceState == pres_state) +void AVD_SU::set_pres_state(SaAmfPresenceStateT pres_state) { + if (saAmfSUPresenceState == pres_state) return; osafassert(pres_state = SA_AMF_PRESENCE_TERMINATION_FAILED); - TRACE_ENTER2('%s' %s = %s, su-name.value, -avd_pres_state_name[su-saAmfSUPresenceState], + TRACE_ENTER2('%s' %s = %s, name.value, +avd_pres_state_name[saAmfSUPresenceState], avd_pres_state_name[pres_state]); - old_state = su-saAmfSUPresenceState; - su-saAmfSUPresenceState = pres_state; + SaAmfPresenceStateT old_state = saAmfSUPresenceState; + saAmfSUPresenceState = pres_state; /* only log for certain changes, see notifications in spec */ if (pres_state == SA_AMF_PRESENCE_UNINSTANTIATED || pres_state == SA_AMF_PRESENCE_INSTANTIATED || pres_state == SA_AMF_PRESENCE_RESTARTING) { - saflog(LOG_NOTICE, amfSvcUsrName, %s PresenceState %s = %s, su-name.value, - avd_pres_state_name[old_state], avd_pres_state_name[su-saAmfSUPresenceState]); + saflog(LOG_NOTICE, amfSvcUsrName, %s PresenceState %s = %s, + name.value,
[devel] [PATCH 3 of 5] amfd: add and use SU method set_admin_state [#713]
osaf/services/saf/amf/amfd/include/su.h | 3 +- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 14 +++--- osaf/services/saf/amf/amfd/sg_nored_fsm.cc | 16 osaf/services/saf/amf/amfd/sg_npm_fsm.cc | 16 osaf/services/saf/amf/amfd/sg_nway_fsm.cc| 20 +- osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc | 16 osaf/services/saf/amf/amfd/su.cc | 51 ++- 7 files changed, 68 insertions(+), 68 deletions(-) diff --git a/osaf/services/saf/amf/amfd/include/su.h b/osaf/services/saf/amf/amfd/include/su.h --- a/osaf/services/saf/amf/amfd/include/su.h +++ b/osaf/services/saf/amf/amfd/include/su.h @@ -88,6 +88,7 @@ class AVD_SU { struct avd_sutype *su_type; AVD_SU *su_list_su_type_next; + void set_admin_state(SaAmfAdminStateT admin_state); void set_pres_state(SaAmfPresenceStateT state); void set_readiness_state(SaAmfReadinessStateT readiness_state); void set_oper_state(SaAmfOperationalStateT state); @@ -157,8 +158,6 @@ extern void avd_su_add_comp(struct avd_c */ extern SaAisErrorT avd_su_config_get(const SaNameT *sg_name, struct avd_sg_tag *sg); -extern void avd_su_admin_state_set(AVD_SU *su, SaAmfAdminStateT admin_state); - /** * Class constructor, must be called before any other function */ diff --git a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc --- a/osaf/services/saf/amf/amfd/sg_2n_fsm.cc +++ b/osaf/services/saf/amf/amfd/sg_2n_fsm.cc @@ -941,7 +941,7 @@ static uint32_t avd_sg_2n_su_fault_su_op m_AVD_GET_SU_NODE_PTR(cb, su, su_node_ptr); if (su-saAmfSUAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { - avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); + su-set_admin_state(SA_AMF_ADMIN_LOCKED); } else if (su_node_ptr-saAmfNodeAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { m_AVD_IS_NODE_LOCK((su_node_ptr), flag); if (flag == true) { @@ -2050,7 +2050,7 @@ static uint32_t avd_sg_2n_susi_sucss_su_ * are quiesced */ if ((su-saAmfSUAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) ((all_quiesced(su) || all_unassigned(su { - avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); + su-set_admin_state(SA_AMF_ADMIN_LOCKED); } else if (su_node_ptr-saAmfNodeAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { m_AVD_IS_NODE_LOCK((su_node_ptr), flag); if (flag == true) { @@ -2232,7 +2232,7 @@ static uint32_t avd_sg_2n_susi_sucss_su_ /* the admin state of the SU is shutdown change it to lock. */ if (su-saAmfSUAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { - avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); + su-set_admin_state(SA_AMF_ADMIN_LOCKED); } else if (su_node_ptr-saAmfNodeAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { m_AVD_IS_NODE_LOCK((su_node_ptr), flag); if (flag == true) { @@ -2741,7 +2741,7 @@ uint32_t avd_sg_2n_susi_fail_func(AVD_CL /* the admin state of the SU is shutdown change it to lock. */ if (su-saAmfSUAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { - avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); + su-set_admin_state(SA_AMF_ADMIN_LOCKED); } else if (su_node_ptr-saAmfNodeAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { m_AVD_IS_NODE_LOCK((su_node_ptr), flag); if (flag == true) { @@ -3055,7 +3055,7 @@ static void avd_sg_2n_node_fail_su_oper( m_AVD_GET_SU_NODE_PTR(cb, su, su_node_ptr); /* the admin state of the SU is shutdown change it to lock. */ if (su-saAmfSUAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { - avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); + su-set_admin_state(SA_AMF_ADMIN_LOCKED); } else if (su_node_ptr-saAmfNodeAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { m_AVD_IS_NODE_LOCK((su_node_ptr), flag); if (flag == true) { @@ -3082,7 +3082,7 @@ static void avd_sg_2n_node_fail_su_oper( /* the admin state of the SU is shutdown change it to lock. */ if (su-saAmfSUAdminState == SA_AMF_ADMIN_SHUTTING_DOWN) { - avd_su_admin_state_set(su, SA_AMF_ADMIN_LOCKED); +
[devel] [PATCH 0 of 1] Review Request for amfd: use db_template for the apptype db V2 [#713]
Summary: amfd: use db_template for the apptype db V2 Review request for Trac Ticket(s): #713 Peer Reviewer(s): Nagu, Praveen Pull request to: Affected branch(es): default Development branch: default Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesn OpenSAF servicesy Core libraries n Samples n Tests n Other n Comments (indicate scope for each y above): - EXPLAIN/COMMENT THE PATCH SERIES HERE changeset 559866d77ffa14e118cd0b05cc1d77fe550dfc8b Author: Hans Nordeback hans.nordeb...@ericsson.com Date: Tue, 22 Apr 2014 12:50:13 +0200 amfd: use db_template for the apptype db V2 [#713] Complete diffstat: -- osaf/services/saf/amf/amfd/apptype.cc| 27 +-- osaf/services/saf/amf/amfd/include/app.h | 4 2 files changed, 9 insertions(+), 22 deletions(-) Testing Commands: - LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES Testing, Expected Results: -- PASTE COMMAND OUTPUTS / TEST RESULTS Conditions of Submission: - HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 y y powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 1 of 1] amfd: use db_template for the apptype db V2 [#713]
osaf/services/saf/amf/amfd/apptype.cc| 27 +-- osaf/services/saf/amf/amfd/include/app.h | 4 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/osaf/services/saf/amf/amfd/apptype.cc b/osaf/services/saf/amf/amfd/apptype.cc --- a/osaf/services/saf/amf/amfd/apptype.cc +++ b/osaf/services/saf/amf/amfd/apptype.cc @@ -23,22 +23,17 @@ #include si.h #include util.h -static NCS_PATRICIA_TREE apptype_db; +AmfDbAVD_APP_TYPE *app_type_db = 0; AVD_APP_TYPE *avd_apptype_get(const SaNameT *dn) { - SaNameT tmp = {0}; - - tmp.length = dn-length; - memcpy(tmp.value, dn-value, tmp.length); - - return (AVD_APP_TYPE *)ncs_patricia_tree_get(apptype_db, (uint8_t *)tmp); + return app_type_db-find(dn); } static void apptype_delete(AVD_APP_TYPE **apptype) { - unsigned int rc = ncs_patricia_tree_del(apptype_db, (*apptype)-tree_node); - osafassert(rc == NCSCC_RC_SUCCESS); + app_type_db-erase(*apptype); + delete [] (*apptype)-sgAmfApptSGTypes; delete *apptype; *apptype = NULL; @@ -47,10 +42,10 @@ static void apptype_delete(AVD_APP_TYPE static void apptype_add_to_model(AVD_APP_TYPE *app_type) { unsigned int rc; - osafassert(app_type != NULL); TRACE('%s', app_type-name.value); - rc = ncs_patricia_tree_add(apptype_db, app_type-tree_node); + + rc = app_type_db-insert(app_type); osafassert(rc == NCSCC_RC_SUCCESS); } @@ -113,11 +108,10 @@ static AVD_APP_TYPE *apptype_create(SaNa TRACE_ENTER2('%s', dn-value); app_type = new AVD_APP_TYPE(); - + memcpy(app_type-name.value, dn-value, dn-length); app_type-name.length = dn-length; - app_type-tree_node.key_info = (uint8_t *)(app_type-name); - + while ((attr = attributes[i++]) != NULL) if (!strcmp(attr-attrName, saAmfApptSGTypes)) break; @@ -291,10 +285,7 @@ void avd_apptype_remove_app(AVD_APP *app void avd_apptype_constructor(void) { - NCS_PATRICIA_PARAMS patricia_params; - - patricia_params.key_size = sizeof(SaNameT); - osafassert(ncs_patricia_tree_init(apptype_db, patricia_params) == NCSCC_RC_SUCCESS); + app_type_db = new AmfDbAVD_APP_TYPE; avd_class_impl_set(SaAmfAppBaseType, NULL, NULL, avd_imm_default_OK_completed_cb, NULL); diff --git a/osaf/services/saf/amf/amfd/include/app.h b/osaf/services/saf/amf/amfd/include/app.h --- a/osaf/services/saf/amf/amfd/include/app.h +++ b/osaf/services/saf/amf/amfd/include/app.h @@ -27,8 +27,6 @@ #include saAmf.h #include saImm.h -// TODO(hafe) remove include below when apptype is using map -#include ncspatricia.h #include sg.h #include si.h #include db_template.h @@ -37,8 +35,6 @@ struct avd_sg_tag; struct avd_si_tag; typedef struct avd_app_type_tag { - - NCS_PATRICIA_NODE tree_node;/* key is name */ SaNameT name; SaNameT *sgAmfApptSGTypes; uint32_t no_sg_types; -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] amfd: use db_template for the apptype db V2 [#713]
Ack Thanks -Nagu -Original Message- From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com] Sent: 22 April 2014 16:32 To: Praveen Malviya; Nagendra Kumar Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] amfd: use db_template for the apptype db V2 [#713] osaf/services/saf/amf/amfd/apptype.cc| 27 +-- osaf/services/saf/amf/amfd/include/app.h | 4 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/osaf/services/saf/amf/amfd/apptype.cc b/osaf/services/saf/amf/amfd/apptype.cc --- a/osaf/services/saf/amf/amfd/apptype.cc +++ b/osaf/services/saf/amf/amfd/apptype.cc @@ -23,22 +23,17 @@ #include si.h #include util.h -static NCS_PATRICIA_TREE apptype_db; +AmfDbAVD_APP_TYPE *app_type_db = 0; AVD_APP_TYPE *avd_apptype_get(const SaNameT *dn) { - SaNameT tmp = {0}; - - tmp.length = dn-length; - memcpy(tmp.value, dn-value, tmp.length); - - return (AVD_APP_TYPE *)ncs_patricia_tree_get(apptype_db, (uint8_t *)tmp); + return app_type_db-find(dn); } static void apptype_delete(AVD_APP_TYPE **apptype) { - unsigned int rc = ncs_patricia_tree_del(apptype_db, (*apptype)- tree_node); - osafassert(rc == NCSCC_RC_SUCCESS); + app_type_db-erase(*apptype); + delete [] (*apptype)-sgAmfApptSGTypes; delete *apptype; *apptype = NULL; @@ -47,10 +42,10 @@ static void apptype_delete(AVD_APP_TYPE static void apptype_add_to_model(AVD_APP_TYPE *app_type) { unsigned int rc; - osafassert(app_type != NULL); TRACE('%s', app_type-name.value); - rc = ncs_patricia_tree_add(apptype_db, app_type-tree_node); + + rc = app_type_db-insert(app_type); osafassert(rc == NCSCC_RC_SUCCESS); } @@ -113,11 +108,10 @@ static AVD_APP_TYPE *apptype_create(SaNa TRACE_ENTER2('%s', dn-value); app_type = new AVD_APP_TYPE(); - + memcpy(app_type-name.value, dn-value, dn-length); app_type-name.length = dn-length; - app_type-tree_node.key_info = (uint8_t *)(app_type-name); - + while ((attr = attributes[i++]) != NULL) if (!strcmp(attr-attrName, saAmfApptSGTypes)) break; @@ -291,10 +285,7 @@ void avd_apptype_remove_app(AVD_APP *app void avd_apptype_constructor(void) { - NCS_PATRICIA_PARAMS patricia_params; - - patricia_params.key_size = sizeof(SaNameT); - osafassert(ncs_patricia_tree_init(apptype_db, patricia_params) == NCSCC_RC_SUCCESS); + app_type_db = new AmfDbAVD_APP_TYPE; avd_class_impl_set(SaAmfAppBaseType, NULL, NULL, avd_imm_default_OK_completed_cb, NULL); diff --git a/osaf/services/saf/amf/amfd/include/app.h b/osaf/services/saf/amf/amfd/include/app.h --- a/osaf/services/saf/amf/amfd/include/app.h +++ b/osaf/services/saf/amf/amfd/include/app.h @@ -27,8 +27,6 @@ #include saAmf.h #include saImm.h -// TODO(hafe) remove include below when apptype is using map -#include ncspatricia.h #include sg.h #include si.h #include db_template.h @@ -37,8 +35,6 @@ struct avd_sg_tag; struct avd_si_tag; typedef struct avd_app_type_tag { - - NCS_PATRICIA_NODE tree_node;/* key is name */ SaNameT name; SaNameT *sgAmfApptSGTypes; uint32_t no_sg_types; -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 5] amfd: cleanup SU [#713]
ack, code review only/BR HansN On 04/22/14 12:58, Hans Feldt wrote: osaf/services/saf/amf/amfd/ckpt_dec.cc | 28 + osaf/services/saf/amf/amfd/ckpt_updt.cc | 1 - osaf/services/saf/amf/amfd/include/su.h | 38 + osaf/services/saf/amf/amfd/su.cc| 41 osaf/services/saf/amf/amfd/util.cc | 1 - 5 files changed, 29 insertions(+), 80 deletions(-) su_act_state is not used thus can be made a dummy (not removed because of EDU usage). The corresponding enum AVD_SU_STATE removed. Checkpointing of su_act_state kept for backwards compatibility but reduced to a minimum. The use of this- is removed from some setters. Some non existing function signatures removed from the header file. diff --git a/osaf/services/saf/amf/amfd/ckpt_dec.cc b/osaf/services/saf/amf/amfd/ckpt_dec.cc --- a/osaf/services/saf/amf/amfd/ckpt_dec.cc +++ b/osaf/services/saf/amf/amfd/ckpt_dec.cc @@ -1846,34 +1846,10 @@ static uint32_t dec_su_switch(AVD_CL_CB \**/ static uint32_t dec_su_act_state(AVD_CL_CB *cb, NCS_MBCSV_CB_DEC *dec) { - uint32_t status = NCSCC_RC_SUCCESS; - AVD_SU *su_ptr; - AVD_SU dec_su; - EDU_ERR ederror = static_castEDU_ERR(0); - AVD_SU *su_struct; - TRACE_ENTER(); - - su_ptr = dec_su; - - /* - * Action in this case is just to update. - */ - status = ncs_edu_exec(cb-edu_hdl, avsv_edp_ckpt_msg_su, - dec-i_uba, EDP_OP_TYPE_DEC, (AVD_SU **)su_ptr, ederror, 2, 1, 13); - - osafassert(status == NCSCC_RC_SUCCESS); - - if (NULL == (su_struct = su_db-find(su_ptr-name))) - osafassert(0); - - /* Update the fields received in this checkpoint message */ - su_struct-su_act_state = su_ptr-su_act_state; - cb-async_updt_cnt.su_updt++; - - TRACE_LEAVE2(status '%u', status); - return status; + TRACE_LEAVE(); + return NCSCC_RC_SUCCESS; } /\ diff --git a/osaf/services/saf/amf/amfd/ckpt_updt.cc b/osaf/services/saf/amf/amfd/ckpt_updt.cc --- a/osaf/services/saf/amf/amfd/ckpt_updt.cc +++ b/osaf/services/saf/amf/amfd/ckpt_updt.cc @@ -200,7 +200,6 @@ uint32_t avd_ckpt_su(AVD_CL_CB *cb, AVD_ memcpy(su-saAmfSUHostedByNode, ckpt_su-saAmfSUHostedByNode, sizeof(SaNameT)); su-term_state = ckpt_su-term_state; su-su_switch = ckpt_su-su_switch; - su-su_act_state = ckpt_su-su_act_state; su-saAmfSURestartCount = ckpt_su-saAmfSURestartCount; done: diff --git a/osaf/services/saf/amf/amfd/include/su.h b/osaf/services/saf/amf/amfd/include/su.h --- a/osaf/services/saf/amf/amfd/include/su.h +++ b/osaf/services/saf/amf/amfd/include/su.h @@ -16,21 +16,12 @@ */ /* -.. -.. - - DESCRIPTION: - - This module is the include file for handling Availability Directors - service unit structure. + DESCRIPTION: Service Unit class definition ** */ -/* - * Module Inclusion Control... - */ #ifndef AVD_SU_H #define AVD_SU_H @@ -44,16 +35,8 @@ #include comp.h #include include/db_template.h -/* The semantics the SU is undergoing. */ -typedef enum { - AVD_SU_NO_STATE = 0, - AVD_SU_OPER, - AVD_SU_NODE_OPER -} AVD_SU_STATE; - -/* Avialability directors Service Unit structure(AVD_SU): - * This data structure lives in the AvD and reflects data points - * associated with the Service Unit (SU) on the AvD. +/** + * AMF director Service Unit representation. */ class AVD_SU { public: @@ -62,7 +45,8 @@ class AVD_SU { uint32_t saAmfSURank; SaNameT saAmfSUHostNodeOrNodeGroup; bool saAmfSUFailover; - bool saAmfSUFailover_configured; /* True when user configures saAmfSUFailover else false */ + /* true when user has configured saAmfSUFailover */ + bool saAmfSUFailover_configured; SaNameT saAmfSUMaintenanceCampaign; /* runtime attributes */ @@ -71,11 +55,10 @@ class AVD_SU { SaAmfAdminStateT saAmfSUAdminState; SaAmfReadinessStateT saAmfSuReadinessState; SaAmfPresenceStateT saAmfSUPresenceState; - SaNameT **saAmfSUAssignedSIs; SaNameT saAmfSUHostedByNode; SaUint32T saAmfSUNumCurrActiveSIs; SaUint32T saAmfSUNumCurrStandbySIs; - SaUint32T saAmfSURestartCount; // TODO use this! + SaUint32T saAmfSURestartCount; AVD_ADMIN_OPER_CBK pend_cbk;/* Stores zero invocation value of imm adm cbk
[devel] [PATCH 0 of 1] Review Request for AMF #868
Summary: AMF job queue fix Review request for Trac Ticket(s): 868 Peer Reviewer(s): Nags Pull request to: LIST THE PERSON WITH PUSH ACCESS HERE Affected branch(es): all Development branch: 4.3 Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each y above): - changeset e29f6499ff15146d3a0e0a98573d4f5c0c428479 Author: Hans Feldt hans.fe...@ericsson.com Date: Tue, 22 Apr 2014 15:44:24 +0200 amfd: fix imm job update [#868] Ugly logs from amfd like: Apr 19 19:55:18 SC-1 osafamfd[469]: ER exec: update FAILED 12 When an IMM update job is executed and for some reason the object does not exist, the job remains in the queue. Reason is because the wrong error code is checked. By correcting the check, the job is removed and no logging appears. Complete diffstat: -- osaf/services/saf/avsv/avd/avd_imm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Testing Commands: - build Testing, Expected Results: -- builds Conditions of Submission: - Ack from Nags Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 1 of 1] amfd: fix imm job update [#868]
osaf/services/saf/avsv/avd/avd_imm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Ugly logs from amfd like: Apr 19 19:55:18 SC-1 osafamfd[469]: ER exec: update FAILED 12 When an IMM update job is executed and for some reason the object does not exist, the job remains in the queue. Reason is because the wrong error code is checked. By correcting the check, the job is removed and no logging appears. diff --git a/osaf/services/saf/avsv/avd/avd_imm.c b/osaf/services/saf/avsv/avd/avd_imm.c --- a/osaf/services/saf/avsv/avd/avd_imm.c +++ b/osaf/services/saf/avsv/avd/avd_imm.c @@ -1529,7 +1529,7 @@ static AvdJobDequeueResultT job_exec_imm rc = saImmOiRtObjectUpdate_2(immOiHandle, objupdate-dn, attrMods); - if ((rc == SA_AIS_OK) || (rc == SA_AIS_ERR_EXIST)) { + if ((rc == SA_AIS_OK) || (rc == SA_AIS_ERR_NOT_EXIST)) { free(objupdate-attributeName); free(objupdate-value); free(fifo_dequeue()); -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 0 of 1] Review Request for IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861]
Summary: IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861] Review request for Trac Ticket(s): 861 Peer Reviewer(s): Neelakanta Pull request to: Zoran Affected branch(es): opensaf-4.4.x, default(4.5) Development branch: opensaf-4.4.x Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each y above): - changeset c59d3d9d25a39fd3325a3f455ac10c551f4b93ad Author: Zoran Milinkovic zoran.milinko...@ericsson.com Date: Tue, 22 Apr 2014 16:52:30 +0200 IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861] For backwards compatibility, it's needed to revert the code for old way of parsing default values. Flag --strict is added for a more strict parsing values, which fail immcfg if an attribute value does not match the attribute data type. Complete diffstat: -- osaf/tools/safimm/immcfg/imm_cfg.c | 13 + osaf/tools/safimm/immcfg/imm_import.cc | 34 ++ 2 files changed, 31 insertions(+), 16 deletions(-) Testing Commands: - immcfg --strict -L imm.xml immcfg -L imm.xml immcfg --strict -f imm.xml immcfg -f imm.xml Testing, Expected Results: -- Create an XML file with a class that has an attribute of integer type, and string default value. immcfg with new flag --strict should fail for both -f and -L. If --strict flag is missing, immcfg with -f and -L should succeed to load and verify XML file. Conditions of Submission: - Ack from Neelakanta Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your
[devel] [PATCH 1 of 1] IMMTOOLS: revert old way of parsing default values and add a flag for more strict parsing values in immcfg [#861]
osaf/tools/safimm/immcfg/imm_cfg.c | 13 + osaf/tools/safimm/immcfg/imm_import.cc | 34 ++ 2 files changed, 31 insertions(+), 16 deletions(-) For backwards compatibility, it's needed to revert the code for old way of parsing default values. Flag --strict is added for a more strict parsing values, which fail immcfg if an attribute value does not match the attribute data type. diff --git a/osaf/tools/safimm/immcfg/imm_cfg.c b/osaf/tools/safimm/immcfg/imm_cfg.c --- a/osaf/tools/safimm/immcfg/imm_cfg.c +++ b/osaf/tools/safimm/immcfg/imm_cfg.c @@ -81,8 +81,8 @@ typedef enum { // Interface functions which implement -f and -L options (imm_import.cc) int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int ccb_safe, SaImmHandleT *immHandle, SaImmAdminOwnerHandleT *ownerHandle, - SaImmCcbHandleT *ccbHandle, int mode, const char *xsdPath); -int validateImmXML(const char *xmlfile, int verbose, int mode); + SaImmCcbHandleT *ccbHandle, int mode, const char *xsdPath, int strictParse); +int validateImmXML(const char *xmlfile, int verbose, int mode, int strictParse); static int imm_operation(int argc, char *argv[]); char *(*readln)(const char *); @@ -1100,6 +1100,7 @@ static int imm_operation(int argc, char {ccb-apply, no_argument, NULL, 0}, {ccb-abort, no_argument, NULL, 0}, {xsd, required_argument, NULL, 'X'}, + {strict, no_argument, NULL, 0}, {0, 0, 0, 0} }; SaAisErrorT error; @@ -1123,6 +1124,7 @@ static int imm_operation(int argc, char attr_notify_t attrNotify = NOTIFY_UNDEFINED; char *xsdPath = NULL; + int strictParse = 0; while (1) { int option_index = 0; @@ -1182,6 +1184,8 @@ static int imm_operation(int argc, char exit(EXIT_FAILURE); } op = verify_setoption(op, CCB_ABORT); + } else if (strcmp(strict, long_options[option_index].name) == 0) { + strictParse = 1; } break; case 'a': @@ -1273,7 +1277,7 @@ static int imm_operation(int argc, char if (op == VALIDATE_IMMFILE) { VERBOSE_INFO(validateImmXML(xmlFilename=%s, verbose=%d)\n, xmlFilename, verbose); - rc = validateImmXML(xmlFilename, verbose, transaction_mode); + rc = validateImmXML(xmlFilename, verbose, transaction_mode, strictParse); if(rc == 0) printf(Validation is successful\n); @@ -1289,7 +1293,8 @@ static int imm_operation(int argc, char if (op == LOAD_IMMFILE) { VERBOSE_INFO(importImmXML(xmlFilename=%s, verbose=%d)\n, xmlFilename, verbose); rc = importImmXML(xmlFilename, adminOwnerName, verbose, ccb_safe, - immHandle, ownerHandle, ccbHandle, transaction_mode, xsdPath); + immHandle, ownerHandle, ccbHandle, transaction_mode, + xsdPath, strictParse); if(transaction_mode) { if(rc) { fprintf(stderr, CCB is aborted\n); diff --git a/osaf/tools/safimm/immcfg/imm_import.cc b/osaf/tools/safimm/immcfg/imm_import.cc --- a/osaf/tools/safimm/immcfg/imm_import.cc +++ b/osaf/tools/safimm/immcfg/imm_import.cc @@ -64,8 +64,8 @@ extern C { int importImmXML(char* xmlfileC, char* adminOwnerName, int verbose, int ccb_safe, SaImmHandleT *immHandle, SaImmAdminOwnerHandleT *ownerHandle, - SaImmCcbHandleT *ccbHandle, int mode, const char *xsdPath); - int validateImmXML(const char *xmlfile, int verbose, int mode); + SaImmCcbHandleT *ccbHandle, int mode, const char *xsdPath, int strictParse); + int validateImmXML(const char *xmlfile, int verbose, int mode, int strictParse); } extern ImmutilErrorFnT immutilError; @@ -146,6 +146,7 @@ typedef struct ParserStateStruct { bool validation; xmlParserCtxtPtr ctxt; int parsingStatus; /* 0 = ok */ + bool strictParse; } ParserState; bool isXsdLoaded = false; @@ -168,7 +169,8 @@ static void getDNForClass(ParserState*, SaImmAttrValuesT_2*); static int charsToValueHelper(SaImmAttrValueT*, SaImmValueTypeT, - const char*); + const char*, + bool strictParse); static SaImmValueTypeT charsToTypeHelper(const xmlChar* str, size_t len); static
Re: [devel] changing saAmfSGNumPrefActiveSUs for N+1 SG w/out bringing it down
Some preliminary requirements and proposals for discussion: 1. I've created ticket 871 for this 2. This will only support N+M service group. 3. There must be a currently instantiated spare SU for the modification to succeed. The idea is that we can do an immediate REALIGN of the SG and bring the instantiated spare right to active. 4. Only allow the N number to increase for in-service. For decrease the admin would still need to lock the SG. I'm not sure we want to get into forcefully moving an SU from active to spare, when the admin might not have thought everything through, and might not expect it. How would we pick which one to move? By rank? Alex On 04/22/2014 02:47 AM, Hans Feldt wrote: Please do, that would be great. Thanks, Hans On 11 April 2014 17:37, Alex Jones ajo...@genband.com wrote: I notice that dynamically changing saAmfSGNumPrefActiveSUs for an N+1 service group is not supported, unless the service group is not unlocked. This prevents in-service capacity addition which really should be supported. Let's say you have a 6-slot ATCA chassis, but you only want to use 3 slots at first in a 2+1 setup. At some point in the future you want to add more active capacity, but still keep it N+1. Right now you would have to bring the SG down in order to add capacity, which is not desirable. Are there current plans to support this? If not, I am happy to take this on. Alex -- Put Bad Developers to Shame Dominate Development with Jenkins Continuous Integration Continuously Automate Build, Test Deployment Start a new project now. Try Jenkins in the cloud. http://p.sf.net/sfu/13600_Cloudbees ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 0 of 1] Review Request for amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over V2 [#821]
Summary: amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over [#821] Review request for Trac Ticket(s): 821 Peer Reviewer(s): Hans N, Nagendra, Praveen, Hans F Pull request to: Affected branch(es): default, 4.4 Development branch: default Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each y above): - EXPLAIN/COMMENT THE PATCH SERIES HERE changeset ed011a4d972f515395c9be7b3ed06b3ffdda5934 Author: Gary Lee gary@dektech.com.au Date: Wed, 23 Apr 2014 11:08:28 +1000 amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over [#821] It has been found that an admin operation (other than controller switch- over) can be started after a controller switch-over has been initiated. The result of this can be that the admin operation response gets lost. The reason for it to get lost is that an IMM admin response has to be responded on the same node where it was initiated. The change is to disallow new admin operations when controller switch-over is in progress. This will result in TRYAGAIN to the issuing program which should stop once the AMF implementer has connected and the controller switch-over has finished. credit: Hans Feldt Complete diffstat: -- osaf/services/saf/amf/amfd/imm.cc | 13 - osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 8 +--- 2 files changed, 13 insertions(+), 8 deletions(-) Testing Commands: - 1) Install amf_demo 2) Trigger a controller switch-over amf-adm si-swap safSi=SC-2N,safApp=OpenSAF 3) Issue an admin op to restart amf_demo amf-adm restart safComp=AmfDemo,safSu=SU1,safSg=AmfDemo,safApp=AmfDemo1 Testing, Expected Results: -- amf-adm should automatically retry within the default timeout period, and not return TIMEOUT Conditions of Submission: - HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 y y powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not
Re: [devel] [PATCH 1 of 1] amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over [#821]
Thanks Nagendra... I'm wondering if we should convert report_admin_op_error to use the job queue as well. Though it's less likely 'users' will be querying IMM immediately after an admin op fails, in contrast with the success case. Thanks Gary On 22/04/14 20:13, Nagendra Kumar wrote: Few comments: 1.report_admin_op_error could be used instead of avd_saImmOiAdminOperationResult stating appropriate reason. 2.The below code should be removed now from avd_sg_2n_siswap_func: if (susi-si-sg_of_si-sg_ncs_spec) { if (true == avd_cb-swap_switch ) { LOG_NO(SI Swap not possible, Controller role switch under progress); rc = SA_AIS_ERR_TRY_AGAIN; goto done; } } Thanks -Nagu -Original Message- From: Gary Lee [mailto:gary@dektech.com.au] Sent: 22 April 2014 09:36 To: hans.nordeb...@ericsson.com; Nagendra Kumar; Praveen Malviya; hans.fe...@ericsson.com Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] amfd: Respond with TRY_AGAIN to admin ops during a controller switch-over [#821] osaf/services/saf/amf/amfd/imm.cc | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) It has been found that an admin operation (other than controller switch-over) can be started after a controller switch-over has been initiated. The result of this can be that the admin operation response gets lost. The reason for it to get lost is that an IMM admin response has to be responded on the same node where it was initiated. The change is to disallow new admin operations when controller switch-over is in progress. This will result in TRYAGAIN to the issuing program which should stop once the AMF implementer has connected and the controller switch-over has finished. credit: Hans Feldt diff --git a/osaf/services/saf/amf/amfd/imm.cc b/osaf/services/saf/amf/amfd/imm.cc --- a/osaf/services/saf/amf/amfd/imm.cc +++ b/osaf/services/saf/amf/amfd/imm.cc @@ -650,6 +650,14 @@ static void admin_operation_cb(SaImmOiHa AVSV_AMF_CLASS_ID type = object_name_to_class_type(object_name); TRACE_ENTER2('%s', invocation: %llu, op: %llu, object_name-value, invocation, op_id); + +/* ignore admin ops if we are in the middle of a role switch */ +if (avd_cb-swap_switch == SA_TRUE) { +TRACE(Admin op received during a role switch); +avd_saImmOiAdminOperationResult(immoi_handle, invocation, SA_AIS_ERR_TRY_AGAIN); +goto done; +} + saflog(LOG_NOTICE, amfSvcUsrName, Admin op \%s\ initiated for '%s', invocation: %llu, admin_op_name(static_castSaAmfAdminOperationIdT(op_id)), object_name-value, invocation); @@ -659,6 +667,8 @@ static void admin_operation_cb(SaImmOiHa LOG_ER(Admin operation not supported for %s (%u), object_name-value, type); avd_saImmOiAdminOperationResult(immoi_handle, invocation, SA_AIS_ERR_INVALID_PARAM); } + +done: TRACE_LEAVE(); } -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 1] amfd: fix imm job update [#868]
Ack. SA_AIS_ERR_EXIST is not even a valid return of saImmOiRtObjectUpdate_2(). Thanks -Nagu -Original Message- From: Hans Feldt [mailto:osafde...@gmail.com] Sent: 22 April 2014 19:37 To: Nagendra Kumar Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] amfd: fix imm job update [#868] osaf/services/saf/avsv/avd/avd_imm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Ugly logs from amfd like: Apr 19 19:55:18 SC-1 osafamfd[469]: ER exec: update FAILED 12 When an IMM update job is executed and for some reason the object does not exist, the job remains in the queue. Reason is because the wrong error code is checked. By correcting the check, the job is removed and no logging appears. diff --git a/osaf/services/saf/avsv/avd/avd_imm.c b/osaf/services/saf/avsv/avd/avd_imm.c --- a/osaf/services/saf/avsv/avd/avd_imm.c +++ b/osaf/services/saf/avsv/avd/avd_imm.c @@ -1529,7 +1529,7 @@ static AvdJobDequeueResultT job_exec_imm rc = saImmOiRtObjectUpdate_2(immOiHandle, objupdate-dn, attrMods); - if ((rc == SA_AIS_OK) || (rc == SA_AIS_ERR_EXIST)) { + if ((rc == SA_AIS_OK) || (rc == SA_AIS_ERR_NOT_EXIST)) { free(objupdate-attributeName); free(objupdate-value); free(fifo_dequeue()); -- Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform http://p.sf.net/sfu/ExoPlatform ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel