Re: [devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638] V2
Hi Lennart, Thanks for the comments. One of your major comment is `lga_hdl_rec->is_stale_client` & `cb->clm_node_state` is not protected in lga_mds.c , but if you see the lga_mds_rcv() , lga_lgs_msg_proc() it self is protected , so all the chances in lga_lgs_msg_proc() are protected. I understand that the existing code is little bit miss leading. The other comments I will address in V3 Patch. == static uint32_t lga_mds_rcv(struct ncsmds_callback_info *mds_cb_info) { lgsv_msg_t *lgsv_msg = (lgsv_msg_t *)mds_cb_info->info.receive.i_msg; uint32_t rc; osaf_mutex_lock_ordie(_cb.cb_lock); /* process the message */ rc = lga_lgs_msg_proc(_cb, lgsv_msg, mds_cb_info->info.receive.i_priority); if (rc != NCSCC_RC_SUCCESS) { TRACE_2("lga_lgs_msg_proc returned: %d", rc); } osaf_mutex_unlock_ordie(_cb.cb_lock); return rc; } == -AVM On 8/2/2016 4:21 PM, Lennart Lund wrote: > Hi > > My comments [Lennart] > > I will continue reviewing patch 2 > > Thanks > Lennart > >> -Original Message- >> From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] >> Sent: den 2 augusti 2016 07:18 >> To: Vu Minh Nguyen; Lennart Lund >> ; Anders Widell >> Cc: opensaf-devel@lists.sourceforge.net >> Subject: [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration >> [#1638] V2 >> >> osaf/libs/agents/saf/lga/lga.h | 2 + >> osaf/libs/agents/saf/lga/lga_api.c | 47 >> osaf/libs/agents/saf/lga/lga_mds.c | 69 >> ++ >> osaf/libs/agents/saf/lga/lga_util.c| 2 + >> osaf/libs/common/logsv/include/lgsv_defs.h | 6 ++- >> osaf/libs/common/logsv/include/lgsv_msg.h | 17 +- >> 6 files changed, 138 insertions(+), 5 deletions(-) >> >> >> V2 patch: >> >> Incorporated Anders Widell and Vureview comments , >> for more details see the review comments posted on V1 patch. >> Description: >> >> Form CLM integration is supported from Log Service A.02.02. >> >> At-least a A.02.02 LGA client will check CLM membership status of client's >> node. >> old LGA clients A.02.01 are always clm member. >> >> This patch enhanced the log service for Unavailability of the Log Service API >> on a >> Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE. >> >> After this patch the Log Service does not provide service to processes on >> cluster nodes that are not >> in the cluster membership. >> >> If the node rejoins the cluster membership, processes executing on the >> node will be >> able to reinitialize new library handles and use the entire set of Log >> Service >> APIs that >> operate on these new handles; however, invocation of APIs that operate on >> handles >> acquired by any process before the node left the membership will continue >> to fail with >> SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above >> for >> asynchronous calls) with the exception of saLogFinalize(), which is used to >> free the >> library handles and all resources associated with these handles. Hence, it is >> recommended >> for the processes to finalize the library handles as soon as the processes >> detect that the node left the membership. >> >> Detailed README will be provide soon. >> >> Following are expected Log Service API behavior : >> >> Case1: On Non-Member Node, Log Service API will fail with code >> SA_AIS_ERR_UNAVAILABLE (31) >> Case2: On Member Node after recovered from Non-Member Node, Log >> Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) >> Case3: Non-Member Node + (Headless) Log Service API will fail with code >> SA_AIS_ERR_UNAVAILABLE (31) >> Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API >> will fail with code SA_AIS_ERR_UNAVAILABLE (31) > [Lennart] I assume you will move this info about the implementation/feature > to the README file [AVM] Ok , I will add these as expected as behavior to README. >> diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h >> --- a/osaf/libs/agents/saf/lga/lga.h >> +++ b/osaf/libs/agents/saf/lga/lga.h >> @@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec { >> * Set when client is initialized an all >> * streams are recovered >> */ >> +bool is_stale_client; /* Status of client based on the CLM status of >> node.*/ >> } lga_client_hdl_rec_t; >> >> /* States of the server */ >> @@ -118,6 +119,7 @@ typedef struct { >> /* LGS LGA sync params */ >> int lgs_sync_awaited; >> NCS_SEL_OBJ lgs_sync_sel; >> +SaClmClusterChangesT clm_node_state; /*Reflects CLM status of >> this
[devel] [PATCH 1 of 1] amfd: do not call memset on classes with string members [#1642]
osaf/services/saf/amf/amfd/sirankedsu.cc | 2 -- osaf/services/saf/amf/amfd/su.cc | 1 - 2 files changed, 0 insertions(+), 3 deletions(-) diff --git a/osaf/services/saf/amf/amfd/sirankedsu.cc b/osaf/services/saf/amf/amfd/sirankedsu.cc --- a/osaf/services/saf/amf/amfd/sirankedsu.cc +++ b/osaf/services/saf/amf/amfd/sirankedsu.cc @@ -107,7 +107,6 @@ static AVD_SUS_PER_SI_RANK *avd_siranked AVD_SUS_PER_SI_RANK *ranked_su_per_si = nullptr; AVD_SUS_PER_SI_RANK_INDX rank_indx; - memset(_indx, '\0', sizeof(AVD_SUS_PER_SI_RANK_INDX)); rank_indx.si_name = indx.si_name; rank_indx.su_rank = indx.su_rank; @@ -171,7 +170,6 @@ static AVD_SUS_PER_SI_RANK * avd_siranke avd_susi_namet_init(Amf::to_string(dn), su_name, si_name); /* Find the avd_sus_per_si_rank name. */ - memset(, '\0', sizeof(AVD_SUS_PER_SI_RANK_INDX)); indx.si_name = si_name; indx.su_rank = rank; 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 @@ -608,7 +608,6 @@ static void su_add_to_model(AVD_SU *su) /* This is an external SU and we need to create the supporting info. */ avd_cb->ext_comp_info.ext_comp_hlt_check = new AVD_AVND; - memset(avd_cb->ext_comp_info.ext_comp_hlt_check, 0, sizeof(AVD_AVND)); avd_cb->ext_comp_info.local_avnd_node = avd_node_find_nodeid(avd_cb->node_id_avd); if (nullptr == avd_cb->ext_comp_info.local_avnd_node) { -- ___ 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: do not call memset on classes with string members [#1642]
Summary: amfd: do not call memset on classes with string members [#1642] Review request for Trac Ticket(s): 1642 Peer Reviewer(s): AMF devs 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 servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): - This should be applied after the previous 6 AMFD patches sent for review. This should fix the coredump reported in amfd_crash2.tgz of #1642 changeset 545a4a9de6b820170114b989c2e376a1a7c277a3 Author: Gary LeeDate: Wed, 03 Aug 2016 13:43:10 +1000 amfd: do not call memset on classes with string members [#1642] Complete diffstat: -- osaf/services/saf/amf/amfd/sirankedsu.cc | 2 -- osaf/services/saf/amf/amfd/su.cc | 1 - 2 files changed, 0 insertions(+), 3 deletions(-) Testing Commands: - <> Testing, Expected Results: -- <> Conditions of Submission: - <> 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. -- ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 0 of 1] Review Request for log: Readme file for long DN support [#1315]
Hi Lennart, Yes. The ticket number is #1898. (https://sourceforge.net/p/opensaf/tickets/1898/) I will update the Doc soon after this ticket is pushed. Thanks. Regards, Vu > -Original Message- > From: Lennart Lund [mailto:lennart.l...@ericsson.com] > Sent: Tuesday, August 2, 2016 9:02 PM > To: Vu Minh Nguyen; > mahesh.va...@oracle.com > Cc: opensaf-devel@lists.sourceforge.net > Subject: RE: [PATCH 0 of 1] Review Request for log: Readme file for long DN > support [#1315] > > Hi Vu > > Do we have a ticket for updating the log PR document? > We need to update API information and saflogger tool information. A > reference to OpenSAF_extensions_PR may also be added > > /Lennart > > > -Original Message- > > From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] > > Sent: den 4 juli 2016 05:07 > > To: mahesh.va...@oracle.com; Lennart Lund > > Cc: opensaf-devel@lists.sourceforge.net > > Subject: [PATCH 0 of 1] Review Request for log: Readme file for long DN > > support [#1315] > > > > Summary: log: Readme file for long DN support [#1315] > > Review request for Trac Ticket(s): #1315 > > Peer Reviewer(s): Mahesh, Lennart > > Pull request to: <> > > Affected branch(es): default > > Development branch: default > > > > > > Impacted area Impact y/n > > > > Docsy > > Build systemn > > RPM/packaging n > > Configuration files n > > Startup scripts n > > SAF servicesn > > OpenSAF servicesn > > Core libraries n > > Samples n > > Tests n > > Other n > > > > > > Comments (indicate scope for each "y" above): > > - > > <> > > > > changeset 545afb8cdc918ec8a1de92bfe03818d90d7fa968 > > Author: Vu Minh Nguyen > > Date: Mon, 04 Jul 2016 10:05:02 +0700 > > > > log: Readme file for long DN support [#1315] > > > > Show changes for long DN, including: 1) saflogger tool 2) log agent > 3) > > log > > services 4) test suite > > > > > > Added Files: > > > > osaf/services/saf/logsv/README_LONGDN > > > > > > Complete diffstat: > > -- > > osaf/services/saf/logsv/README_LONGDN | 138 > > ++ > > ++ > > ++ > > 1 files changed, 138 insertions(+), 0 deletions(-) > > > > > > Testing Commands: > > - > > <> > > > > > > Testing, Expected Results: > > -- > > <> > > > > > > Conditions of Submission: > > - > > <> > > > > > > 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
Re: [devel] [PATCH 0 of 1] Review Request for log: Readme file for long DN support [#1315]
Hi Vu Do we have a ticket for updating the log PR document? We need to update API information and saflogger tool information. A reference to OpenSAF_extensions_PR may also be added /Lennart > -Original Message- > From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] > Sent: den 4 juli 2016 05:07 > To: mahesh.va...@oracle.com; Lennart Lund> Cc: opensaf-devel@lists.sourceforge.net > Subject: [PATCH 0 of 1] Review Request for log: Readme file for long DN > support [#1315] > > Summary: log: Readme file for long DN support [#1315] > Review request for Trac Ticket(s): #1315 > Peer Reviewer(s): Mahesh, Lennart > Pull request to: <> > Affected branch(es): default > Development branch: default > > > Impacted area Impact y/n > > Docsy > Build systemn > RPM/packaging n > Configuration files n > Startup scripts n > SAF servicesn > OpenSAF servicesn > Core libraries n > Samples n > Tests n > Other n > > > Comments (indicate scope for each "y" above): > - > <> > > changeset 545afb8cdc918ec8a1de92bfe03818d90d7fa968 > Author: Vu Minh Nguyen > Date: Mon, 04 Jul 2016 10:05:02 +0700 > > log: Readme file for long DN support [#1315] > > Show changes for long DN, including: 1) saflogger tool 2) log agent 3) > log > services 4) test suite > > > Added Files: > > osaf/services/saf/logsv/README_LONGDN > > > Complete diffstat: > -- > osaf/services/saf/logsv/README_LONGDN | 138 > ++ > ++ > ++ > 1 files changed, 138 insertions(+), 0 deletions(-) > > > Testing Commands: > - > <> > > > Testing, Expected Results: > -- > <> > > > Conditions of Submission: > - > <> > > > 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.
Re: [devel] [PATCH 3 of 3] logtest: change related to Cluster Membership (CLM) integration [#1638] V2
Hi The following manual tests (and maybe more) must be added to the UML tests suite Thanks Lennart > -Original Message- > From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] > Sent: den 2 augusti 2016 10:18 > To: Vu Minh Nguyen; Lennart Lund > ; Anders Widell > Cc: opensaf-devel@lists.sourceforge.net > Subject: [PATCH 3 of 3] logtest: change related to Cluster Membership (CLM) > integration [#1638] V2 > > tests/logsv/saflogtest.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > > Test : > > #amf-adm lock safNode=PL-4,safCluster=myClmCluster > > failed with code SA_AIS_ERR_UNAVAILABLE (31). > > #amf-adm unlock safNode=PL-4,safCluster=myClmCluster > > failed with code SA_AIS_ERR_UNAVAILABLE (31). > > #amf-adm lock safNode=PL-4,safCluster=myClmCluster + (SC-1 & Sc-2 > /etc/init.d/opensafd stop) > > failed with code SA_AIS_ERR_UNAVAILABLE (31) > > # amf-adm lock safNode=PL-4,safCluster=myClmCluster + ((SC-1 & Sc-2 > /etc/init.d/opensafd stop)) + > ((SC-1 & Sc-2 /etc/init.d/opensafd start) + amf-adm unlock safNode=PL- > 4,safCluster=myClmCluster > >failed with code SA_AIS_ERR_UNAVAILABLE (31) > > Expected but currently The Imm APIs are NOT working > error - saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2) > > diff --git a/tests/logsv/saflogtest.c b/tests/logsv/saflogtest.c > --- a/tests/logsv/saflogtest.c > +++ b/tests/logsv/saflogtest.c > @@ -86,7 +86,7 @@ static inline void time_meas_log(time_me > static void logWriteLogCallbackT(SaInvocationT invocation, SaAisErrorT > error); > > static SaLogCallbacksT logCallbacks = { 0, 0, logWriteLogCallbackT }; > -static SaVersionT logVersion = { 'A', 2, 1 }; > +static SaVersionT logVersion = { 'A', 2, 2 }; > > static char *progname = "saflogtest"; > static SaInvocationT cb_invocation; -- ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638] V2
Hi My comments for patch 2 I have found some things that should be considered in order to get as clean code as possible: 1. Functions for handling CLM can be found in several files. It is better to collect all CLM handling in the lgs_clm file and just include function calls in the rest of the code. Also all functions that shall be globally available should have a prototype in the corresponding lgs_clm.h file 2. New global variables are added to the cb structure. Do not use global variables try at least to keep the scope of state variables, flags and other variables within the lgs_clm file. Implement setter and getter functions if needed or even better functions that are using the variables e.g. like the is_client_clm_member() function. This also makes it possible to make these functions thread safe (do not use the global cb lock mutex). which means that this can be handled in one place instead of all over the code 3. Take advantage of C++ and make simpler handling of lists. It's no longer needed to use patricia tree handling Maybe even create a LgsClm class? See also inline comments [Lennart] Thanks Lennart > -Original Message- > From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] > Sent: den 2 augusti 2016 10:18 > To: Vu Minh Nguyen; Lennart Lund > ; Anders Widell > Cc: opensaf-devel@lists.sourceforge.net > Subject: [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration > [#1638] V2 > > osaf/services/saf/logsv/lgs/Makefile.am |7 +- > osaf/services/saf/logsv/lgs/lgs_cb.h| 15 +++ > osaf/services/saf/logsv/lgs/lgs_clm.cc | 142 > +++ > osaf/services/saf/logsv/lgs/lgs_clm.h | 25 + > osaf/services/saf/logsv/lgs/lgs_evt.cc | 143 > > osaf/services/saf/logsv/lgs/lgs_evt.h |2 + > osaf/services/saf/logsv/lgs/lgs_main.cc | 28 ++ > osaf/services/saf/logsv/lgs/lgs_mds.cc | 38 - > osaf/services/saf/logsv/lgs/lgs_util.cc | 83 ++ > 9 files changed, 480 insertions(+), 3 deletions(-) > > > diff --git a/osaf/services/saf/logsv/lgs/Makefile.am > b/osaf/services/saf/logsv/lgs/Makefile.am > --- a/osaf/services/saf/logsv/lgs/Makefile.am > +++ b/osaf/services/saf/logsv/lgs/Makefile.am > @@ -37,7 +37,8 @@ noinst_HEADERS = \ > lgs_mbcsv_v3.h \ > lgs_mbcsv_v5.h \ > lgs_recov.h \ > - lgs_imm_gcfg.h > + lgs_imm_gcfg.h \ > + lgs_clm.h > > osaf_execbindir = $(pkglibdir) > osaf_execbin_PROGRAMS = osaflogd > @@ -67,7 +68,8 @@ osaflogd_SOURCES = \ > lgs_mbcsv_v3.cc \ > lgs_mbcsv_v5.cc \ > lgs_recov.cc \ > - lgs_imm_gcfg.cc > + lgs_imm_gcfg.cc \ > + lgs_clm.cc > > osaflogd_LDADD = \ > $(top_builddir)/osaf/tools/safimm/src/libimmutil.la \ > @@ -75,4 +77,5 @@ osaflogd_LDADD = \ > $(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \ > $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \ > $(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \ > + $(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \ > $(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la > diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h > b/osaf/services/saf/logsv/lgs/lgs_cb.h > --- a/osaf/services/saf/logsv/lgs/lgs_cb.h > +++ b/osaf/services/saf/logsv/lgs/lgs_cb.h > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -55,6 +56,11 @@ typedef struct lgs_stream_list { > } lgs_stream_list_t; > > typedef struct { > + NCS_PATRICIA_NODE patnode; > + NODE_ID node_id; > +} lgs_clm_node_t; > + [Lennart] Would it be possible to not add new patricia node handling? Since the log service is compiled as C++ code C++ list tools could be used instead? lgs_clm_node_find > +typedef struct { > NCS_PATRICIA_NODE pat_node; > uint32_t client_id; > uint32_t client_id_net; > @@ -73,6 +79,7 @@ typedef struct lgs_cb { > MDS_DEST vaddr; /* My identification in MDS > */ > SaVersionT log_version; /* The version currently supported > */ > NCS_PATRICIA_TREE client_tree; /* LGA/Library/Client > instantiation pat. tree */ > + NCS_PATRICIA_TREE clm_node_tree; /* LGA/Library/Client > instantiation pat. tree */ > SaNameT comp_name; /* Components's name LGS */ > SaAmfHandleT amf_hdl; /* AMF handle, obtained thru AMF > init*/ > SaSelectionObjectT amfSelectionObject; /* Selection Object to > wait for AMF events */ > @@ -80,6 +87,9 @@ typedef struct lgs_cb { > bool is_quiesced_set; > SaImmOiHandleT immOiHandle; /* IMM OI handle > */ > SaSelectionObjectT immSelectionObject; /* Selection Object to > wait for IMM events */ > + SaSelectionObjectT clmSelectionObject; /* Selection Object to wait > for clms events */ > + SaClmHandleT clm_hdl; /* CLM
[devel] [PATCH 1 of 1] amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850]
osaf/services/saf/amf/amfd/main.cc | 2 +- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 3 ++- osaf/services/saf/amf/amfd/sgproc.cc| 8 +--- 3 files changed, 4 insertions(+), 9 deletions(-) If standby amfd is not available then stby_sync_state should be in out of sync state. Else, Amfd should be in out of sync state. This is to avoid issues like 1841 diff --git a/osaf/services/saf/amf/amfd/main.cc b/osaf/services/saf/amf/amfd/main.cc --- a/osaf/services/saf/amf/amfd/main.cc +++ b/osaf/services/saf/amf/amfd/main.cc @@ -542,7 +542,7 @@ static uint32_t initialize(void) cb->fully_initialized = false; cb->swap_switch = false; cb->active_services_exist = true; - cb->stby_sync_state = AVD_STBY_IN_SYNC; + cb->stby_sync_state = AVD_STBY_OUT_OF_SYNC; cb->sync_required = true; cb->heartbeat_tmr.is_active = false; 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 @@ -771,7 +771,8 @@ SaAisErrorT SG_2N::si_swap(AVD_SI *si, S goto done; } - if (si->sg_of_si->sg_ncs_spec) { + if ((si->sg_of_si->sg_ncs_spec) && + ((cb->node_id_avd_other != 0) && (cb->other_avd_adest != 0))) { if (avd_cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC) { LOG_ER("%s SWAP failed - Cold sync in progress", si->name.value); rc = SA_AIS_ERR_TRY_AGAIN; 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 @@ -1997,14 +1997,8 @@ void avd_node_down_mw_susi_failover(AVD_ if ((i_su->sg_of_su->sg_redundancy_model == SA_AMF_2N_REDUNDANCY_MODEL) && (i_su->sg_of_su->sg_fsm_state == AVD_SG_FSM_STABLE)) (void) avd_clm_track_start(); - /* If Std ctlr went down in middle of Cold sync, then we need - to reset the sync state to IN_SYNC. */ - if ((i_su->sg_of_su->sg_redundancy_model == SA_AMF_2N_REDUNDANCY_MODEL) && - (cb->stby_sync_state == AVD_STBY_OUT_OF_SYNC)) { - TRACE("Marking sync_state as in_sync"); - cb->stby_sync_state = AVD_STBY_IN_SYNC; - } /* Free all the SU SI assignments*/ + i_su->delete_all_susis(); } /* for (const auto& i_su : avnd->list_of_su) */ -- ___ 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: mark stby_sync_state out of sync if peer amfd is absent [#1850]
Summary: amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850] Review request for Trac Ticket(s): #1850 Peer Reviewer(s): Amf Developers Pull request to: <> Affected branch(es): All 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): - <> changeset b2c7e396ef3f39eab2176cd69371259582633593 Author: Nagendra KumarDate: Tue, 02 Aug 2016 17:26:14 +0530 amfd: mark stby_sync_state out of sync if peer amfd is absent [#1850] If standby amfd is not available then stby_sync_state should be in out of sync state. Else, Amfd should be in out of sync state. This is to avoid issues like 1841 Complete diffstat: -- osaf/services/saf/amf/amfd/main.cc | 2 +- osaf/services/saf/amf/amfd/sg_2n_fsm.cc | 3 ++- osaf/services/saf/amf/amfd/sgproc.cc| 8 +--- 3 files changed, 4 insertions(+), 9 deletions(-) Testing Commands: - 1. Perform some switchover and failovers. 2. Keep delay in cold sync on stdby amfd and while cold sync is undergoing , perform si swap. Testing, Expected Results: -- 1. All should pass. 2. Should get the following error for some time, before si swap suceeds: "SWAP failed - Cold sync in progress" Conditions of Submission: - Ack 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. -- ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
Re: [devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638] V2
Hi My comments [Lennart] I will continue reviewing patch 2 Thanks Lennart > -Original Message- > From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] > Sent: den 2 augusti 2016 07:18 > To: Vu Minh Nguyen; Lennart Lund > ; Anders Widell > Cc: opensaf-devel@lists.sourceforge.net > Subject: [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration > [#1638] V2 > > osaf/libs/agents/saf/lga/lga.h | 2 + > osaf/libs/agents/saf/lga/lga_api.c | 47 > osaf/libs/agents/saf/lga/lga_mds.c | 69 > ++ > osaf/libs/agents/saf/lga/lga_util.c| 2 + > osaf/libs/common/logsv/include/lgsv_defs.h | 6 ++- > osaf/libs/common/logsv/include/lgsv_msg.h | 17 +- > 6 files changed, 138 insertions(+), 5 deletions(-) > > > V2 patch: > > Incorporated Anders Widell and Vureview comments , > for more details see the review comments posted on V1 patch. > Description: > > Form CLM integration is supported from Log Service A.02.02. > > At-least a A.02.02 LGA client will check CLM membership status of client's > node. > old LGA clients A.02.01 are always clm member. > > This patch enhanced the log service for Unavailability of the Log Service API > on a > Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE. > > After this patch the Log Service does not provide service to processes on > cluster nodes that are not > in the cluster membership. > > If the node rejoins the cluster membership, processes executing on the > node will be > able to reinitialize new library handles and use the entire set of Log Service > APIs that > operate on these new handles; however, invocation of APIs that operate on > handles > acquired by any process before the node left the membership will continue > to fail with > SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above > for > asynchronous calls) with the exception of saLogFinalize(), which is used to > free the > library handles and all resources associated with these handles. Hence, it is > recommended > for the processes to finalize the library handles as soon as the processes > detect that the node left the membership. > > Detailed README will be provide soon. > > Following are expected Log Service API behavior : > > Case1: On Non-Member Node, Log Service API will fail with code > SA_AIS_ERR_UNAVAILABLE (31) > Case2: On Member Node after recovered from Non-Member Node, Log > Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) > Case3: Non-Member Node + (Headless) Log Service API will fail with code > SA_AIS_ERR_UNAVAILABLE (31) > Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API > will fail with code SA_AIS_ERR_UNAVAILABLE (31) [Lennart] I assume you will move this info about the implementation/feature to the README file > > diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h > --- a/osaf/libs/agents/saf/lga/lga.h > +++ b/osaf/libs/agents/saf/lga/lga.h > @@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec { >* Set when client is initialized an all >* streams are recovered >*/ > + bool is_stale_client; /* Status of client based on the CLM status of > node.*/ > } lga_client_hdl_rec_t; > > /* States of the server */ > @@ -118,6 +119,7 @@ typedef struct { > /* LGS LGA sync params */ > int lgs_sync_awaited; > NCS_SEL_OBJ lgs_sync_sel; > + SaClmClusterChangesT clm_node_state; /*Reflects CLM status of > this node(for future use).*/ [Lennart] This type is defined in saClm.h but saClm.h is included indirectly via ncsencdec_pub.h, saClm.h should be included here directly > } lga_cb_t; > > /* lga_saf_api.c */ > diff --git a/osaf/libs/agents/saf/lga/lga_api.c > b/osaf/libs/agents/saf/lga/lga_api.c > --- a/osaf/libs/agents/saf/lga/lga_api.c > +++ b/osaf/libs/agents/saf/lga/lga_api.c > @@ -324,6 +324,16 @@ SaAisErrorT saLogSelectionObjectGet(SaLo > rc = SA_AIS_ERR_BAD_HANDLE; > goto done; > } > + > + osaf_mutex_lock_ordie(_cb.cb_lock); > + /*Check CLM membership of node.*/ > + if (hdl_rec->is_stale_client == true) { > + TRACE("Node not CLM member or stale client"); > + ncshm_give_hdl(logHandle); > + rc = SA_AIS_ERR_UNAVAILABLE; > + goto done; > + } > + osaf_mutex_unlock_ordie(_cb.cb_lock); > > /* Obtain the selection object from the IPC queue */ > sel_obj = m_NCS_IPC_GET_SEL_OBJ(_rec->mbx); > @@ -381,6 +391,16 @@ SaAisErrorT saLogDispatch(SaLogHandleT l > goto done; > } > > + osaf_mutex_lock_ordie(_cb.cb_lock); > + /*Check CLM membership of node.*/ > + if (hdl_rec->is_stale_client == true) { > + TRACE("Node not CLM
Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V2
Hi! I ran "make cppcheck" and "make cpplint" on these new patches, and I still get the following warnings for the two new files lgs_clm.cc and lgs_clm.h: [osaf/services/saf/logsv/lgs/lgs_clm.cc:98] -> [osaf/services/saf/logsv/lgs/lgs_clm.cc:100]: (style) Variable 'rc' is reassigned a value before the old one has been used. ./osaf/services/saf/logsv/lgs/lgs_clm.h:0: No #ifndef header guard found, suggested CPP variable is: OSAF_SERVICES_SAF_LOGSV_LGS_LGS_CLM_H_ [build/header_guard] [5] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:18: Include the directory when naming .h files [build/include] [4] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:19: Include the directory when naming .h files [build/include] [4] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:31: Lines should be <= 80 characters long [whitespace/line_length] [2] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:32: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:33: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:34: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:35: { should almost always be at the end of the previous line [whitespace/braces] [4] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:36: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:37: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:38: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:39: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:41: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:42: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:43: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:44: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:45: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:46: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:48: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:49: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:50: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:51: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:52: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:53: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:54: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:55: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:56: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:57: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:58: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:58: Missing space before { [whitespace/braces] [5] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:59: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:60: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:61: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:62: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:63: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:64: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:65: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:66: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:67: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:68: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:69: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:70: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:71: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:72: Tab found; better to use spaces [whitespace/tab] [1] ./osaf/services/saf/logsv/lgs/lgs_clm.cc:72: Line ends in whitespace. Consider deleting these
Re: [devel] [PATCH 0 of 5] Review Request for imm:Hardcoded limits are made into config parameters [#195]
Hi Neel, Reviewed and tested the patches. Ack from me. BR, Hung Nguyen - DEK Technologies From: Neelakanta Reddy reddy.neelaka...@oracle.com Sent: Wednesday, July 27, 2016 3:31PM To: Zoran Milinkovic, Hung Nguyen zoran.milinko...@ericsson.com, hung.d.ngu...@dektech.com.au Cc: Opensaf-devel opensaf-devel@lists.sourceforge.net Subject: [PATCH 0 of 5] Review Request for imm:Hardcoded limits are made into config parameters [#195] Summary: Hardcoded limits are added as config parameters [#195] Review request for Trac Ticket(s):195 Peer Reviewer(s): Zoran, Hung 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): - changeset bd980ca7528061b3b8dac255d15b808871178526 Author: Neelakanta Reddy Date: Wed, 27 Jul 2016 13:48:35 +0530 imm: Remove the IMM limits checking in encoding and decoding [#195] changeset f389fb5fc59a506fb4342ccd44f333c3b6296e8b Author: Neelakanta Reddy Date: Wed, 27 Jul 2016 13:49:25 +0530 imm: Added new attributes to imm config class [#195] changeset 157b4ec00ae677a693985353f6916195b2cfbcba Author: Neelakanta Reddy Date: Wed, 27 Jul 2016 13:51:21 +0530 imm: Checking of Imm limits [#195] changeset e95dcbb8b133eab87d7fc98346a94b29f01a8245 Author: Neelakanta Reddy Date: Wed, 27 Jul 2016 13:53:20 +0530 imm: Added the updated OpensafImm class [#195] changeset 1059ddcaa88c7af100ab7f715894bda882802bd9 Author: Neelakanta Reddy Date: Wed, 27 Jul 2016 13:53:50 +0530 imm: updated README [#195] Complete diffstat: -- osaf/libs/common/immsv/immsv_evt.c | 69 --- osaf/libs/common/immsv/include/immsv_api.h |9 osaf/services/saf/immsv/README | 43 +++ osaf/services/saf/immsv/immloadd/imm_loader.cc | 28 +++- osaf/services/saf/immsv/immnd/ImmModel.cc | 322 ++- osaf/services/saf/immsv/immnd/ImmModel.hh |5 +- tests/immsv/management/test_saImmOmAccessorGet_2.c |2 +- 7 files changed, 412 insertions(+), 66 deletions(-) Testing Commands: - Test the maximum limits for each attribute. Modify the attributes to a new value and test Test while upgrading the node from 5.0 to default Testing, Expected Results: -- ERR_NO_RESOURCE or ERR_BAD_OPERATION is returned based on the verification against the results. Conditions of Submission: - Ack from reviewers 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
[devel] [PATCH 0 of 8] Review Request for CKPT: Support DNs longer than 255 bytes [#1574]
Summary: CKPT: Support DNs longer than 255 bytes [#1574] Review request for Trac Ticket(s): 1574 Peer Reviewer(s): mahesh.va...@oracle.com; anders.wid...@ericsson.com Pull request to: mahesh.va...@oracle.com 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 servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): - changeset 4d12e373df37e584ef89ab2de425da2aca605234 Author: Hoang VoDate: Tue, 02 Aug 2016 15:16:03 +0700 cpd: Add support for extended SaNameT [#1574] changeset fff91d9209edc72d57fdaf2b7eae4f139f6e882b Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 cpnd: Add support for extended SaNameT v1 [#1574] changeset 1514ff6d5f37070c5faa776409f3455d257e188d Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 cpa: Add support for extended SaNameT v1 [#1574] changeset 0d2ab3645b20083a65838d666e3c0778e1e715ef Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 cpsv: Add new message to support extended SaNameT v1 [#1574] New messages supporting extended SaNameT are introduce. Encoding and decoding funtions for them are also included. changeset 13de643d5e887f68178651ba9610c486dbfde82b Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 cpd: Add new mbcsv messages supporting extended SaNameT v1 [#1574] New MBCSV messages supporting extended SaNameT and their encoding/decoding functions are included. changeset de69ca58258b72dc4a97f48ca2e68e9b023d0e5f Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574] changeset 9d469821de69d8b5252010bf3b5d04ab84b00ba9 Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 ckpt: Add new test cases to verify long DN feature on CPSV v1 [#1574] changeset 3f57a04ecd76a5449add80ea5898cc441d968103 Author: Hoang Vo Date: Tue, 02 Aug 2016 15:16:03 +0700 imported patch 1574_cpnd_support_recover_shm_version_0_v3.patch Complete diffstat: -- osaf/libs/agents/saf/cpa/Makefile.am |1 + osaf/libs/agents/saf/cpa/cpa_api.c| 68 +++--- osaf/libs/agents/saf/cpa/cpa_db.c |2 + osaf/libs/agents/saf/cpa/cpa_mds.c|8 +- osaf/libs/agents/saf/cpa/cpa_proc.c |2 +- osaf/libs/common/cpsv/cpsv_evt.c | 505 +-- osaf/libs/common/cpsv/include/cpa.h |1 + osaf/libs/common/cpsv/include/cpa_cb.h|2 +- osaf/libs/common/cpsv/include/cpa_proc.h |2 +- osaf/libs/common/cpsv/include/cpd.h |1 + osaf/libs/common/cpsv/include/cpd_cb.h| 17 +- osaf/libs/common/cpsv/include/cpd_imm.h |4 +- osaf/libs/common/cpsv/include/cpd_mem.h | 25 +++- osaf/libs/common/cpsv/include/cpd_proc.h |2 +- osaf/libs/common/cpsv/include/cpnd.h |1 + osaf/libs/common/cpsv/include/cpnd_cb.h |5 +- osaf/libs/common/cpsv/include/cpnd_init.h |3 +- osaf/libs/common/cpsv/include/cpsv_evt.h | 24 +++ osaf/libs/common/cpsv/include/cpsv_shm.h | 24 +++- osaf/services/saf/cpsv/cpd/Makefile.am|1 + osaf/services/saf/cpsv/cpd/cpd_amf.c |7 +- osaf/services/saf/cpsv/cpd/cpd_db.c | 95 +++--- osaf/services/saf/cpsv/cpd/cpd_evt.c | 107 +++- osaf/services/saf/cpsv/cpd/cpd_imm.c | 268 ++ osaf/services/saf/cpsv/cpd/cpd_main.c |7 + osaf/services/saf/cpsv/cpd/cpd_mbcsv.c| 31 - osaf/services/saf/cpsv/cpd/cpd_mds.c | 86 - osaf/services/saf/cpsv/cpd/cpd_proc.c | 184 +++-- osaf/services/saf/cpsv/cpd/cpd_red.c |6 +- osaf/services/saf/cpsv/cpd/cpd_sbevt.c| 57 +++- osaf/services/saf/cpsv/cpnd/Makefile.am |1 + osaf/services/saf/cpsv/cpnd/cpnd_db.c |6 +- osaf/services/saf/cpsv/cpnd/cpnd_evt.c| 101 +++ osaf/services/saf/cpsv/cpnd/cpnd_main.c |7 + osaf/services/saf/cpsv/cpnd/cpnd_mds.c| 86 - osaf/services/saf/cpsv/cpnd/cpnd_proc.c | 92 ++--- osaf/services/saf/cpsv/cpnd/cpnd_res.c| 823
Re: [devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]
Dear Mahesh, I have just submitted the V3 patch fixing source code following your comment. I also update readme file that is attached to this email. Please tell me if you have any further inquiry. Thank you and best regards, Hoang -Original Message- From: A V Mahesh [mailto:mahesh.va...@oracle.com] Sent: Friday, July 29, 2016 1:27 PM To: Vo Minh HoangCc: opensaf-devel@lists.sourceforge.net Subject: Re: [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574] Hi , I have proved some code related minor comment in 4 of 8 , 6 of 8 & 8 of 8 , please address them also in new patch(s). Reading testing : On 7/29/2016 7:49 AM, Vo Minh Hoang wrote: > We do not have specific test case and environment for in-service update. > So my test work is based on osaftest cases. > > I tested with old d - new nd and new d - old nd cases. I started basic testing with one new Controller & one old Controller and tow Old payload setup. I observed some encode/decode issue by running simple ` /usr/bin/ckpttest` Even I was not able to proceed with other testing which not related to LONG DN)( continuously receiving SA_AIS_ERR_TRY_AGAIN) Please re-visit the all encode & decode function that you have introduced run the basic testing with the above setup running application on ( old nodes/application and new nodes/application ) traces On Old Node ( with out patch ) Jul 29 11:34:16 SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:16 SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:26 SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:27 SC-2 osafckptnd[5233]: ER cpnd mds decode failed Jul 29 11:34:27 SC-2 osafckptnd[5233]: ER cpnd mds decode failed == Jul 29 11:34:04.216980 osafckptnd [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.217086 osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback Jul 29 11:34:04.217100 osafckptnd [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.217129 osafckptnd [5233:cpnd_mds.c:0729] << cpnd_mds_rcv Jul 29 11:34:04.217175 osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback Jul 29 11:34:04.217240 osafckptnd [5233:cpsv_evt.c:2219] TR cpnd <<== [9] CPSV_EVT_ND2ND_CKPT_SECT_CREATE_REQ(sec_id=0x0B15) from node 0x2010F Jul 29 11:34:04.217254 osafckptnd [5233:cpnd_evt.c:2626] >> cpnd_evt_proc_nd2nd_ckpt_sect_create Jul 29 11:34:04.217264 osafckptnd [5233:cpnd_evt.c:2632] T4 cpnd ckpt node get failed for ckpt_id:9 Jul 29 11:34:04.217272 osafckptnd [5233:cpnd_mds.c:1004] >> cpnd_mds_send_rsp Jul 29 11:34:04.217282 osafckptnd [5233:cpsv_evt.c:2213] TR cpnd ==>> [0] CPSV_EVT_ND2ND_CKPT_SECT_ACTIVE_CREATE_RSP(err=6) to node 0x2010F Jul 29 11:34:04.217301 osafckptnd [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.217310 osafckptnd [5233:cpnd_mds.c:0291] >> cpnd_mds_enc Jul 29 11:34:04.217331 osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback Jul 29 11:34:04.217464 osafckptnd [5233:cpnd_mds.c:1028] << cpnd_mds_send_rsp Jul 29 11:34:04.217483 osafckptnd [5233:cpnd_evt.c:2740] << cpnd_evt_proc_nd2nd_ckpt_sect_create Jul 29 11:34:04.217493 osafckptnd [5233:cpnd_evt.c:4433] >> cpnd_evt_destroy Jul 29 11:34:04.217503 osafckptnd [5233:cpnd_evt.c:4619] << cpnd_evt_destroy Jul 29 11:34:04.719653 osafckptnd [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.719758 osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback Jul 29 11:34:04.719772 osafckptnd [5233:cpnd_mds.c:0225] >> cpnd_mds_callback Jul 29 11:34:04.719801 osafckptnd [5233:cpnd_mds.c:0729] << cpnd_mds_rcv Jul 29 11:34:04.719812 osafckptnd [5233:cpnd_mds.c:0267] << cpnd_mds_callback = 520|0 88 03703659 1 10| 520|0 88 03703659 1 11| SUCCESS : ckpt with all flags on created 520|0 88 03703659 1 12| Return Value : SA_AIS_OK 520|0 88 03703659 1 13| 520|0 88 03703659 1 14| SUCCESS : Unlinked ckpt all replica 520|0 88 03703659 1 15| Return Value : SA_AIS_OK 520|0 88 03703659 1 16| 520|0 88 03703659 1 17| FAILED: Section 11 created in ckpt 520|0 88 03703659 1 18| Return Value : SA_AIS_ERR_TRY_AGAIN = -AVM On 7/29/2016 7:49 AM, Vo Minh Hoang wrote: > Dear Mahesh, > > We do not have specific test case and environment for in-service update. > So my test work is based on osaftest cases. > > I tested with old d - new nd and new d - old nd cases. > There are failed test cases but after investigating, they are > intensional when old one cannot recognize new message. > The only problem found is record to ticket #1922 and it is not related > to long DN problem. > > Thank you and best regards, >
[devel] [PATCH 3 of 3] logtest: change related to Cluster Membership (CLM) integration [#1638] V2
tests/logsv/saflogtest.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Test : #amf-adm lock safNode=PL-4,safCluster=myClmCluster failed with code SA_AIS_ERR_UNAVAILABLE (31). #amf-adm unlock safNode=PL-4,safCluster=myClmCluster failed with code SA_AIS_ERR_UNAVAILABLE (31). #amf-adm lock safNode=PL-4,safCluster=myClmCluster + (SC-1 & Sc-2 /etc/init.d/opensafd stop) failed with code SA_AIS_ERR_UNAVAILABLE (31) # amf-adm lock safNode=PL-4,safCluster=myClmCluster + ((SC-1 & Sc-2 /etc/init.d/opensafd stop)) + ((SC-1 & Sc-2 /etc/init.d/opensafd start) + amf-adm unlock safNode=PL-4,safCluster=myClmCluster failed with code SA_AIS_ERR_UNAVAILABLE (31) Expected but currently The Imm APIs are NOT working error - saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2) diff --git a/tests/logsv/saflogtest.c b/tests/logsv/saflogtest.c --- a/tests/logsv/saflogtest.c +++ b/tests/logsv/saflogtest.c @@ -86,7 +86,7 @@ static inline void time_meas_log(time_me static void logWriteLogCallbackT(SaInvocationT invocation, SaAisErrorT error); static SaLogCallbacksT logCallbacks = { 0, 0, logWriteLogCallbackT }; -static SaVersionT logVersion = { 'A', 2, 1 }; +static SaVersionT logVersion = { 'A', 2, 2 }; static char *progname = "saflogtest"; static SaInvocationT cb_invocation; -- ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638] V2
osaf/libs/agents/saf/lga/lga.h | 2 + osaf/libs/agents/saf/lga/lga_api.c | 47 osaf/libs/agents/saf/lga/lga_mds.c | 69 ++ osaf/libs/agents/saf/lga/lga_util.c| 2 + osaf/libs/common/logsv/include/lgsv_defs.h | 6 ++- osaf/libs/common/logsv/include/lgsv_msg.h | 17 +- 6 files changed, 138 insertions(+), 5 deletions(-) V2 patch: Incorporated Anders Widell and Vureview comments , for more details see the review comments posted on V1 patch. Description: Form CLM integration is supported from Log Service A.02.02. At-least a A.02.02 LGA client will check CLM membership status of client's node. old LGA clients A.02.01 are always clm member. This patch enhanced the log service for Unavailability of the Log Service API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE. After this patch the Log Service does not provide service to processes on cluster nodes that are not in the cluster membership. If the node rejoins the cluster membership, processes executing on the node will be able to reinitialize new library handles and use the entire set of Log Service APIs that operate on these new handles; however, invocation of APIs that operate on handles acquired by any process before the node left the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above for asynchronous calls) with the exception of saLogFinalize(), which is used to free the library handles and all resources associated with these handles. Hence, it is recommended for the processes to finalize the library handles as soon as the processes detect that the node left the membership. Detailed README will be provide soon. Following are expected Log Service API behavior : Case1: On Non-Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from Non-Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) Case3: Non-Member Node + (Headless) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h --- a/osaf/libs/agents/saf/lga/lga.h +++ b/osaf/libs/agents/saf/lga/lga.h @@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec { * Set when client is initialized an all * streams are recovered */ + bool is_stale_client; /* Status of client based on the CLM status of node.*/ } lga_client_hdl_rec_t; /* States of the server */ @@ -118,6 +119,7 @@ typedef struct { /* LGS LGA sync params */ int lgs_sync_awaited; NCS_SEL_OBJ lgs_sync_sel; + SaClmClusterChangesT clm_node_state; /*Reflects CLM status of this node(for future use).*/ } lga_cb_t; /* lga_saf_api.c */ diff --git a/osaf/libs/agents/saf/lga/lga_api.c b/osaf/libs/agents/saf/lga/lga_api.c --- a/osaf/libs/agents/saf/lga/lga_api.c +++ b/osaf/libs/agents/saf/lga/lga_api.c @@ -324,6 +324,16 @@ SaAisErrorT saLogSelectionObjectGet(SaLo rc = SA_AIS_ERR_BAD_HANDLE; goto done; } + + osaf_mutex_lock_ordie(_cb.cb_lock); + /*Check CLM membership of node.*/ + if (hdl_rec->is_stale_client == true) { + TRACE("Node not CLM member or stale client"); + ncshm_give_hdl(logHandle); + rc = SA_AIS_ERR_UNAVAILABLE; + goto done; + } + osaf_mutex_unlock_ordie(_cb.cb_lock); /* Obtain the selection object from the IPC queue */ sel_obj = m_NCS_IPC_GET_SEL_OBJ(_rec->mbx); @@ -381,6 +391,16 @@ SaAisErrorT saLogDispatch(SaLogHandleT l goto done; } + osaf_mutex_lock_ordie(_cb.cb_lock); + /*Check CLM membership of node.*/ + if (hdl_rec->is_stale_client == true) { + TRACE("Node not CLM member or stale client"); + ncshm_give_hdl(logHandle); + rc = SA_AIS_ERR_UNAVAILABLE; + goto done; + } + osaf_mutex_unlock_ordie(_cb.cb_lock); + if ((rc = lga_hdl_cbk_dispatch(_cb, hdl_rec, dispatchFlags)) != SA_AIS_OK) TRACE("LGA_DISPATCH_FAILURE"); @@ -777,6 +797,15 @@ SaAisErrorT saLogStreamOpen_2(SaLogHandl goto done; } + osaf_mutex_lock_ordie(_cb.cb_lock); + /*Check CLM membership of node.*/ + if (hdl_rec->is_stale_client == true) { + TRACE("%s Node not CLM member or stale client", __FUNCTION__); + ais_rc = SA_AIS_ERR_UNAVAILABLE; + goto done_give_hdl; + } + osaf_mutex_unlock_ordie(_cb.cb_lock); + /*** * Handle states
[devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V2
Summary:lgsv: Log Service CLM integration [#1638] V2 Review request for Trac Ticket(s): #1638 Peer Reviewer(s): Vu, Lennart,Anders Widell Pull request to: <> Affected branch(es): default Development branch: defult 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): - changeset 3dbef8972c5101149a4754c43557e72acda32833 Author: A V MaheshDate: Tue, 02 Aug 2016 13:40:55 +0530 lga: agent Cluster Membership (CLM) integration [#1638] V2 V2 patch: Incorporated Anders Widell and Vu review comments , for more details see the review comments posted on V1 patch. Description: Form CLM integration is supported from Log Service A.02.02. At-least a A.02.02 LGA client will check CLM membership status of client's node. old LGA clients A.02.01 are always clm member. This patch enhanced the log service for Unavailability of the Log Service API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE. After this patch the Log Service does not provide service to processes on cluster nodes that are not in the cluster membership. If the node rejoins the cluster membership, processes executing on the node will be able to reinitialize new library handles and use the entire set of Log Service APIs that operate on these new handles; however, invocation of APIs that operate on handles acquired by any process before the node left the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above for asynchronous calls) with the exception of saLogFinalize(), which is used to free the library handles and all resources associated with these handles. Hence, it is recommended for the processes to finalize the library handles as soon as the processes detect that the node left the membership. Detailed README will be provide soon. Following are expected Log Service API behavior : Case1: On Non-Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from Non- Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) Case3: Non-Member Node + (Headless) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) changeset 713685dbe1282e40293b06d3067235452c931e77 Author: A V Mahesh Date: Tue, 02 Aug 2016 13:42:17 +0530 lgs: director Cluster Membership (CLM) integration [#1638] V2 changeset c992f8bf5f5b2df528c50497e06556346c7fe6db Author: A V Mahesh Date: Tue, 02 Aug 2016 13:42:48 +0530 logtest: change related to Cluster Membership (CLM) integration [#1638] V2 Test : #amf-adm lock safNode=PL-4,safCluster=myClmCluster failed with code SA_AIS_ERR_UNAVAILABLE (31). #amf-adm unlock safNode=PL-4,safCluster=myClmCluster failed with code SA_AIS_ERR_UNAVAILABLE (31). #amf-adm lock safNode=PL-4,safCluster=myClmCluster + (SC-1 & Sc-2 /etc/init.d/opensafd stop) failed with code SA_AIS_ERR_UNAVAILABLE (31) # amf-adm lock safNode=PL-4,safCluster=myClmCluster + ((SC-1 & Sc-2 /etc/init.d/opensafd stop)) + ((SC-1 & Sc-2 /etc/init.d/opensafd start) + amf-adm unlock safNode=PL-4,safCluster=myClmCluster failed with code SA_AIS_ERR_UNAVAILABLE (31) Expected but currently The Imm APIs are NOT working error - saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2) Complete diffstat: -- osaf/libs/agents/saf/lga/lga.h |2 + osaf/libs/agents/saf/lga/lga_api.c | 47 + osaf/libs/agents/saf/lga/lga_mds.c | 69 ++ osaf/libs/agents/saf/lga/lga_util.c|2 + osaf/libs/common/logsv/include/lgsv_defs.h |6 - osaf/libs/common/logsv/include/lgsv_msg.h | 17 --- osaf/services/saf/logsv/lgs/Makefile.am|7 - osaf/services/saf/logsv/lgs/lgs_cb.h | 15 ++ osaf/services/saf/logsv/lgs/lgs_clm.cc | 142
[devel] [PATCH 6 of 8] cpsv: Apply new messages supporting extended SaNameT to CPD, CPND, and CPA v1 [#1574]
osaf/libs/agents/saf/cpa/cpa_api.c | 30 -- osaf/libs/agents/saf/cpa/cpa_mds.c | 6 - osaf/libs/common/cpsv/cpsv_evt.c| 1 + osaf/services/saf/cpsv/cpd/cpd_evt.c| 10 ++-- osaf/services/saf/cpsv/cpd/cpd_mds.c| 2 + osaf/services/saf/cpsv/cpd/cpd_proc.c | 6 - osaf/services/saf/cpsv/cpnd/cpnd_evt.c | 36 +--- osaf/services/saf/cpsv/cpnd/cpnd_mds.c | 2 + osaf/services/saf/cpsv/cpnd/cpnd_proc.c | 10 ++-- 9 files changed, 84 insertions(+), 19 deletions(-) diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c b/osaf/libs/agents/saf/cpa/cpa_api.c --- a/osaf/libs/agents/saf/cpa/cpa_api.c +++ b/osaf/libs/agents/saf/cpa/cpa_api.c @@ -880,6 +880,10 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH } ckpt_name = osaf_extended_name_borrow(checkpointName); + if (strlen(ckpt_name) >= kOsafMaxDnLength) { + TRACE_LEAVE2("API return code = %u", SA_AIS_ERR_INVALID_PARAM); + return SA_AIS_ERR_INVALID_PARAM; + } /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02 Section 3.6.1 saCkptCheckpointOpen() and saCkptCheckpointOpenAsync(), Return Values */ @@ -981,7 +985,11 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH /* Populate & Send the Open Event to CPND */ memset(, 0, sizeof(CPSV_EVT)); evt.type = CPSV_EVT_TYPE_CPND; - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN; + if (osaf_extended_name_length(checkpointName) <= SA_MAX_UNEXTENDED_NAME_LENGTH) { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN; + } else { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2; + } evt.info.cpnd.info.openReq.client_hdl = ckptHandle; evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl; @@ -1192,6 +1200,10 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa } ckpt_name = osaf_extended_name_borrow(checkpointName); + if (strlen(ckpt_name) >= kOsafMaxDnLength) { + TRACE_LEAVE2("API return code = %u", SA_AIS_ERR_INVALID_PARAM); + return SA_AIS_ERR_INVALID_PARAM; + } /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02 Section 3.6.1 saCkptCheckpointOpen() and saCkptCheckpointOpenAsync(), Return Values */ @@ -1277,7 +1289,11 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa /* Populate & Send the Open Event to CPND */ memset(, 0, sizeof(CPSV_EVT)); evt.type = CPSV_EVT_TYPE_CPND; - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN; + if (osaf_extended_name_length(checkpointName) <= SA_MAX_UNEXTENDED_NAME_LENGTH) { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN; + } else { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_OPEN_2; + } evt.info.cpnd.info.openReq.client_hdl = ckptHandle; evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl; @@ -1597,6 +1613,10 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp } ckpt_name = osaf_extended_name_borrow(checkpointName); + if (strlen(ckpt_name) >= kOsafMaxDnLength) { + TRACE_LEAVE2("API return code = %u", SA_AIS_ERR_INVALID_PARAM); + return SA_AIS_ERR_INVALID_PARAM; + } /* retrieve CPA CB */ m_CPA_RETRIEVE_CB(cb); @@ -1635,7 +1655,11 @@ SaAisErrorT saCkptCheckpointUnlink(SaCkp /* Populate evt.info.cpnd.info.unlinkReq & Call MDS sync Send */ memset(, 0, sizeof(CPSV_EVT)); evt.type = CPSV_EVT_TYPE_CPND; - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK; + if (osaf_extended_name_length(checkpointName) <= SA_MAX_UNEXTENDED_NAME_LENGTH) { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK; + } else { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_UNLINK_2; + } osaf_extended_name_lend(ckpt_name, _name); diff --git a/osaf/libs/agents/saf/cpa/cpa_mds.c b/osaf/libs/agents/saf/cpa/cpa_mds.c --- a/osaf/libs/agents/saf/cpa/cpa_mds.c +++ b/osaf/libs/agents/saf/cpa/cpa_mds.c @@ -515,9 +515,13 @@ static uint32_t cpa_mds_svc_evt(CPA_CB * /* Populate & Send the Open Event to CPND */ memset(, 0, sizeof(CPSV_EVT)); evt.type = CPSV_EVT_TYPE_CPND; - evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE; evt.info.cpnd.info.ckptListUpdate.client_hdl = lc_node->cl_hdl; osaf_extended_name_lend(lc_node->ckpt_name, _name); + if (osaf_extended_name_length(_name) <= SA_MAX_UNEXTENDED_NAME_LENGTH) { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE; + } else { + evt.info.cpnd.type = CPND_EVT_A2ND_CKPT_LIST_UPDATE_2; + } proc_rc = cpa_mds_msg_send(cb->cpa_mds_hdl,
[devel] [PATCH 3 of 8] cpa: Add support for extended SaNameT v1 [#1574]
osaf/libs/agents/saf/cpa/Makefile.am | 1 + osaf/libs/agents/saf/cpa/cpa_api.c | 36 osaf/libs/agents/saf/cpa/cpa_db.c| 2 + osaf/libs/agents/saf/cpa/cpa_mds.c | 2 +- osaf/libs/agents/saf/cpa/cpa_proc.c | 2 +- osaf/libs/common/cpsv/include/cpa.h | 1 + osaf/libs/common/cpsv/include/cpa_cb.h | 2 +- osaf/libs/common/cpsv/include/cpa_proc.h | 2 +- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/osaf/libs/agents/saf/cpa/Makefile.am b/osaf/libs/agents/saf/cpa/Makefile.am --- a/osaf/libs/agents/saf/cpa/Makefile.am +++ b/osaf/libs/agents/saf/cpa/Makefile.am @@ -22,6 +22,7 @@ noinst_LTLIBRARIES = libcpa.la libcpa_la_CPPFLAGS = \ -DNCS_CPA=1 \ + -DSA_EXTENDED_NAME_SOURCE \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/osaf/libs/common/cpsv/include diff --git a/osaf/libs/agents/saf/cpa/cpa_api.c b/osaf/libs/agents/saf/cpa/cpa_api.c --- a/osaf/libs/agents/saf/cpa/cpa_api.c +++ b/osaf/libs/agents/saf/cpa/cpa_api.c @@ -870,19 +870,20 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH bool locked = false; uint32_t time_out=0; CPA_GLOBAL_CKPT_NODE *gc_node = NULL; + SaConstStringT ckpt_name = NULL; TRACE_ENTER2("SaCkptCheckpointHandleT passed is %llx",ckptHandle); - if ((checkpointName == NULL) || (checkpointHandle == NULL) || (checkpointName->length == 0)) { + if ((checkpointName == NULL) || (checkpointHandle == NULL) || (osaf_extended_name_length(checkpointName) == 0)) { TRACE_4("Cpa CkptOpen Api failed with return value:%d,ckptHandle:%llx", SA_AIS_ERR_INVALID_PARAM, ckptHandle); TRACE_LEAVE2("API return code = %u", rc); return SA_AIS_ERR_INVALID_PARAM; } - m_CPSV_SET_SANAMET(checkpointName); + ckpt_name = osaf_extended_name_borrow(checkpointName); /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02 Section 3.6.1 saCkptCheckpointOpen() and saCkptCheckpointOpenAsync(), Return Values */ -if (strncmp((const char *)checkpointName->value, "safCkpt=", 8) != 0) { +if (strncmp(ckpt_name, "safCkpt=", 8) != 0) { TRACE_4("Cpa CkptOpen:DN failed with return value:%d,ckptHandle:%llx", SA_AIS_ERR_INVALID_PARAM, ckptHandle); TRACE_LEAVE2("API return code = %u", rc); return SA_AIS_ERR_INVALID_PARAM; @@ -909,7 +910,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH /* Draft Validations */ - rc = cpa_open_attr_validate(checkpointCreationAttributes, checkpointOpenFlags, checkpointName); + rc = cpa_open_attr_validate(checkpointCreationAttributes, checkpointOpenFlags); if (rc != SA_AIS_OK) { /* No need to log, already logged inside the cpa_open_attr_validate */ goto done; @@ -965,7 +966,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH lc_node->cl_hdl = ckptHandle; lc_node->open_flags = checkpointOpenFlags; - lc_node->ckpt_name = *checkpointName; + lc_node->ckpt_name = strdup(ckpt_name); /* Add CPA_LOCAL_CKPT_NODE to lcl_ckpt_hdl_tree */ proc_rc = cpa_lcl_ckpt_node_add(>lcl_ckpt_tree, lc_node); @@ -984,7 +985,7 @@ SaAisErrorT saCkptCheckpointOpen(SaCkptH evt.info.cpnd.info.openReq.client_hdl = ckptHandle; evt.info.cpnd.info.openReq.lcl_ckpt_hdl = lc_node->lcl_ckpt_hdl; - evt.info.cpnd.info.openReq.ckpt_name = *checkpointName; + osaf_extended_name_lend(ckpt_name, _name); if (checkpointCreationAttributes) { evt.info.cpnd.info.openReq.ckpt_attrib = *checkpointCreationAttributes; @@ -1128,6 +1129,7 @@ gl_node_add_fail: lc_node_add_fail: if (lc_node != NULL) { + free((void *)lc_node->ckpt_name); m_MMGR_FREE_CPA_LOCAL_CKPT_NODE(lc_node); } @@ -1179,6 +1181,7 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa CPA_LOCAL_CKPT_NODE *lc_node = NULL; CPA_CLIENT_NODE *cl_node = NULL; uint32_t proc_rc = NCSCC_RC_SUCCESS; + SaConstStringT ckpt_name = NULL; TRACE_ENTER2("SaCkptCheckpointHandleT passed is %llx",ckptHandle); @@ -1188,19 +1191,17 @@ SaAisErrorT saCkptCheckpointOpenAsync(Sa return SA_AIS_ERR_INVALID_PARAM; } - /* Draft Validations */ - - m_CPSV_SET_SANAMET(checkpointName); + ckpt_name = osaf_extended_name_borrow(checkpointName); /* SA_AIS_ERR_INVALID_PARAM, bullet 4 in SAI-AIS-CKPT-B.02.02 Section 3.6.1 saCkptCheckpointOpen() and saCkptCheckpointOpenAsync(), Return Values */ -if (strncmp((const char *)checkpointName->value, "safCkpt=", 8) != 0) { +if (strncmp(ckpt_name, "safCkpt=", 8) != 0) { TRACE_4("cpa CkptOpen:DN Api failed with return value:%d,ckptHandle:%llx", SA_AIS_ERR_INVALID_PARAM, ckptHandle);
[devel] [PATCH 1 of 8] cpd: Add support for extended SaNameT [#1574]
osaf/libs/common/cpsv/include/cpd.h |1 + osaf/libs/common/cpsv/include/cpd_cb.h | 17 +- osaf/libs/common/cpsv/include/cpd_imm.h |4 +- osaf/libs/common/cpsv/include/cpd_mem.h | 25 ++- osaf/libs/common/cpsv/include/cpd_proc.h |2 +- osaf/services/saf/cpsv/cpd/Makefile.am |1 + osaf/services/saf/cpsv/cpd/cpd_amf.c |7 +- osaf/services/saf/cpsv/cpd/cpd_db.c | 95 +- osaf/services/saf/cpsv/cpd/cpd_evt.c | 103 +++ osaf/services/saf/cpsv/cpd/cpd_imm.c | 268 +- osaf/services/saf/cpsv/cpd/cpd_main.c|7 + osaf/services/saf/cpsv/cpd/cpd_mbcsv.c |9 +- osaf/services/saf/cpsv/cpd/cpd_proc.c| 178 ++-- osaf/services/saf/cpsv/cpd/cpd_red.c |6 +- osaf/services/saf/cpsv/cpd/cpd_sbevt.c | 57 ++--- 15 files changed, 474 insertions(+), 306 deletions(-) diff --git a/osaf/libs/common/cpsv/include/cpd.h b/osaf/libs/common/cpsv/include/cpd.h --- a/osaf/libs/common/cpsv/include/cpd.h +++ b/osaf/libs/common/cpsv/include/cpd.h @@ -33,6 +33,7 @@ #ifndef CPD_H #define CPD_H +#include "osaf_extended_name.h" #include "cpsv.h" #include "ncssysf_def.h" #include "ncs_main_papi.h" diff --git a/osaf/libs/common/cpsv/include/cpd_cb.h b/osaf/libs/common/cpsv/include/cpd_cb.h --- a/osaf/libs/common/cpsv/include/cpd_cb.h +++ b/osaf/libs/common/cpsv/include/cpd_cb.h @@ -78,7 +78,7 @@ typedef struct cpsv_node_ref_info { typedef struct cpd_ckpt_info_node { NCS_PATRICIA_NODE patnode; SaCkptCheckpointHandleT ckpt_id; - SaNameT ckpt_name; + SaConstStringT ckpt_name; uint32_t dest_cnt; CPD_NODE_REF_INFO *node_list; bool is_unlink_set; @@ -123,8 +123,7 @@ typedef struct cpd_cpnd_info_node { uint32_t timer_state; bool ckpt_cpnd_scxb_exist; /* for imm */ - SaNameT node_name; - SaNameT ckpt_name; + SaConstStringT node_name; uint32_t rep_type; } CPD_CPND_INFO_NODE; @@ -132,15 +131,15 @@ typedef struct cpd_cpnd_info_node { typedef struct cpd_ckpt_map_info { NCS_PATRICIA_NODE patnode; - SaNameT ckpt_name; + SaConstStringT ckpt_name; SaCkptCheckpointHandleT ckpt_id; SaCkptCheckpointCreationAttributesT attributes; SaVersionT client_version; } CPD_CKPT_MAP_INFO; typedef struct cpd_rep_key_info { - SaNameT ckpt_name; - SaNameT node_name; + SaConstStringT ckpt_name; + SaConstStringT node_name; } CPD_REP_KEY_INFO; typedef struct cpd_ckpt_reploc_info { @@ -219,7 +218,7 @@ typedef struct cpd_cb_tag { #define CPD_CB_NULL ((CPD_CB *)0) /* Function Declarations */ -CPD_CKPT_INFO_NODE *cpd_find_add_ckpt_name(CPD_CB *cpd_cb, SaNameT ckpt_name); +CPD_CKPT_INFO_NODE *cpd_find_add_ckpt_name(CPD_CB *cpd_cb, SaConstStringT ckpt_name); void cpd_free_ckpt_node(CPD_CB *gld_cb, CPD_CKPT_INFO_NODE *ckpt_info); @@ -248,9 +247,9 @@ void cpd_ckpt_reploc_tree_destroy(CPD_CB uint32_t cpd_ckpt_map_tree_init(CPD_CB *cb); uint32_t cpd_ckpt_map_node_get(NCS_PATRICIA_TREE *ckpt_map_tree, -SaNameT *ckpt_name, CPD_CKPT_MAP_INFO **ckpt_map_node); +SaConstStringT ckpt_name, CPD_CKPT_MAP_INFO **ckpt_map_node); void cpd_ckpt_map_node_getnext(NCS_PATRICIA_TREE *ckpt_map_tree, - SaNameT *ckpt_name, CPD_CKPT_MAP_INFO **ckpt_map_node); + SaConstStringT *ckpt_name, CPD_CKPT_MAP_INFO **ckpt_map_node); uint32_t cpd_ckpt_map_node_add(NCS_PATRICIA_TREE *ckpt_map_tree, CPD_CKPT_MAP_INFO *ckpt_map_node); uint32_t cpd_ckpt_map_node_delete(CPD_CB *cb, CPD_CKPT_MAP_INFO *ckpt_map_node); diff --git a/osaf/libs/common/cpsv/include/cpd_imm.h b/osaf/libs/common/cpsv/include/cpd_imm.h --- a/osaf/libs/common/cpsv/include/cpd_imm.h +++ b/osaf/libs/common/cpsv/include/cpd_imm.h @@ -4,7 +4,9 @@ extern SaAisErrorT cpd_imm_init(SaImmOiH extern void cpd_imm_reinit_bg(CPD_CB * cb); extern void cpd_imm_declare_implementer(SaImmOiHandleT* immOiHandle, SaSelectionObjectT* imm_sel_obj); extern SaAisErrorT create_runtime_ckpt_object(CPD_CKPT_INFO_NODE *ckpt_node, SaImmOiHandleT immOiHandle); +extern SaAisErrorT delete_runtime_ckpt_object(CPD_CKPT_INFO_NODE *ckpt_node, SaImmOiHandleT immOiHandle); extern SaAisErrorT create_runtime_replica_object(CPD_CKPT_REPLOC_INFO *ckpt_reploc_node, SaImmOiHandleT immOiHandle); -extern void cpd_create_association_class_dn(const SaNameT *child_dn, const SaNameT *parent_dn, const char *rdn_tag, SaNameT *dn); +extern SaAisErrorT delete_runtime_replica_object(CPD_CKPT_REPLOC_INFO *ckpt_reploc_node, SaImmOiHandleT immOiHandle); +extern void cpd_create_association_class_dn(const char *child_dn, const char *parent_dn, const char *rdn_tag, char **dn); extern SaAisErrorT cpd_clean_checkpoint_objects(CPD_CB *cb); extern SaUint32T cpd_get_scAbsenceAllowed_attr(); diff --git
[devel] [PATCH 5 of 8] cpd: Add new mbcsv messages supporting extended SaNameT v1 [#1574]
osaf/services/saf/cpsv/cpd/cpd_mbcsv.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) New MBCSV messages supporting extended SaNameT and their encoding/decoding functions are included. diff --git a/osaf/services/saf/cpsv/cpd/cpd_mbcsv.c b/osaf/services/saf/cpsv/cpd/cpd_mbcsv.c --- a/osaf/services/saf/cpsv/cpd/cpd_mbcsv.c +++ b/osaf/services/saf/cpsv/cpd/cpd_mbcsv.c @@ -23,6 +23,8 @@ **/ #include "cpd.h" +extern uint32_t cpsv_encode_extended_name(NCS_UBAID *uba, SaNameT *name); +extern uint32_t cpsv_decode_extended_name(NCS_UBAID *uba, SaNameT *name); /** * Name : cpd_mbcsv_async_update @@ -385,6 +387,9 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_ TRACE_4("edu exec async create failed"); rc = NCSCC_RC_FAILURE; } + + cpsv_encode_extended_name(>info.encode.io_uba, _msg->info.ckpt_create.ckpt_name); + break; case CPD_A2S_MSG_CKPT_UNLINK: @@ -395,6 +400,9 @@ uint32_t cpd_mbcsv_enc_async_update(CPD_ TRACE_4("edu exec async unlink failed"); rc = NCSCC_RC_FAILURE; } + + cpsv_encode_extended_name(>info.encode.io_uba, _msg->info.ckpt_ulink.ckpt_name); + break; case CPD_A2S_MSG_CKPT_RDSET: @@ -573,6 +581,8 @@ uint32_t cpd_mbcsv_enc_msg_resp(CPD_CB * TRACE_LEAVE(); return rc; } + + cpsv_encode_extended_name(>info.encode.io_uba, _create.ckpt_name); if (ckpt_create.dest_list) m_MMGR_FREE_CPSV_CPND_DEST_INFO(ckpt_create.dest_list); @@ -783,6 +793,9 @@ uint32_t cpd_mbcsv_dec_async_update(CPD_ rc = NCSCC_RC_FAILURE; goto end; } + + cpsv_decode_extended_name(>info.decode.i_uba, _create->ckpt_name); + cpd_msg->type = evt_type; cpd_msg->info.ckpt_create = *ckpt_create; rc = cpd_process_sb_msg(cb, cpd_msg); @@ -808,6 +821,9 @@ uint32_t cpd_mbcsv_dec_async_update(CPD_ rc = NCSCC_RC_FAILURE; goto end; } + + cpsv_decode_extended_name(>info.decode.i_uba, _unlink->ckpt_name); + cpd_msg->type = evt_type; cpd_msg->info.ckpt_ulink = *ckpt_unlink; rc = cpd_process_sb_msg(cb, cpd_msg); @@ -998,6 +1014,9 @@ uint32_t cpd_mbcsv_dec_sync_resp(CPD_CB TRACE_LEAVE(); return rc; } + + cpsv_decode_extended_name(>info.decode.i_uba, _data->ckpt_name); + mbcsv_msg.info.ckpt_create = *ckpt_data; proc_rc = cpd_sb_proc_ckpt_create(cb, _msg); if (proc_rc != NCSCC_RC_SUCCESS) { @@ -1007,6 +1026,9 @@ uint32_t cpd_mbcsv_dec_sync_resp(CPD_CB if (ckpt_data->dest_list) m_MMGR_FREE_CPSV_SYS_MEMORY(ckpt_data->dest_list); + if (osaf_is_an_extended_name(_data->ckpt_name)) + free((void *)osaf_extended_name_borrow(_data->ckpt_name)); + memset(ckpt_data, 0, sizeof(CPD_A2S_CKPT_CREATE)); memset(_msg, 0, sizeof(CPD_MBCSV_MSG)); } -- ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 4 of 8] cpsv: Add new message to support extended SaNameT v1 [#1574]
osaf/libs/common/cpsv/cpsv_evt.c | 504 ++- osaf/libs/common/cpsv/include/cpsv_evt.h | 24 + osaf/services/saf/cpsv/cpd/cpd_mds.c | 84 - osaf/services/saf/cpsv/cpnd/cpnd_mds.c | 84 - 4 files changed, 668 insertions(+), 28 deletions(-) New messages supporting extended SaNameT are introduce. Encoding and decoding funtions for them are also included. diff --git a/osaf/libs/common/cpsv/cpsv_evt.c b/osaf/libs/common/cpsv/cpsv_evt.c --- a/osaf/libs/common/cpsv/cpsv_evt.c +++ b/osaf/libs/common/cpsv/cpsv_evt.c @@ -30,11 +30,14 @@ #include "cpsv.h" #include "cpa_tmr.h" +#include "osaf_extended_name.h" FUNC_DECLARATION(CPSV_CKPT_DATA); static SaCkptSectionIdT *cpsv_evt_dec_sec_id(NCS_UBAID *i_ub, uint32_t svc_id); static uint32_t cpsv_evt_enc_sec_id(NCS_UBAID *o_ub, SaCkptSectionIdT *sec_id); static void cpsv_convert_sec_id_to_string(char *sec_id_str, SaCkptSectionIdT *section_id); +static uint32_t cpsv_encode_extended_name_flat(NCS_UBAID *uba, SaNameT *name); +static uint32_t cpsv_decode_extended_name_flat(NCS_UBAID *uba, SaNameT *name); const char *cpa_evt_str[] = { "STRING_0", @@ -258,6 +261,13 @@ char* cpsv_evt_str(CPSV_EVT *evt, char * info->client_hdl, info->ckpt_name.value); break; } + case CPND_EVT_A2ND_CKPT_OPEN_2: + { + CPSV_A2ND_OPEN_REQ *info = >info.cpnd.info.openReq; + snprintf(o_evt_str, len, "CPND_EVT_A2ND_CKPT_OPEN_2(hdl=%llu, %s)", + info->client_hdl, osaf_extended_name_borrow(>ckpt_name)); + break; + } case CPND_EVT_A2ND_CKPT_CLOSE: { CPSV_A2ND_CKPT_CLOSE *info = >info.cpnd.info.closeReq; @@ -271,6 +281,12 @@ char* cpsv_evt_str(CPSV_EVT *evt, char * snprintf(o_evt_str, len, "CPND_EVT_A2ND_CKPT_UNLINK(%s)", info->ckpt_name.value); break; } + case CPND_EVT_A2ND_CKPT_UNLINK_2: + { + CPSV_A2ND_CKPT_UNLINK *info = >info.cpnd.info.ulinkReq; + snprintf(o_evt_str, len, "CPND_EVT_A2ND_CKPT_UNLINK_2(%s)", osaf_extended_name_borrow(>ckpt_name)); + break; + } case CPND_EVT_A2ND_CKPT_RDSET: { CPSV_A2ND_RDSET *info = >info.cpnd.info.rdsetReq; @@ -513,12 +529,33 @@ char* cpsv_evt_str(CPSV_EVT *evt, char * case CPND_EVT_D2ND_CKPT_CREATE: { CPSV_D2ND_CKPT_CREATE *info = >info.cpnd.info.ckpt_create; - snprintf(o_evt_str, len, "[%llu] CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, active=0x%X)", - info->ckpt_info.ckpt_id, info->ckpt_name.value, + snprintf(o_evt_str, len, "[%llu] CPND_EVT_D2ND_CKPT_CREATE(%s, create_rep=%s, is_act=%s, active=0x%X, dest_cnt=%d)", + info->ckpt_info.ckpt_id, osaf_extended_name_borrow(>ckpt_name), info->ckpt_info.ckpt_rep_create ? "true" : "false", - m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest)); + info->ckpt_info.is_active_exists ? "true" : "false", + m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest), + info->ckpt_info.dest_cnt); break; } + case CPND_EVT_D2ND_CKPT_CREATE_2: + { + CPSV_D2ND_CKPT_CREATE *info = >info.cpnd.info.ckpt_create; + snprintf(o_evt_str, len, "[%llu] CPND_EVT_D2ND_CKPT_CREATE_2(%s, create_rep=%s, is_act=%s, active=0x%X, dest_cnt=%d)", + info->ckpt_info.ckpt_id, osaf_extended_name_borrow(>ckpt_name), + info->ckpt_info.ckpt_rep_create ? "true" : "false", + info->ckpt_info.is_active_exists ? "true" : "false", + m_NCS_NODE_ID_FROM_MDS_DEST(info->ckpt_info.active_dest), + info->ckpt_info.dest_cnt); + + SaCkptCheckpointCreationAttributesT *attr = >ckpt_info.attributes; + TRACE("mSecS=%lld, flags=%d, mSec=%d, mSecIdS=%lld, ret=%lld, ckptS=%lld", attr->maxSectionSize, + attr->creationFlags, attr->maxSections, attr->maxSectionIdSize, attr->retentionDuration, + attr->checkpointSize); + for (int i = 0; i < info->ckpt_info.dest_cnt; i++) + TRACE("dest[%d] = 0x%" PRIX64 " ", i, info->ckpt_info.dest_list[i].dest); + break; +
[devel] [PATCH 8 of 8] imported patch 1574_cpnd_support_recover_shm_version_0_v3.patch
osaf/libs/common/cpsv/include/cpsv_shm.h | 18 + osaf/services/saf/cpsv/cpnd/cpnd_proc.c |1 - osaf/services/saf/cpsv/cpnd/cpnd_res.c | 821 +++--- 3 files changed, 633 insertions(+), 207 deletions(-) diff --git a/osaf/libs/common/cpsv/include/cpsv_shm.h b/osaf/libs/common/cpsv/include/cpsv_shm.h --- a/osaf/libs/common/cpsv/include/cpsv_shm.h +++ b/osaf/libs/common/cpsv/include/cpsv_shm.h @@ -74,6 +74,24 @@ typedef struct ckpt_info { int32_t next; } CKPT_INFO; +typedef struct ckpt_info_v0 { + SaNameT ckpt_name; + SaCkptCheckpointHandleT ckpt_id; + uint32_t maxSections; + SaSizeT maxSecSize; + NODE_ID node_id; + int32_t offset; + uint32_t client_bitmap; + int32_t is_valid; + uint32_t bm_offset; + bool is_unlink; + bool is_close; + bool cpnd_rep_create; + bool is_first; + SaTimeT close_time; + int32_t next; +} CKPT_INFO_V0; + typedef struct client_info { SaCkptHandleT ckpt_app_hdl; uint32_t ckpt_open_ref_cnt; diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_proc.c b/osaf/services/saf/cpsv/cpnd/cpnd_proc.c --- a/osaf/services/saf/cpsv/cpnd/cpnd_proc.c +++ b/osaf/services/saf/cpsv/cpnd/cpnd_proc.c @@ -1813,7 +1813,6 @@ uint32_t cpnd_ckpt_hdr_update(CPND_CKPT_ memset(_req, '\0', sizeof(write_req)); memset(_hdr, '\0', sizeof(CPSV_CKPT_HDR)); ckpt_hdr.ckpt_id = cp_node->ckpt_id; - strncpy(ckpt_hdr.ckpt_name, cp_node->ckpt_name, kOsafMaxDnLength); ckpt_hdr.create_attrib = cp_node->create_attrib; ckpt_hdr.open_flags = cp_node->open_flags; ckpt_hdr.is_unlink = cp_node->is_unlink; diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_res.c b/osaf/services/saf/cpsv/cpnd/cpnd_res.c --- a/osaf/services/saf/cpsv/cpnd/cpnd_res.c +++ b/osaf/services/saf/cpsv/cpnd/cpnd_res.c @@ -40,6 +40,8 @@ #define m_CPND_CKPTINFO_READ(ckpt_info,addr,offset) memcpy(_info,addr+offset,sizeof(CKPT_INFO)) +#define m_CPND_CKPTINFO_V0_READ(ckpt_info,addr,offset) memcpy(_info,addr+offset,sizeof(CKPT_INFO_V0)) + #define m_CPND_CKPTINFO_UPDATE(addr,ckpt_info,offset) memcpy(addr+offset,_info,sizeof(CKPT_INFO)) #define m_CPND_CKPTHDR_UPDATE(ckpt_hdr,offset) memcpy(offset,_hdr,sizeof(CKPT_HDR)) @@ -48,6 +50,13 @@ static uint32_t cpnd_res_ckpt_sec_add(CP static bool cpnd_find_exact_ckptinfo(CPND_CB *cb, CKPT_INFO *ckpt_info, uint32_t bitmap_offset, uint32_t *offset, uint32_t *prev_offset); static void cpnd_clear_ckpt_info(CPND_CB *cb, CPND_CKPT_NODE *cp_node, uint32_t curr_offset, uint32_t prev_offset); +static uint32_t cpnd_restore_client_info(CPND_CB *cb, uint8_t *cli_addr); +static uint32_t cpnd_restore_ckpt_info_v1(CPND_CB *cb, uint8_t *ckpt_addr, SaClmNodeIdT nodeid); +static uint32_t cpnd_restore_ckpt_info_v0(CPND_CB *cb, uint8_t *ckpt_addr, SaClmNodeIdT nodeid); +static void cpnd_destroy_shm_cpnd_cp_info(NCS_OS_POSIX_SHM_REQ_OPEN_INFO *open_req); +static void *cpnd_create_shm_cpnd_cp_info(NCS_OS_POSIX_SHM_REQ_INFO *req_info); +static void cpnd_update_shm_cpnd_cp_info(CPND_CB *cb); +static void cpnd_convert_cp_info_v0(CKPT_INFO_V0 *cp_info_v0, CKPT_INFO *cp_info); /*** * * Name : cpnd_client_extract_bits @@ -315,24 +324,10 @@ void cpnd_restart_update_timer(CPND_CB * void *cpnd_restart_shm_create(NCS_OS_POSIX_SHM_REQ_INFO *cpnd_open_req, CPND_CB *cb, SaClmNodeIdT nodeid) { - uint32_t counter = 0, count, num_bitset = 0, n_clients, rc = NCSCC_RC_SUCCESS, bit_position; - uint64_t i_offset; - int32_t next_offset; - CPND_CKPT_CLIENT_NODE *cl_node = NULL; - CPND_CKPT_NODE *cp_node = NULL; - CLIENT_INFO cl_info; - CLIENT_HDR cli_hdr; - CKPT_INFO cp_info, tmp_cp_info; - SaCkptHandleT client_hdl; + uint32_t rc = NCSCC_RC_SUCCESS; char *buf = NULL, *buffer = NULL; uint8_t size = 0, total_length; GBL_SHM_PTR gbl_shm_addr = {0, 0, 0, 0, 0}; - memset(_info, '\0', sizeof(CKPT_INFO)); - NCS_OS_POSIX_SHM_REQ_INFO ckpt_rep_open; - SaTimeT presentTime, timeout = 0; - int64_t now, diff_time, giga_sec; - uint32_t max_client_hdl = 0; - SaTimeT tmpTime = 0; CPND_SHM_VERSION cpnd_shm_version; TRACE_ENTER(); @@ -371,18 +366,15 @@ void *cpnd_restart_shm_create(NCS_OS_POS if (rc == NCSCC_RC_FAILURE) { /* INITIALLY IT FAILS SO CREATE A SHARED MEMORY */ TRACE_1("cpnd comming up first time"); - cpnd_open_req->info.open.i_flags = O_CREAT | O_RDWR; - rc = ncs_os_posix_shm(cpnd_open_req); - if (NCSCC_RC_FAILURE == rc) { + + if (NULL == cpnd_create_shm_cpnd_cp_info(cpnd_open_req)) { LOG_ER("cpnd open request fail for RDWR mode %s",buf);
[devel] [PATCH 2 of 8] cpnd: Add support for extended SaNameT v1 [#1574]
osaf/libs/common/cpsv/include/cpnd.h | 1 + osaf/libs/common/cpsv/include/cpnd_cb.h | 5 +- osaf/libs/common/cpsv/include/cpnd_init.h | 3 +- osaf/libs/common/cpsv/include/cpsv_shm.h | 6 +- osaf/services/saf/cpsv/cpnd/Makefile.am | 1 + osaf/services/saf/cpsv/cpnd/cpnd_db.c | 6 +- osaf/services/saf/cpsv/cpnd/cpnd_evt.c| 71 ++ osaf/services/saf/cpsv/cpnd/cpnd_main.c | 7 ++ osaf/services/saf/cpsv/cpnd/cpnd_proc.c | 83 ++ osaf/services/saf/cpsv/cpnd/cpnd_res.c| 20 +++--- 10 files changed, 143 insertions(+), 60 deletions(-) diff --git a/osaf/libs/common/cpsv/include/cpnd.h b/osaf/libs/common/cpsv/include/cpnd.h --- a/osaf/libs/common/cpsv/include/cpnd.h +++ b/osaf/libs/common/cpsv/include/cpnd.h @@ -34,6 +34,7 @@ #define CPND_H #include +#include "osaf_extended_name.h" #include "ncssysf_def.h" #include "ncs_main_papi.h" #include "ncssysf_tsk.h" diff --git a/osaf/libs/common/cpsv/include/cpnd_cb.h b/osaf/libs/common/cpsv/include/cpnd_cb.h --- a/osaf/libs/common/cpsv/include/cpnd_cb.h +++ b/osaf/libs/common/cpsv/include/cpnd_cb.h @@ -34,6 +34,9 @@ extern uint32_t gl_cpnd_cb_hdl; #define m_CPND_GIVEUP_CPND_CBncshm_give_hdl(gl_cpnd_cb_hdl) #define CPND_MAX_REPLICAS 1000 +#define CPND_MAX_REPLICA_NAME_LENGTH 255 +#define CPND_REP_NAME_MAX_CKPT_NAME_LENGTH (CPND_MAX_REPLICA_NAME_LENGTH - 32) + #define CPSV_GEN_SECTION_ID_SIZE 4 #define CPSV_WAIT_TIME 1000 @@ -169,7 +172,7 @@ typedef struct cpnd_all_repl_write_evt_n typedef struct cpnd_ckpt_node { NCS_PATRICIA_NODE patnode; SaCkptCheckpointHandleT ckpt_id;/* index for identifying the checkpoint */ - SaNameT ckpt_name; + SaConstStringT ckpt_name; SaCkptCheckpointCreationAttributesT create_attrib; SaCkptCheckpointOpenFlagsT open_flags; uint32_t ckpt_lcl_ref_cnt; diff --git a/osaf/libs/common/cpsv/include/cpnd_init.h b/osaf/libs/common/cpsv/include/cpnd_init.h --- a/osaf/libs/common/cpsv/include/cpnd_init.h +++ b/osaf/libs/common/cpsv/include/cpnd_init.h @@ -130,6 +130,7 @@ uint32_t cpnd_all_repl_rsp_expiry(CPND_C uint32_t cpnd_open_active_sync_expiry(CPND_CB *cb, CPND_TMR_INFO *tmr_info); void cpnd_proc_free_read_data(CPSV_EVT *evt); SaUint32T cpnd_get_scAbsenceAllowed_attr(); +SaUint32T cpnd_get_longDnsAllowed_attr(); /* End cpnd_proc.c */ /* File : --- cpnd_amf.c */ @@ -163,7 +164,7 @@ void cpnd_evt_node_get(CPND_CB *cb, SaCk void cpnd_evt_node_getnext(CPND_CB *cb, SaCkptCheckpointHandleT lcl_ckpt_id, CPSV_CPND_ALL_REPL_EVT_NODE **evt_node); uint32_t cpnd_evt_node_add(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE *evt_node); uint32_t cpnd_evt_node_del(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE *evt_node); -CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaNameT ckpt_name); +CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaConstStringT ckpt_name); CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_add(CPND_CKPT_NODE *cp_node, SaCkptSectionIdT *id, SaTimeT exp_time, uint32_t gen_flag); void cpnd_evt_backup_queue_add(CPND_CKPT_NODE *cp_node, CPND_EVT *evt); diff --git a/osaf/libs/common/cpsv/include/cpsv_shm.h b/osaf/libs/common/cpsv/include/cpsv_shm.h --- a/osaf/libs/common/cpsv/include/cpsv_shm.h +++ b/osaf/libs/common/cpsv/include/cpsv_shm.h @@ -18,6 +18,8 @@ #ifndef CPSV_SHM_H #define CPSV_SHM_H +#include "osaf_extended_name.h" + #define MAX_CLIENTS 1000 #define MAX_CKPTS 2000 #define MAX_SIZE 30 @@ -29,7 +31,7 @@ typedef struct cpsv_ckpt_hdr { SaCkptCheckpointHandleT ckpt_id;/* Index for identifying the checkpoint */ - SaNameT ckpt_name; + char ckpt_name[kOsafMaxDnLength]; SaCkptCheckpointCreationAttributesT create_attrib; SaCkptCheckpointOpenFlagsT open_flags; uint32_t ckpt_lcl_ref_cnt; @@ -55,7 +57,7 @@ typedef struct cpsv_sect_hdr { } CPSV_SECT_HDR; typedef struct ckpt_info { - SaNameT ckpt_name; + char ckpt_name[kOsafMaxDnLength]; SaCkptCheckpointHandleT ckpt_id; uint32_t maxSections; SaSizeT maxSecSize; diff --git a/osaf/services/saf/cpsv/cpnd/Makefile.am b/osaf/services/saf/cpsv/cpnd/Makefile.am --- a/osaf/services/saf/cpsv/cpnd/Makefile.am +++ b/osaf/services/saf/cpsv/cpnd/Makefile.am @@ -26,6 +26,7 @@ osaf_execbin_PROGRAMS = osafckptnd osafckptnd_CPPFLAGS = \ -DSA_CLM_B01=1 \ -DNCS_CPND=1 \ + -DSA_EXTENDED_NAME_SOURCE \ $(AM_CPPFLAGS) \ -I$(top_srcdir)/osaf/libs/common/immsv/include \ -I$(top_srcdir)/osaf/libs/common/cpsv/include diff --git a/osaf/services/saf/cpsv/cpnd/cpnd_db.c b/osaf/services/saf/cpsv/cpnd/cpnd_db.c --- a/osaf/services/saf/cpsv/cpnd/cpnd_db.c +++ b/osaf/services/saf/cpsv/cpnd/cpnd_db.c @@ -158,6 +158,8 @@ void cpnd_ckpt_node_destroy(CPND_CB *cb, cpnd_ckpt_sec_map_destroy(_node->replica_info); + free((void
Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V2
Hi Anders Widell, Sorry , I missed to do hg add of new file , will resend. -AVM On 8/2/2016 1:49 PM, Anders Widell wrote: > Hi Mahesh! > > The files lgs_clm.cc and lgs_clm.h seem to be missing in these > patches. Could you please resend? > > thanks, > > Anders Widell > > On 08/02/2016 07:18 AM, mahesh.va...@oracle.com wrote: >> Summary:lga: agent Cluster Membership (CLM) integration [#1638] V2 >> Review request for Trac Ticket(s): #1638 >> Peer Reviewer(s):Vu, Lennart,Anders Widell >> 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 y >> Other n >> >> >> Comments (indicate scope for each "y" above): >> - >> <> >> >> changeset d7c494e940160d474a89dbafbc2cbf058678 >> Author:A V Mahesh>> Date:Tue, 02 Aug 2016 10:41:21 +0530 >> >> lga: agent Cluster Membership (CLM) integration [#1638] V2 >> V2 patch: >> >> Incorporated Anders Widell and Vu review comments , for more details >> see the review comments posted on V1 patch. Description: >> >> Form CLM integration is supported from Log Service A.02.02. >> >> At-least a A.02.02 LGA client will check CLM membership status of >> client's >> node. old LGA clients A.02.01 are always clm member. >> >> This patch enhanced the log service for Unavailability of the Log >> Service >> API on a Non-Member Node which will fail with >> SA_AIS_ERR_UNAVAILABLE. >> >> After this patch the Log Service does not provide service to >> processes on >> cluster nodes that are not in the cluster membership. >> >> If the node rejoins the cluster membership, processes executing >> on the node >> will be able to reinitialize new library handles and use the >> entire set of >> Log Service APIs that operate on these new handles; however, >> invocation of >> APIs that operate on handles acquired by any process before the >> node left >> the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE >> (or with >> the special treatment described above for asynchronous calls) >> with the >> exception of saLogFinalize(), which is used to free the library >> handles and >> all resources associated with these handles. Hence, it is >> recommended for >> the processes to finalize the library handles as soon as the >> processes >> detect that the node left the membership. >> >> Detailed README will be provide soon. >> >> Following are expected Log Service API behavior : >> >> Case1: On Non-Member Node, Log Service API will fail with code >> SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered >> from Non- >> Member Node, Log Service API will fail with code >> SA_AIS_ERR_UNAVAILABLE (31) >> Case3: Non-Member Node + (Headless) Log Service API will fail >> with code >> SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + >> (Headless) + (Head >> Joined) Log Service API will fail with code >> SA_AIS_ERR_UNAVAILABLE (31) >> >> changeset dc881a3c478480e44bb163e75a463baaa9430482 >> Author:A V Mahesh >> Date:Tue, 02 Aug 2016 10:42:11 +0530 >> >> lgs: director Cluster Membership (CLM) integration [#1638] V2 >> >> changeset 1742284de46e241c2785744399830017b64ba3df >> Author:A V Mahesh >> Date:Tue, 02 Aug 2016 10:42:58 +0530 >> >> logtest: change related to Cluster Membership (CLM) integration >> [#1638] V2 >> Test : >> >> #amf-adm lock safNode=PL-4,safCluster=myClmCluster >> >> failed with code SA_AIS_ERR_UNAVAILABLE (31). >> >> #amf-adm unlock safNode=PL-4,safCluster=myClmCluster >> >> failed with code SA_AIS_ERR_UNAVAILABLE (31). >> >> #amf-adm lock safNode=PL-4,safCluster=myClmCluster + (SC-1 & Sc-2 >> /etc/init.d/opensafd stop) >> >> failed with code SA_AIS_ERR_UNAVAILABLE (31) >> >> # amf-adm lock safNode=PL-4,safCluster=myClmCluster + ((SC-1 & Sc-2 >> /etc/init.d/opensafd stop)) + ((SC-1 & Sc-2 /etc/init.d/opensafd >> start) + amf-adm unlock safNode=PL-4,safCluster=myClmCluster >> >> failed with code SA_AIS_ERR_UNAVAILABLE (31) >> >> Expected but currently The Imm APIs are NOT working error - >> saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2) >> >> >> Complete diffstat: >> -- >> osaf/libs/agents/saf/lga/lga.h |2 + >> osaf/libs/agents/saf/lga/lga_api.c | 47 >> +
Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V2
Hi Mahesh! The files lgs_clm.cc and lgs_clm.h seem to be missing in these patches. Could you please resend? thanks, Anders Widell On 08/02/2016 07:18 AM, mahesh.va...@oracle.com wrote: > Summary:lga: agent Cluster Membership (CLM) integration [#1638] V2 > Review request for Trac Ticket(s): #1638 > Peer Reviewer(s):Vu, Lennart,Anders Widell > 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 y > Other n > > > Comments (indicate scope for each "y" above): > - > <> > > changeset d7c494e940160d474a89dbafbc2cbf058678 > Author: A V Mahesh> Date: Tue, 02 Aug 2016 10:41:21 +0530 > > lga: agent Cluster Membership (CLM) integration [#1638] V2 > > V2 patch: > > Incorporated Anders Widell and Vu review comments , for more details > see the review comments posted on V1 patch. Description: > > Form CLM integration is supported from Log Service A.02.02. > > At-least a A.02.02 LGA client will check CLM membership status of > client's > node. old LGA clients A.02.01 are always clm member. > > This patch enhanced the log service for Unavailability of the Log > Service > API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE. > > After this patch the Log Service does not provide service to processes > on > cluster nodes that are not in the cluster membership. > > If the node rejoins the cluster membership, processes executing on the > node > will be able to reinitialize new library handles and use the entire set > of > Log Service APIs that operate on these new handles; however, invocation > of > APIs that operate on handles acquired by any process before the node > left > the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or > with > the special treatment described above for asynchronous calls) with the > exception of saLogFinalize(), which is used to free the library handles > and > all resources associated with these handles. Hence, it is recommended > for > the processes to finalize the library handles as soon as the processes > detect that the node left the membership. > > Detailed README will be provide soon. > > Following are expected Log Service API behavior : > > Case1: On Non-Member Node, Log Service API will fail with code > SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from > Non- > Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE > (31) > Case3: Non-Member Node + (Headless) Log Service API will fail with code > SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + > (Head > Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31) > > changeset dc881a3c478480e44bb163e75a463baaa9430482 > Author: A V Mahesh > Date: Tue, 02 Aug 2016 10:42:11 +0530 > > lgs: director Cluster Membership (CLM) integration [#1638] V2 > > changeset 1742284de46e241c2785744399830017b64ba3df > Author: A V Mahesh > Date: Tue, 02 Aug 2016 10:42:58 +0530 > > logtest: change related to Cluster Membership (CLM) integration [#1638] > V2 > Test : > >#amf-adm lock safNode=PL-4,safCluster=myClmCluster > > failed with code SA_AIS_ERR_UNAVAILABLE (31). > > #amf-adm unlock safNode=PL-4,safCluster=myClmCluster > > failed with code SA_AIS_ERR_UNAVAILABLE (31). > >#amf-adm lock safNode=PL-4,safCluster=myClmCluster + (SC-1 & Sc-2 > /etc/init.d/opensafd stop) > > failed with code SA_AIS_ERR_UNAVAILABLE (31) > > # amf-adm lock safNode=PL-4,safCluster=myClmCluster + ((SC-1 & Sc-2 > /etc/init.d/opensafd stop)) + ((SC-1 & Sc-2 /etc/init.d/opensafd > start) + amf-adm unlock safNode=PL-4,safCluster=myClmCluster > > failed with code SA_AIS_ERR_UNAVAILABLE (31) > >Expected but currently The Imm APIs are NOT working error - > saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2) > > > Complete diffstat: > -- > osaf/libs/agents/saf/lga/lga.h |2 + > osaf/libs/agents/saf/lga/lga_api.c | 47 > + > osaf/libs/agents/saf/lga/lga_mds.c | 69 > ++ > osaf/libs/agents/saf/lga/lga_util.c|2 + >
Re: [devel] [PATCH 1 of 1] immtools: setting of explcit admin-owner is allowed in explicit commit mode [#1383]
Hi Neel, Reviewed and tested the patch. Ack from me. BR, Hung Nguyen - DEK Technologies From: Neelakanta Reddy reddy.neelaka...@oracle.com Sent: Thursday, July 28, 2016 5:36PM To: Zoran Milinkovic, Hung Nguyen zoran.milinko...@ericsson.com, hung.d.ngu...@dektech.com.au Cc: Opensaf-devel opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] immtools: setting of explcit admin-owner is allowed in explicit commit mode [#1383] osaf/tools/safimm/immcfg/imm_cfg.c | 46 + 1 files changed, 36 insertions(+), 10 deletions(-) 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 @@ -55,6 +55,7 @@ SaImmHandleT immHandle = 0; SaImmAdminOwnerNameT adminOwnerName = NULL; SaImmAdminOwnerHandleT ownerHandle = 0; SaImmCcbHandleT ccbHandle = -1; +bool isAdminOwnerCreated = false; extern struct ImmutilWrapperProfile immutilWrapperProfile; typedef enum { @@ -129,7 +130,7 @@ static void usage(const char *progname) printf("\t--disable-attr-notify (only valid with --class-name)\n"); printf("\t-u, --unsafe\n"); printf("\t-L, --validate \n"); - printf("\t-o, --admin-owner \n"); + printf("\t-o, --admin-owner (supported in transaction mode also)\n"); printf("\t--admin-owner-clear\n"); printf("\t--ccb-apply (only in a transaction mode)\n"); printf("\t--ccb-abort (only in a transaction mode)\n"); @@ -1048,6 +1049,15 @@ static int ccb_apply() { rc = EXIT_FAILURE; } + error = immutil_saImmOmAdminOwnerFinalize(ownerHandle); + if (SA_AIS_OK != error) { + fprintf(stderr, "error - saImmOmAdminOwnerFinalize FAILED: %s\n", saf_error(error)); + rc = EXIT_FAILURE; + } + isAdminOwnerCreated = false; + if(adminOwnerName) + free(adminOwnerName); + adminOwnerName = NULL; ccbHandle = -1; } @@ -1064,7 +1074,15 @@ static int ccb_abort() { fprintf(stderr, "error - saImmOmCcbFinalize FAILED: %s\n", saf_error(error)); rc = EXIT_FAILURE; } - + error = immutil_saImmOmAdminOwnerFinalize(ownerHandle); + if (SA_AIS_OK != error) { + fprintf(stderr, "error - saImmOmAdminOwnerFinalize FAILED: %s\n", saf_error(error)); + rc = EXIT_FAILURE; + } + isAdminOwnerCreated = false; + if(adminOwnerName) + free(adminOwnerName); + adminOwnerName = NULL; ccbHandle = -1; } @@ -1438,12 +1456,12 @@ static int imm_operation(int argc, char xmlFilename = optarg; break; case 'o': - if(adminOwnerName) { + if(adminOwnerName && !transaction_mode) { fprintf(stderr, "Administrative owner name can be set only once\n"); - if(transaction_mode) - return -1; - else - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); + } else if (transaction_mode && isAdminOwnerCreated){ + fprintf(stderr, "Administrative owner name can be set intially, after ccb-apply and ccb-abort\n"); + return -1; } adminOwnerName = (SaImmAdminOwnerNameT)malloc(strlen(optarg) + 1); strcpy(adminOwnerName, optarg); @@ -1473,9 +1491,9 @@ static int imm_operation(int argc, char if(argc == 1) op = TRANSACTION_MODE; - if(!transaction_mode && !adminOwnerName) + if((op != TRANSACTION_MODE && !adminOwnerName && !transaction_mode ) || (transaction_mode && !adminOwnerName && !isAdminOwnerCreated)) adminOwnerName = create_adminOwnerName(basename(argv[0])); - + if(op != TRANSACTION_MODE) { signal(SIGALRM, sigalarmh); alarm(timeoutVal); @@ -1600,7 +1618,7 @@ static int imm_operation(int argc, char goto done_om_finalize; } - if(useAdminOwner) { + if(useAdminOwner && op != TRANSACTION_MODE) { error = immutil_saImmOmAdminOwnerInitialize(immHandle, adminOwnerName, SA_TRUE, ); if (error != SA_AIS_OK) { fprintf(stderr, "error - saImmOmAdminOwnerInitialize
Re: [devel] [PATCH 0 of 1] Review Request for rde: Change syslog priority from ER to WA when MDS send fails [#1907]
Hi Ramesh! Have you had a chance to look at this patch yet? regards, Anders Widell On 07/08/2016 02:39 PM, Anders Widell wrote: > Summary: rde: Change syslog priority from ER to WA when MDS send fails [#1907] > Review request for Trac Ticket(s): 1907 > Peer Reviewer(s): Ramesh > Pull request to: > Affected branch(es): opensaf-5.0.x, default(5.1) > 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): > - > > changeset d6a6b95b4b5d707a66fb3ddf3549ed1833dd56fe > Author: Anders Widell> Date: Fri, 08 Jul 2016 10:17:27 +0200 > > rde: Change syslog priority from ER to WA when MDS send fails [#1907] > > RDE may fail to send MDS messages to its peer, e.g. when the peer node > is > down. This should not be considered an error and therefore the syslog > messages should not have ER priority. The messages are now logged with > WA > priority. > > > Complete diffstat: > -- > osaf/services/infrastructure/rde/rde_mds.cc | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > > Testing Commands: > - > Run test cases for system controller failovers. > > > Testing, Expected Results: > -- > The syslog message "Failed to send RDE_MSG_PEER_INFO_RESP(4) to ...", if seen, > should be logged with WARNING priority. > > > Conditions of Submission: > - > Ack from reviewer(s) > > > 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. > > > -- > Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San > Francisco, CA to explore cutting-edge tech and listen to tech luminaries > present their vision of the future. This family event has something for >