From ed839b003bcbe88f4217a0ee5b7945296bcbe951 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Tue, 29 Sep 2009 04:40:30 +0000 Subject: [PATCH 01/12] Initialize branch F-12 for corosync --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..06de2d2 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-12 From 8189b0b4af2aa6ec6a6b78140a51503898ecd07d Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Wed, 21 Oct 2009 05:02:30 +0000 Subject: [PATCH 02/12] New upstream release fixes a few severe bugs --- .cvsignore | 2 +- corosync.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cvsignore b/.cvsignore index 87cccb0..3c7f24a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.1.0.tar.gz +corosync-1.1.1.tar.gz diff --git a/corosync.spec b/corosync.spec index 1f30c3c..5770449 100644 --- a/corosync.spec +++ b/corosync.spec @@ -2,7 +2,7 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.1.0 +Version: 1.1.1 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base @@ -208,6 +208,9 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/coroipc_overview.8* %changelog +* Wed Oct 21 2009 Fabio M. Di Nitto - 1.1.1-1 +- New upstream release + * Fri Sep 25 2009 Fabio M. Di Nitto - 1.1.0-1 - New upstream release - spec file updates: diff --git a/sources b/sources index 84a3599..fffa0ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f1ae40281356446d1af31a75068ec3d0 corosync-1.1.0.tar.gz +148c0690d4734bae819504534d6decbe corosync-1.1.1.tar.gz From 2fbd98e9f6d78e3a92ffb0dfdd47822067f4f779 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Fri, 23 Oct 2009 07:28:29 +0000 Subject: [PATCH 03/12] New upstream release fixes serious regression on specific loads --- .cvsignore | 2 +- corosync.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cvsignore b/.cvsignore index 3c7f24a..77e627c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.1.1.tar.gz +corosync-1.1.2.tar.gz diff --git a/corosync.spec b/corosync.spec index 5770449..d9394d0 100644 --- a/corosync.spec +++ b/corosync.spec @@ -2,7 +2,7 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.1.1 +Version: 1.1.2 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base @@ -208,6 +208,9 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/coroipc_overview.8* %changelog +* Fri Oct 23 2009 Fabio M. Di Nitto - 1.1.2-1 +- New upstream release fixes major regression on specific loads + * Wed Oct 21 2009 Fabio M. Di Nitto - 1.1.1-1 - New upstream release diff --git a/sources b/sources index fffa0ae..48ee40f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -148c0690d4734bae819504534d6decbe corosync-1.1.1.tar.gz +03ea8d775b2855fd3c0a1ed5e7705a86 corosync-1.1.2.tar.gz From 63ece51c7bbc0f34370ea476eded267f32a13902 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:33:14 +0000 Subject: [PATCH 04/12] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f9d9b66..030097c 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ NAME := corosync SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From d5420dd95752e8ccfc6eb81e2d82d145692fea2f Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 8 Dec 2009 01:46:33 +0000 Subject: [PATCH 05/12] New upstream release, fixes a few gazzillion bugs --- .cvsignore | 2 +- corosync.spec | 43 +++++++++++++++++++++++++++++-------------- sources | 2 +- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.cvsignore b/.cvsignore index 77e627c..215bc9c 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.1.2.tar.gz +corosync-1.2.0.tar.gz diff --git a/corosync.spec b/corosync.spec index d9394d0..005d1b6 100644 --- a/corosync.spec +++ b/corosync.spec @@ -1,13 +1,13 @@ -# define alphatag svn1211 +# global alphatag svn1211 Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.1.2 +Version: 1.2.0 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base URL: http://www.openais.org -Source0: http://developer.osdl.org/dev/openais/downloads/corosync-%{version}/corosync-%{version}.tar.gz +Source0: http://developer.osdl.org/dev/openais/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz # Runtime bits Requires: corosynclib = %{version}-%{release} @@ -16,8 +16,9 @@ Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Conflicts: openais <= 0.89, openais-devel <= 0.89 +# Build bits + %define buildtrunk 0 -%{?alphatag: %define buildtrunk 1} %{?_with_buildtrunk: %define buildtrunk 1} %if %{buildtrunk} @@ -29,7 +30,7 @@ BuildRequires: libibverbs-devel librdmacm-devel BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep -%setup -q -n corosync-%{version} +%setup -q -n %{name}-%{version} %if %{buildtrunk} ./autogen.sh @@ -41,7 +42,8 @@ export rdmacm_CFLAGS=-I/usr/include/rdma \ export rdmacm_LIBS=-lrdmacm \ %{configure} \ --enable-nss \ - --enable-rdma + --enable-rdma \ + --with-initddir=%{_initddir} %build make %{_smp_mflags} @@ -50,8 +52,6 @@ make %{_smp_mflags} rm -rf %{buildroot} make install DESTDIR=%{buildroot} -install -d %{buildroot}%{_initddir} -install -m 755 init/redhat %{buildroot}%{_initddir}/corosync ## tree fixup # drop static libs @@ -62,7 +62,7 @@ rm -rf %{buildroot}%{_docdir}/* %clean rm -rf %{buildroot} -%description +%description This package contains the Corosync Cluster Engine Executive, several default APIs and libraries, default configuration files, and an init script. @@ -75,10 +75,7 @@ if [ $1 -eq 0 ]; then /sbin/chkconfig --del corosync || : fi -%postun -[ "$1" -ge "1" ] && /sbin/service corosync condrestart &>/dev/null || : - -%files +%files %defattr(-,root,root,-) %doc LICENSE SECURITY %{_sbindir}/corosync @@ -90,6 +87,7 @@ fi %{_sbindir}/corosync-cpgtool %{_sbindir}/corosync-quorumtool %dir %{_sysconfdir}/corosync +%dir %{_sysconfdir}/corosync/service.d %dir %{_sysconfdir}/corosync/uidgid.d %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example %{_initddir}/corosync @@ -113,7 +111,7 @@ fi %package -n corosynclib Summary: The Corosync Cluster Engine Libraries Group: System Environment/Libraries -Conflicts: corosync < 0.92-7 +Requires: %{name} = %{version}-%{release} %description -n corosynclib This package contains corosync libraries. @@ -132,6 +130,7 @@ This package contains corosync libraries. %{_libdir}/libquorum.so.* %{_libdir}/libvotequorum.so.* %{_libdir}/libpload.so.* +%{_libdir}/libsam.so.* %post -n corosynclib -p /sbin/ldconfig @@ -166,6 +165,7 @@ The Corosync Cluster Engine APIs. %{_includedir}/corosync/hdb.h %{_includedir}/corosync/list.h %{_includedir}/corosync/mar_gen.h +%{_includedir}/corosync/sam.h %{_includedir}/corosync/swab.h %{_includedir}/corosync/quorum.h %{_includedir}/corosync/votequorum.h @@ -195,19 +195,34 @@ The Corosync Cluster Engine APIs. %{_libdir}/libquorum.so %{_libdir}/libvotequorum.so %{_libdir}/libpload.so +%{_libdir}/libsam.so %{_libdir}/pkgconfig/*.pc %{_mandir}/man3/cpg_*3* %{_mandir}/man3/evs_*3* %{_mandir}/man3/confdb_*3* %{_mandir}/man3/votequorum_*3* +%{_mandir}/man3/sam_*3* %{_mandir}/man8/cpg_overview.8* %{_mandir}/man8/evs_overview.8* %{_mandir}/man8/confdb_overview.8* %{_mandir}/man8/logsys_overview.8* %{_mandir}/man8/votequorum_overview.8* %{_mandir}/man8/coroipc_overview.8* +%{_mandir}/man8/sam_overview.8* %changelog +* Tue Dec 8 2009 Fabio M. Di Nitto - 1.2.0-1 +- New upstream release +- Use global instead of define +- Update Source0 url +- Use more %name macro around +- Cleanup install section. Init script is now installed by upstream +- Cleanup whitespace +- Don't deadlock between package upgrade and corosync condrestart +- Ship service.d config directory +- Fix Conflicts vs Requires +- Ship new sam library and man pages + * Fri Oct 23 2009 Fabio M. Di Nitto - 1.1.2-1 - New upstream release fixes major regression on specific loads diff --git a/sources b/sources index 48ee40f..ead7229 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -03ea8d775b2855fd3c0a1ed5e7705a86 corosync-1.1.2.tar.gz +789bea831a97977e56900477c3022cc1 corosync-1.2.0.tar.gz From 0b09a0ee482e6d288ce15bfe03e88915755d8f33 Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Wed, 17 Feb 2010 01:06:10 +0000 Subject: [PATCH 06/12] Initialize branch F-13 for corosync --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..baa94ef --- /dev/null +++ b/branch @@ -0,0 +1 @@ +F-13 From 9810953e312e09ad45f7114981460b658050d679 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Mon, 12 Apr 2010 03:29:01 +0000 Subject: [PATCH 07/12] New upstream release --- .cvsignore | 2 +- corosync.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cvsignore b/.cvsignore index 215bc9c..6e836fb 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.2.0.tar.gz +corosync-1.2.1.tar.gz diff --git a/corosync.spec b/corosync.spec index 005d1b6..6d35e18 100644 --- a/corosync.spec +++ b/corosync.spec @@ -2,7 +2,7 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.2.0 +Version: 1.2.1 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base @@ -211,6 +211,9 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/sam_overview.8* %changelog +* Wed Mar 24 2010 Fabio M. Di Nitto - 1.2.1-1 +- New upstream release + * Tue Dec 8 2009 Fabio M. Di Nitto - 1.2.0-1 - New upstream release - Use global instead of define diff --git a/sources b/sources index ead7229..9f490cb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -789bea831a97977e56900477c3022cc1 corosync-1.2.0.tar.gz +cba5eb5da41630f53e54b90c449c056d corosync-1.2.1.tar.gz From e8f42a997c4c1cb10e2e1a4b520c446f648dc6a4 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Mon, 12 Apr 2010 03:35:52 +0000 Subject: [PATCH 08/12] New upstream release --- .cvsignore | 2 +- corosync.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.cvsignore b/.cvsignore index 215bc9c..6e836fb 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.2.0.tar.gz +corosync-1.2.1.tar.gz diff --git a/corosync.spec b/corosync.spec index 005d1b6..6d35e18 100644 --- a/corosync.spec +++ b/corosync.spec @@ -2,7 +2,7 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.2.0 +Version: 1.2.1 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base @@ -211,6 +211,9 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/sam_overview.8* %changelog +* Wed Mar 24 2010 Fabio M. Di Nitto - 1.2.1-1 +- New upstream release + * Tue Dec 8 2009 Fabio M. Di Nitto - 1.2.0-1 - New upstream release - Use global instead of define diff --git a/sources b/sources index ead7229..9f490cb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -789bea831a97977e56900477c3022cc1 corosync-1.2.0.tar.gz +cba5eb5da41630f53e54b90c449c056d corosync-1.2.1.tar.gz From 06b128de46fc2b06d42ed0872eae8d656d082097 Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 25 May 2010 07:57:03 +0000 Subject: [PATCH 09/12] New upstream release --- .cvsignore | 2 +- corosync.spec | 19 +- revision-2770.patch | 811 ++++++++++++++++++++++++++++++++++++++++++++ sources | 2 +- 4 files changed, 829 insertions(+), 5 deletions(-) create mode 100644 revision-2770.patch diff --git a/.cvsignore b/.cvsignore index 6e836fb..4c48ceb 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.2.1.tar.gz +corosync-1.2.3.tar.gz diff --git a/corosync.spec b/corosync.spec index 6d35e18..8ff4113 100644 --- a/corosync.spec +++ b/corosync.spec @@ -2,12 +2,13 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.2.1 +Version: 1.2.3 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base -URL: http://www.openais.org -Source0: http://developer.osdl.org/dev/openais/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz +URL: http://ftp.corosync.org +Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz +Patch0: revision-2770.patch # Runtime bits Requires: corosynclib = %{version}-%{release} @@ -24,6 +25,7 @@ Conflicts: openais <= 0.89, openais-devel <= 0.89 %if %{buildtrunk} BuildRequires: autoconf automake %endif + BuildRequires: nss-devel BuildRequires: libibverbs-devel librdmacm-devel @@ -31,6 +33,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep %setup -q -n %{name}-%{version} +%patch0 %if %{buildtrunk} ./autogen.sh @@ -211,6 +214,16 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/sam_overview.8* %changelog +* Tue May 25 2010 Fabio M. Di Nitto - 1.2.3-1 +- New upstream release +- Rediff revision 2770 patch + +* Mon May 17 2010 Fabio M. Di Nitto - 1.2.2-1 +- New upstream release +- Add upstream trunk revision 2770 to add cpg_model_initialize api. +- Fix URL and Source0 entries. +- Add workaround to broken 1.2.2 Makefile with make -j. + * Wed Mar 24 2010 Fabio M. Di Nitto - 1.2.1-1 - New upstream release diff --git a/revision-2770.patch b/revision-2770.patch new file mode 100644 index 0000000..766c980 --- /dev/null +++ b/revision-2770.patch @@ -0,0 +1,811 @@ +Index: include/corosync/ipc_cpg.h +=================================================================== +--- include/corosync/ipc_cpg.h (revision 2769) ++++ include/corosync/ipc_cpg.h (revision 2770) +@@ -65,6 +65,7 @@ + MESSAGE_RES_CPG_ITERATIONNEXT = 10, + MESSAGE_RES_CPG_ITERATIONFINALIZE = 11, + MESSAGE_RES_CPG_FINALIZE = 12, ++ MESSAGE_RES_CPG_TOTEM_CONFCHG_CALLBACK = 13, + }; + + enum lib_cpg_confchg_reason { +@@ -149,10 +150,24 @@ + marshall_from_mar_cpg_name_t (&dest->group, &src->group); + }; + ++typedef struct { ++ mar_uint32_t nodeid __attribute__((aligned(8))); ++ mar_uint64_t seq __attribute__((aligned(8))); ++} mar_cpg_ring_id_t; ++ ++static inline void marshall_from_mar_cpg_ring_id_t ( ++ struct cpg_ring_id *dest, ++ const mar_cpg_ring_id_t *src) ++{ ++ dest->nodeid = src->nodeid; ++ dest->seq = src->seq; ++} ++ + struct req_lib_cpg_join { + coroipc_request_header_t header __attribute__((aligned(8))); + mar_cpg_name_t group_name __attribute__((aligned(8))); + mar_uint32_t pid __attribute__((aligned(8))); ++ mar_uint32_t flags __attribute__((aligned(8))); + }; + + struct res_lib_cpg_join { +@@ -238,6 +253,13 @@ + // struct cpg_address joined_list[]; + }; + ++struct res_lib_cpg_totem_confchg_callback { ++ coroipc_response_header_t header __attribute__((aligned(8))); ++ mar_cpg_ring_id_t ring_id __attribute__((aligned(8))); ++ mar_uint32_t member_list_entries __attribute__((aligned(8))); ++ mar_uint32_t member_list[]; ++}; ++ + struct req_lib_cpg_leave { + coroipc_request_header_t header __attribute__((aligned(8))); + mar_cpg_name_t group_name __attribute__((aligned(8))); +Index: include/corosync/cpg.h +=================================================================== +--- include/corosync/cpg.h (revision 2769) ++++ include/corosync/cpg.h (revision 2770) +@@ -78,6 +78,10 @@ + CPG_ITERATION_ALL = 3, + } cpg_iteration_type_t; + ++typedef enum { ++ CPG_MODEL_V1 = 1, ++} cpg_model_t; ++ + struct cpg_address { + uint32_t nodeid; + uint32_t pid; +@@ -98,6 +102,11 @@ + uint32_t pid; + }; + ++struct cpg_ring_id { ++ uint32_t nodeid; ++ uint64_t seq; ++}; ++ + typedef void (*cpg_deliver_fn_t) ( + cpg_handle_t handle, + const struct cpg_name *group_name, +@@ -117,11 +126,32 @@ + const struct cpg_address *left_list, size_t left_list_entries, + const struct cpg_address *joined_list, size_t joined_list_entries); + ++typedef void (*cpg_totem_confchg_fn_t) ( ++ cpg_handle_t handle, ++ struct cpg_ring_id ring_id, ++ uint32_t member_list_entries, ++ const uint32_t *member_list); ++ + typedef struct { + cpg_deliver_fn_t cpg_deliver_fn; + cpg_confchg_fn_t cpg_confchg_fn; + } cpg_callbacks_t; + ++typedef struct { ++ cpg_model_t model; ++} cpg_model_data_t; ++ ++#define CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF 0x01 ++ ++typedef struct { ++ cpg_model_t model; ++ cpg_deliver_fn_t cpg_deliver_fn; ++ cpg_confchg_fn_t cpg_confchg_fn; ++ cpg_totem_confchg_fn_t cpg_totem_confchg_fn; ++ unsigned int flags; ++} cpg_model_v1_data_t; ++ ++ + /** @} */ + + /* +@@ -132,6 +162,15 @@ + cpg_callbacks_t *callbacks); + + /* ++ * Create a new cpg connection, initialize with model ++ */ ++cs_error_t cpg_model_initialize ( ++ cpg_handle_t *handle, ++ cpg_model_t model, ++ cpg_model_data_t *model_data, ++ void *context); ++ ++/* + * Close the cpg handle + */ + cs_error_t cpg_finalize ( +Index: services/cpg.c +=================================================================== +--- services/cpg.c (revision 2769) ++++ services/cpg.c (revision 2770) +@@ -133,6 +133,8 @@ + mar_cpg_name_t group_name; + uint32_t pid; + enum cpd_state cpd_state; ++ unsigned int flags; ++ int initial_totem_conf_sent; + struct list_head list; + struct list_head iteration_instance_list_head; + }; +@@ -160,6 +162,8 @@ + + static enum cpg_sync_state my_sync_state = CPGSYNC_DOWNLIST; + ++static mar_cpg_ring_id_t last_sync_ring_id; ++ + struct process_info { + unsigned int nodeid; + uint32_t pid; +@@ -255,6 +259,11 @@ + + static void cpg_sync_abort (void); + ++static int notify_lib_totem_membership ( ++ void *conn, ++ int member_list_entries, ++ const unsigned int *member_list); ++ + /* + * Library Handler Definition + */ +@@ -432,6 +441,9 @@ + sizeof (unsigned int)); + my_member_list_entries = member_list_entries; + ++ last_sync_ring_id.nodeid = ring_id->rep.nodeid; ++ last_sync_ring_id.seq = ring_id->seq; ++ + for (i = 0; i < my_member_list_entries; i++) { + if (my_member_list[i] < lowest_nodeid) { + lowest_nodeid = my_member_list[i]; +@@ -482,14 +494,51 @@ + memcpy (my_old_member_list, my_member_list, + my_member_list_entries * sizeof (unsigned int)); + my_old_member_list_entries = my_member_list_entries; ++ ++ notify_lib_totem_membership (NULL, my_member_list_entries, my_member_list); + } + + static void cpg_sync_abort (void) + { + } + ++static int notify_lib_totem_membership ( ++ void *conn, ++ int member_list_entries, ++ const unsigned int *member_list) ++{ ++ struct list_head *iter; ++ char *buf; ++ int size; ++ struct res_lib_cpg_totem_confchg_callback *res; + ++ size = sizeof(struct res_lib_cpg_totem_confchg_callback) + ++ sizeof(mar_uint32_t) * (member_list_entries); ++ buf = alloca(size); ++ if (!buf) ++ return CPG_ERR_LIBRARY; + ++ res = (struct res_lib_cpg_totem_confchg_callback *)buf; ++ res->member_list_entries = member_list_entries; ++ res->header.size = size; ++ res->header.id = MESSAGE_RES_CPG_TOTEM_CONFCHG_CALLBACK; ++ res->header.error = CS_OK; ++ ++ memcpy (&res->ring_id, &last_sync_ring_id, sizeof (mar_cpg_ring_id_t)); ++ memcpy (res->member_list, member_list, res->member_list_entries * sizeof (mar_uint32_t)); ++ ++ if (conn == NULL) { ++ for (iter = cpg_pd_list_head.next; iter != &cpg_pd_list_head; iter = iter->next) { ++ struct cpg_pd *cpg_pd = list_entry (iter, struct cpg_pd, list); ++ api->ipc_dispatch_send (cpg_pd->conn, buf, size); ++ } ++ } else { ++ api->ipc_dispatch_send (conn, buf, size); ++ } ++ ++ return CPG_OK; ++} ++ + static int notify_lib_joinlist( + const mar_cpg_name_t *group_name, + void *conn, +@@ -604,6 +653,20 @@ + } + } + ++ ++ /* ++ * Traverse thru cpds and send totem membership for cpd, where it is not send yet ++ */ ++ for (iter = cpg_pd_list_head.next; iter != &cpg_pd_list_head; iter = iter->next) { ++ struct cpg_pd *cpd = list_entry (iter, struct cpg_pd, list); ++ ++ if ((cpd->flags & CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF) && (cpd->initial_totem_conf_sent == 0)) { ++ cpd->initial_totem_conf_sent = 1; ++ ++ notify_lib_totem_membership (cpd->conn, my_old_member_list_entries, my_old_member_list); ++ } ++ } ++ + return CPG_OK; + } + +@@ -1093,6 +1156,7 @@ + error = CPG_OK; + cpd->cpd_state = CPD_STATE_JOIN_STARTED; + cpd->pid = req_lib_cpg_join->pid; ++ cpd->flags = req_lib_cpg_join->flags; + memcpy (&cpd->group_name, &req_lib_cpg_join->group_name, + sizeof (cpd->group_name)); + +Index: lib/cpg.c +=================================================================== +--- lib/cpg.c (revision 2769) ++++ lib/cpg.c (revision 2770) +@@ -62,8 +62,11 @@ + struct cpg_inst { + hdb_handle_t handle; + int finalize; +- cpg_callbacks_t callbacks; + void *context; ++ union { ++ cpg_model_data_t model_data; ++ cpg_model_v1_data_t model_v1_data; ++ }; + struct list_head iteration_list_head; + }; + +@@ -118,9 +121,32 @@ + cpg_handle_t *handle, + cpg_callbacks_t *callbacks) + { ++ cpg_model_v1_data_t model_v1_data; ++ ++ memset (&model_v1_data, 0, sizeof (cpg_model_v1_data_t)); ++ ++ if (callbacks) { ++ model_v1_data.cpg_deliver_fn = callbacks->cpg_deliver_fn; ++ model_v1_data.cpg_confchg_fn = callbacks->cpg_confchg_fn; ++ } ++ ++ return (cpg_model_initialize (handle, CPG_MODEL_V1, (cpg_model_data_t *)&model_v1_data, NULL)); ++} ++ ++cs_error_t cpg_model_initialize ( ++ cpg_handle_t *handle, ++ cpg_model_t model, ++ cpg_model_data_t *model_data, ++ void *context) ++{ + cs_error_t error; + struct cpg_inst *cpg_inst; + ++ if (model != CPG_MODEL_V1) { ++ error = CPG_ERR_INVALID_PARAM; ++ goto error_no_destroy; ++ } ++ + error = hdb_error_to_cs (hdb_handle_create (&cpg_handle_t_db, sizeof (struct cpg_inst), handle)); + if (error != CS_OK) { + goto error_no_destroy; +@@ -142,10 +168,26 @@ + goto error_put_destroy; + } + +- if (callbacks) { +- memcpy (&cpg_inst->callbacks, callbacks, sizeof (cpg_callbacks_t)); ++ if (model_data != NULL) { ++ switch (model) { ++ case CPG_MODEL_V1: ++ memcpy (&cpg_inst->model_v1_data, model_data, sizeof (cpg_model_v1_data_t)); ++ if ((cpg_inst->model_v1_data.flags & ~(CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF)) != 0) { ++ error = CS_ERR_INVALID_PARAM; ++ ++ goto error_destroy; ++ } ++ break; ++ default: ++ error = CS_ERR_LIBRARY; ++ goto error_destroy; ++ break; ++ } + } + ++ cpg_inst->model_data.model = model; ++ cpg_inst->context = context; ++ + list_init(&cpg_inst->iteration_list_head); + + hdb_handle_put (&cpg_handle_t_db, *handle); +@@ -283,7 +325,8 @@ + struct cpg_inst *cpg_inst; + struct res_lib_cpg_confchg_callback *res_cpg_confchg_callback; + struct res_lib_cpg_deliver_callback *res_cpg_deliver_callback; +- cpg_callbacks_t callbacks; ++ struct res_lib_cpg_totem_confchg_callback *res_cpg_totem_confchg_callback; ++ struct cpg_inst cpg_inst_copy; + coroipc_response_header_t *dispatch_data; + struct cpg_address member_list[CPG_MEMBERS_MAX]; + struct cpg_address left_list[CPG_MEMBERS_MAX]; +@@ -292,6 +335,8 @@ + mar_cpg_address_t *left_list_start; + mar_cpg_address_t *joined_list_start; + unsigned int i; ++ struct cpg_ring_id ring_id; ++ uint32_t totem_member_list[CPG_MEMBERS_MAX]; + + error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst)); + if (error != CS_OK) { +@@ -332,74 +377,96 @@ + * A risk of this dispatch method is that the callback routines may + * operate at the same time that cpgFinalize has been called. + */ +- memcpy (&callbacks, &cpg_inst->callbacks, sizeof (cpg_callbacks_t)); +- /* +- * Dispatch incoming message +- */ +- switch (dispatch_data->id) { +- case MESSAGE_RES_CPG_DELIVER_CALLBACK: +- if (callbacks.cpg_deliver_fn == NULL) { ++ memcpy (&cpg_inst_copy, cpg_inst, sizeof (struct cpg_inst)); ++ ++ switch (cpg_inst_copy.model_data.model) { ++ case CPG_MODEL_V1: ++ /* ++ * Dispatch incoming message ++ */ ++ switch (dispatch_data->id) { ++ case MESSAGE_RES_CPG_DELIVER_CALLBACK: ++ if (cpg_inst_copy.model_v1_data.cpg_deliver_fn == NULL) { ++ break; ++ } ++ ++ res_cpg_deliver_callback = (struct res_lib_cpg_deliver_callback *)dispatch_data; ++ ++ marshall_from_mar_cpg_name_t ( ++ &group_name, ++ &res_cpg_deliver_callback->group_name); ++ ++ cpg_inst_copy.model_v1_data.cpg_deliver_fn (handle, ++ &group_name, ++ res_cpg_deliver_callback->nodeid, ++ res_cpg_deliver_callback->pid, ++ &res_cpg_deliver_callback->message, ++ res_cpg_deliver_callback->msglen); + break; +- } + +- res_cpg_deliver_callback = (struct res_lib_cpg_deliver_callback *)dispatch_data; ++ case MESSAGE_RES_CPG_CONFCHG_CALLBACK: ++ if (cpg_inst_copy.model_v1_data.cpg_confchg_fn == NULL) { ++ break; ++ } + +- marshall_from_mar_cpg_name_t ( +- &group_name, +- &res_cpg_deliver_callback->group_name); ++ res_cpg_confchg_callback = (struct res_lib_cpg_confchg_callback *)dispatch_data; + +- callbacks.cpg_deliver_fn (handle, +- &group_name, +- res_cpg_deliver_callback->nodeid, +- res_cpg_deliver_callback->pid, +- &res_cpg_deliver_callback->message, +- res_cpg_deliver_callback->msglen); +- break; ++ for (i = 0; i < res_cpg_confchg_callback->member_list_entries; i++) { ++ marshall_from_mar_cpg_address_t (&member_list[i], ++ &res_cpg_confchg_callback->member_list[i]); ++ } ++ left_list_start = res_cpg_confchg_callback->member_list + ++ res_cpg_confchg_callback->member_list_entries; ++ for (i = 0; i < res_cpg_confchg_callback->left_list_entries; i++) { ++ marshall_from_mar_cpg_address_t (&left_list[i], ++ &left_list_start[i]); ++ } ++ joined_list_start = res_cpg_confchg_callback->member_list + ++ res_cpg_confchg_callback->member_list_entries + ++ res_cpg_confchg_callback->left_list_entries; ++ for (i = 0; i < res_cpg_confchg_callback->joined_list_entries; i++) { ++ marshall_from_mar_cpg_address_t (&joined_list[i], ++ &joined_list_start[i]); ++ } ++ marshall_from_mar_cpg_name_t ( ++ &group_name, ++ &res_cpg_confchg_callback->group_name); + +- case MESSAGE_RES_CPG_CONFCHG_CALLBACK: +- if (callbacks.cpg_confchg_fn == NULL) { ++ cpg_inst_copy.model_v1_data.cpg_confchg_fn (handle, ++ &group_name, ++ member_list, ++ res_cpg_confchg_callback->member_list_entries, ++ left_list, ++ res_cpg_confchg_callback->left_list_entries, ++ joined_list, ++ res_cpg_confchg_callback->joined_list_entries); ++ + break; +- } ++ case MESSAGE_RES_CPG_TOTEM_CONFCHG_CALLBACK: ++ if (cpg_inst_copy.model_v1_data.cpg_totem_confchg_fn == NULL) { ++ break; ++ } + +- res_cpg_confchg_callback = (struct res_lib_cpg_confchg_callback *)dispatch_data; ++ res_cpg_totem_confchg_callback = (struct res_lib_cpg_totem_confchg_callback *)dispatch_data; + +- for (i = 0; i < res_cpg_confchg_callback->member_list_entries; i++) { +- marshall_from_mar_cpg_address_t (&member_list[i], +- &res_cpg_confchg_callback->member_list[i]); +- } +- left_list_start = res_cpg_confchg_callback->member_list + +- res_cpg_confchg_callback->member_list_entries; +- for (i = 0; i < res_cpg_confchg_callback->left_list_entries; i++) { +- marshall_from_mar_cpg_address_t (&left_list[i], +- &left_list_start[i]); +- } +- joined_list_start = res_cpg_confchg_callback->member_list + +- res_cpg_confchg_callback->member_list_entries + +- res_cpg_confchg_callback->left_list_entries; +- for (i = 0; i < res_cpg_confchg_callback->joined_list_entries; i++) { +- marshall_from_mar_cpg_address_t (&joined_list[i], +- &joined_list_start[i]); +- } +- marshall_from_mar_cpg_name_t ( +- &group_name, +- &res_cpg_confchg_callback->group_name); ++ marshall_from_mar_cpg_ring_id_t (&ring_id, &res_cpg_totem_confchg_callback->ring_id); ++ for (i = 0; i < res_cpg_totem_confchg_callback->member_list_entries; i++) { ++ totem_member_list[i] = res_cpg_totem_confchg_callback->member_list[i]; ++ } + +- callbacks.cpg_confchg_fn (handle, +- &group_name, +- member_list, +- res_cpg_confchg_callback->member_list_entries, +- left_list, +- res_cpg_confchg_callback->left_list_entries, +- joined_list, +- res_cpg_confchg_callback->joined_list_entries); +- break; +- +- default: +- coroipcc_dispatch_put (cpg_inst->handle); +- error = CS_ERR_LIBRARY; +- goto error_put; +- break; +- } ++ cpg_inst_copy.model_v1_data.cpg_totem_confchg_fn (handle, ++ ring_id, ++ res_cpg_totem_confchg_callback->member_list_entries, ++ totem_member_list); ++ break; ++ default: ++ coroipcc_dispatch_put (cpg_inst->handle); ++ error = CS_ERR_LIBRARY; ++ goto error_put; ++ break; ++ } /* - switch (dispatch_data->id) */ ++ break; /* case CPG_MODEL_V1 */ ++ } /* - switch (cpg_inst_copy.model_data.model) */ + coroipcc_dispatch_put (cpg_inst->handle); + + /* +@@ -434,6 +501,14 @@ + req_lib_cpg_join.header.size = sizeof (struct req_lib_cpg_join); + req_lib_cpg_join.header.id = MESSAGE_REQ_CPG_JOIN; + req_lib_cpg_join.pid = getpid(); ++ req_lib_cpg_join.flags = 0; ++ ++ switch (cpg_inst->model_data.model) { ++ case CPG_MODEL_V1: ++ req_lib_cpg_join.flags = cpg_inst->model_v1_data.flags; ++ break; ++ } ++ + marshall_to_mar_cpg_name_t (&req_lib_cpg_join.group_name, + group); + +Index: lib/libcpg.verso +=================================================================== +--- lib/libcpg.verso (revision 2769) ++++ lib/libcpg.verso (revision 2770) +@@ -1 +1 @@ +-4.0.1 ++4.1.0 +Index: man/cpg_initialize.3 +=================================================================== +--- man/cpg_initialize.3 (revision 2769) ++++ man/cpg_initialize.3 (revision 2770) +@@ -41,7 +41,10 @@ + .SH DESCRIPTION + The + .B cpg_initialize +-function is used to initialize a connection to the closed process groups API. ++function is used to initialize a connection to the closed process groups API. This function is deprecated ++and ++.B cpg_model_initialize ++should be used in newly written code. + .PP + Each application may have several connections to the CPG API. Each application + uses the +@@ -167,5 +170,6 @@ + .BR cpg_context_get (3) + .BR cpg_context_set (3) + .BR cpg_local_get (3) ++.BR cpg_model_initialize (3) + + .PP +Index: man/cpg_overview.8 +=================================================================== +--- man/cpg_overview.8 (revision 2769) ++++ man/cpg_overview.8 (revision 2770) +@@ -61,6 +61,7 @@ + .BR cpg_join (3), + .BR cpg_leave (3), + .BR cpg_mcast_joined (3), ++.BR cpg_model_initialize (3), + .BR cpg_membership_get (3) + .BR cpg_zcb_alloc (3) + .BR cpg_zcb_free (3) +Index: man/cpg_model_initialize.3 +=================================================================== +--- man/cpg_model_initialize.3 (revision 0) ++++ man/cpg_model_initialize.3 (revision 2770) +@@ -0,0 +1,231 @@ ++.\"/* ++.\" * Copyright (c) 2010 Red Hat, Inc. ++.\" * ++.\" * All rights reserved. ++.\" * ++.\" * Author: Jan Friesse ++.\" * Author: Christine Caulfield ++.\" * ++.\" * This software licensed under BSD license, the text of which follows: ++.\" * ++.\" * Redistribution and use in source and binary forms, with or without ++.\" * modification, are permitted provided that the following conditions are met: ++.\" * ++.\" * - Redistributions of source code must retain the above copyright notice, ++.\" * this list of conditions and the following disclaimer. ++.\" * - Redistributions in binary form must reproduce the above copyright notice, ++.\" * this list of conditions and the following disclaimer in the documentation ++.\" * and/or other materials provided with the distribution. ++.\" * - Neither the name of the MontaVista Software, Inc. nor the names of its ++.\" * contributors may be used to endorse or promote products derived from this ++.\" * software without specific prior written permission. ++.\" * ++.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ++.\" * THE POSSIBILITY OF SUCH DAMAGE. ++.\" */ ++.TH CPG_MODEL_INITIALIZE 3 2010-04-07 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual" ++.SH NAME ++cpg_model_initialize \- Create a new connection to the CPG service ++.SH SYNOPSIS ++.B #include ++.sp ++.BI "cs_error_t cpg_model_initialize(cpg_handle_t *" handle ", cpg_model_t " model ", cpg_model_data_t *" model_data ", void *" context "); ++ ++.SH DESCRIPTION ++The ++.B cpg_model_initialize ++function is used to initialize a connection to the closed process groups API. ++.PP ++Each application may have several connections to the CPG API. Each application ++uses the ++.I handle ++argument to uniquely identify the connection. The ++.I handle ++argument is then used in other function calls to identify the connection to be used ++for communication with the CPG service. ++.PP ++Argument ++.I model ++is used to explicitly choose set of callbacks and internal parameters. Currently only model ++.I CPG_MODEL_V1 ++is defined. ++.PP ++Callbacks and internal parameters are passed by ++.I model_data ++argument. This is casted pointer (idea is similar as in sockaddr function) to one of structures ++corresponding to chosen model. Currently only ++.I cpg_model_v1_data_t ++is needed. ++.SH MODEL_V1 ++The ++.I MODEL_V1 ++is backwards compatible with original callbacks initialized by ++.I cpg_initialize ++but new callback ++.I cpg_totem_confchg_fn ++is defined. ++.PP ++Every time an CPG event occurs within the joined group, one of the callbacks specified by the argument ++.I callbacks ++is called. The callback functions are described by the following type definitions: ++.PP ++.PP ++.IP ++.RS ++.ne 18 ++.nf ++.ta 4n 20n 32n ++ ++typedef void (*cpg_deliver_fn_t) ( ++ cpg_handle_t handle, ++ const struct cpg_name *group_name, ++ uint32_t nodeid, ++ uint32_t pid, ++ const void *msg, ++ size_t msg_len); ++ ++ ++typedef void (*cpg_confchg_fn_t) ( ++ cpg_handle_t handle, ++ const struct cpg_name *group_name, ++ const struct cpg_address *member_list, size_t member_list_entries, ++ const struct cpg_address *left_list, size_t left_list_entries, ++ const struct cpg_address *joined_list, size_t joined_list_entries); ++ ++ ++typedef void (*cpg_totem_confchg_fn_t) ( ++ cpg_handle_t handle, ++ struct cpg_ring_id ring_id, ++ uint32_t member_list_entries, ++ const uint32_t *member_list); ++.ta ++.fi ++.RE ++.IP ++.PP ++.PP ++The ++.I cpg_model_v1_data_t ++structure is defined as: ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++typedef struct { ++ cpg_model_t model; ++ cpg_deliver_fn_t cpg_deliver_fn; ++ cpg_confchg_fn_t cpg_confchg_fn; ++ cpg_totem_confchg_fn_t cpg_totem_confchg_fn; ++ unsigned int flags; ++} cpg_model_v1_data_t; ++.ta ++.fi ++.RE ++.IP ++.PP ++When a configuration change occurs or a message is to be delivered one of the callbacks ++is called from the ++.B cpg_dispatch() ++function. If a configuration change occurs, ++.I cpg_confchg_fn ++is called. If a delivery of a message occurs, ++.I cpg_deliver_fn ++is called. ++When totem membership change occurs, ++.I cpg_totem_confchg_fn ++is called. You can OR ++.I CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF ++constant to flags to get callback after first confchg event. ++ ++The ++.I cpg_address ++structure is defined ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++struct cpg_address { ++ unsigned int nodeid; ++ unsigned int pid; ++ unsigned int reason; ++}; ++.ta ++.fi ++.RE ++.IP ++.PP ++where nodeid is a 32 bit unique node identifier, pid is the process ID of the process that has joined/left the group ++or sent the message, and reason is an integer code indicating why the node joined/left the group. ++.PP ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++CPG_REASON_JOIN - the process joined a group using cpg_join(). ++CPG_REASON_LEAVE - the process left a group using cpg_leave() ++CPG_REASON_NODEDOWN - the process left a group because the node left the cluster. ++CPG_REASON_NODEUP - the process joined a group because it was already a member of a group on a node that has just joined the cluster ++CPG_REASON_PROCDOWN - the process left a group without calling cpg_leave() ++.ta ++.fi ++.RE ++.IP ++.PP ++The ++.I cpg_ring_id ++structure is defined ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++struct cpg_ring_id { ++ uint32_t nodeid; ++ uint64_t seq; ++}; ++.ta ++.fi ++.RE ++.IP ++.PP ++where ++.I nodeid ++is if of node of current Totem leader and seq is increasing number. ++ ++.PP ++.SH RETURN VALUE ++This call returns the CPG_OK value if successful, otherwise an error is returned. ++.PP ++.SH ERRORS ++The errors are undocumented. ++.SH "SEE ALSO" ++.BR cpg_overview (8), ++.BR cpg_initialize (3), ++.BR cpg_finalize (3), ++.BR cpg_fd_get (3), ++.BR cpg_dispatch (3), ++.BR cpg_join (3), ++.BR cpg_leave (3), ++.BR cpg_mcast_joined (3), ++.BR cpg_membership_get (3) ++.BR cpg_zcb_alloc (3) ++.BR cpg_zcb_free (3) ++.BR cpg_zcb_mcast_joined (3) ++.BR cpg_context_get (3) ++.BR cpg_context_set (3) ++.BR cpg_local_get (3) ++.BR cpg_model_initialize (3) ++ ++.PP +Index: man/Makefile.am +=================================================================== +--- man/Makefile.am (revision 2769) ++++ man/Makefile.am (revision 2770) +@@ -71,6 +71,7 @@ + cpg_leave.3 \ + cpg_local_get.3 \ + cpg_mcast_joined.3 \ ++ cpg_model_initialize.3 \ + cpg_zcb_mcast_joined.3 \ + cpg_zcb_alloc.3 \ + cpg_zcb_free.3 \ diff --git a/sources b/sources index 9f490cb..e99be3c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -cba5eb5da41630f53e54b90c449c056d corosync-1.2.1.tar.gz +03b8cc311619c07ae1a84a5d59f13d0b corosync-1.2.3.tar.gz From 3afd892ecacb6fd33f38a24ab7870c6e77a1a5cc Mon Sep 17 00:00:00 2001 From: "Fabio M. Di Nitto" Date: Tue, 25 May 2010 07:58:10 +0000 Subject: [PATCH 10/12] New upstream release --- .cvsignore | 2 +- corosync.spec | 19 +- revision-2770.patch | 811 ++++++++++++++++++++++++++++++++++++++++++++ sources | 2 +- 4 files changed, 829 insertions(+), 5 deletions(-) create mode 100644 revision-2770.patch diff --git a/.cvsignore b/.cvsignore index 6e836fb..4c48ceb 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -corosync-1.2.1.tar.gz +corosync-1.2.3.tar.gz diff --git a/corosync.spec b/corosync.spec index 6d35e18..8ff4113 100644 --- a/corosync.spec +++ b/corosync.spec @@ -2,12 +2,13 @@ Name: corosync Summary: The Corosync Cluster Engine and Application Programming Interfaces -Version: 1.2.1 +Version: 1.2.3 Release: 1%{?alphatag:.%{alphatag}}%{?dist} License: BSD Group: System Environment/Base -URL: http://www.openais.org -Source0: http://developer.osdl.org/dev/openais/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz +URL: http://ftp.corosync.org +Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz +Patch0: revision-2770.patch # Runtime bits Requires: corosynclib = %{version}-%{release} @@ -24,6 +25,7 @@ Conflicts: openais <= 0.89, openais-devel <= 0.89 %if %{buildtrunk} BuildRequires: autoconf automake %endif + BuildRequires: nss-devel BuildRequires: libibverbs-devel librdmacm-devel @@ -31,6 +33,7 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) %prep %setup -q -n %{name}-%{version} +%patch0 %if %{buildtrunk} ./autogen.sh @@ -211,6 +214,16 @@ The Corosync Cluster Engine APIs. %{_mandir}/man8/sam_overview.8* %changelog +* Tue May 25 2010 Fabio M. Di Nitto - 1.2.3-1 +- New upstream release +- Rediff revision 2770 patch + +* Mon May 17 2010 Fabio M. Di Nitto - 1.2.2-1 +- New upstream release +- Add upstream trunk revision 2770 to add cpg_model_initialize api. +- Fix URL and Source0 entries. +- Add workaround to broken 1.2.2 Makefile with make -j. + * Wed Mar 24 2010 Fabio M. Di Nitto - 1.2.1-1 - New upstream release diff --git a/revision-2770.patch b/revision-2770.patch new file mode 100644 index 0000000..766c980 --- /dev/null +++ b/revision-2770.patch @@ -0,0 +1,811 @@ +Index: include/corosync/ipc_cpg.h +=================================================================== +--- include/corosync/ipc_cpg.h (revision 2769) ++++ include/corosync/ipc_cpg.h (revision 2770) +@@ -65,6 +65,7 @@ + MESSAGE_RES_CPG_ITERATIONNEXT = 10, + MESSAGE_RES_CPG_ITERATIONFINALIZE = 11, + MESSAGE_RES_CPG_FINALIZE = 12, ++ MESSAGE_RES_CPG_TOTEM_CONFCHG_CALLBACK = 13, + }; + + enum lib_cpg_confchg_reason { +@@ -149,10 +150,24 @@ + marshall_from_mar_cpg_name_t (&dest->group, &src->group); + }; + ++typedef struct { ++ mar_uint32_t nodeid __attribute__((aligned(8))); ++ mar_uint64_t seq __attribute__((aligned(8))); ++} mar_cpg_ring_id_t; ++ ++static inline void marshall_from_mar_cpg_ring_id_t ( ++ struct cpg_ring_id *dest, ++ const mar_cpg_ring_id_t *src) ++{ ++ dest->nodeid = src->nodeid; ++ dest->seq = src->seq; ++} ++ + struct req_lib_cpg_join { + coroipc_request_header_t header __attribute__((aligned(8))); + mar_cpg_name_t group_name __attribute__((aligned(8))); + mar_uint32_t pid __attribute__((aligned(8))); ++ mar_uint32_t flags __attribute__((aligned(8))); + }; + + struct res_lib_cpg_join { +@@ -238,6 +253,13 @@ + // struct cpg_address joined_list[]; + }; + ++struct res_lib_cpg_totem_confchg_callback { ++ coroipc_response_header_t header __attribute__((aligned(8))); ++ mar_cpg_ring_id_t ring_id __attribute__((aligned(8))); ++ mar_uint32_t member_list_entries __attribute__((aligned(8))); ++ mar_uint32_t member_list[]; ++}; ++ + struct req_lib_cpg_leave { + coroipc_request_header_t header __attribute__((aligned(8))); + mar_cpg_name_t group_name __attribute__((aligned(8))); +Index: include/corosync/cpg.h +=================================================================== +--- include/corosync/cpg.h (revision 2769) ++++ include/corosync/cpg.h (revision 2770) +@@ -78,6 +78,10 @@ + CPG_ITERATION_ALL = 3, + } cpg_iteration_type_t; + ++typedef enum { ++ CPG_MODEL_V1 = 1, ++} cpg_model_t; ++ + struct cpg_address { + uint32_t nodeid; + uint32_t pid; +@@ -98,6 +102,11 @@ + uint32_t pid; + }; + ++struct cpg_ring_id { ++ uint32_t nodeid; ++ uint64_t seq; ++}; ++ + typedef void (*cpg_deliver_fn_t) ( + cpg_handle_t handle, + const struct cpg_name *group_name, +@@ -117,11 +126,32 @@ + const struct cpg_address *left_list, size_t left_list_entries, + const struct cpg_address *joined_list, size_t joined_list_entries); + ++typedef void (*cpg_totem_confchg_fn_t) ( ++ cpg_handle_t handle, ++ struct cpg_ring_id ring_id, ++ uint32_t member_list_entries, ++ const uint32_t *member_list); ++ + typedef struct { + cpg_deliver_fn_t cpg_deliver_fn; + cpg_confchg_fn_t cpg_confchg_fn; + } cpg_callbacks_t; + ++typedef struct { ++ cpg_model_t model; ++} cpg_model_data_t; ++ ++#define CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF 0x01 ++ ++typedef struct { ++ cpg_model_t model; ++ cpg_deliver_fn_t cpg_deliver_fn; ++ cpg_confchg_fn_t cpg_confchg_fn; ++ cpg_totem_confchg_fn_t cpg_totem_confchg_fn; ++ unsigned int flags; ++} cpg_model_v1_data_t; ++ ++ + /** @} */ + + /* +@@ -132,6 +162,15 @@ + cpg_callbacks_t *callbacks); + + /* ++ * Create a new cpg connection, initialize with model ++ */ ++cs_error_t cpg_model_initialize ( ++ cpg_handle_t *handle, ++ cpg_model_t model, ++ cpg_model_data_t *model_data, ++ void *context); ++ ++/* + * Close the cpg handle + */ + cs_error_t cpg_finalize ( +Index: services/cpg.c +=================================================================== +--- services/cpg.c (revision 2769) ++++ services/cpg.c (revision 2770) +@@ -133,6 +133,8 @@ + mar_cpg_name_t group_name; + uint32_t pid; + enum cpd_state cpd_state; ++ unsigned int flags; ++ int initial_totem_conf_sent; + struct list_head list; + struct list_head iteration_instance_list_head; + }; +@@ -160,6 +162,8 @@ + + static enum cpg_sync_state my_sync_state = CPGSYNC_DOWNLIST; + ++static mar_cpg_ring_id_t last_sync_ring_id; ++ + struct process_info { + unsigned int nodeid; + uint32_t pid; +@@ -255,6 +259,11 @@ + + static void cpg_sync_abort (void); + ++static int notify_lib_totem_membership ( ++ void *conn, ++ int member_list_entries, ++ const unsigned int *member_list); ++ + /* + * Library Handler Definition + */ +@@ -432,6 +441,9 @@ + sizeof (unsigned int)); + my_member_list_entries = member_list_entries; + ++ last_sync_ring_id.nodeid = ring_id->rep.nodeid; ++ last_sync_ring_id.seq = ring_id->seq; ++ + for (i = 0; i < my_member_list_entries; i++) { + if (my_member_list[i] < lowest_nodeid) { + lowest_nodeid = my_member_list[i]; +@@ -482,14 +494,51 @@ + memcpy (my_old_member_list, my_member_list, + my_member_list_entries * sizeof (unsigned int)); + my_old_member_list_entries = my_member_list_entries; ++ ++ notify_lib_totem_membership (NULL, my_member_list_entries, my_member_list); + } + + static void cpg_sync_abort (void) + { + } + ++static int notify_lib_totem_membership ( ++ void *conn, ++ int member_list_entries, ++ const unsigned int *member_list) ++{ ++ struct list_head *iter; ++ char *buf; ++ int size; ++ struct res_lib_cpg_totem_confchg_callback *res; + ++ size = sizeof(struct res_lib_cpg_totem_confchg_callback) + ++ sizeof(mar_uint32_t) * (member_list_entries); ++ buf = alloca(size); ++ if (!buf) ++ return CPG_ERR_LIBRARY; + ++ res = (struct res_lib_cpg_totem_confchg_callback *)buf; ++ res->member_list_entries = member_list_entries; ++ res->header.size = size; ++ res->header.id = MESSAGE_RES_CPG_TOTEM_CONFCHG_CALLBACK; ++ res->header.error = CS_OK; ++ ++ memcpy (&res->ring_id, &last_sync_ring_id, sizeof (mar_cpg_ring_id_t)); ++ memcpy (res->member_list, member_list, res->member_list_entries * sizeof (mar_uint32_t)); ++ ++ if (conn == NULL) { ++ for (iter = cpg_pd_list_head.next; iter != &cpg_pd_list_head; iter = iter->next) { ++ struct cpg_pd *cpg_pd = list_entry (iter, struct cpg_pd, list); ++ api->ipc_dispatch_send (cpg_pd->conn, buf, size); ++ } ++ } else { ++ api->ipc_dispatch_send (conn, buf, size); ++ } ++ ++ return CPG_OK; ++} ++ + static int notify_lib_joinlist( + const mar_cpg_name_t *group_name, + void *conn, +@@ -604,6 +653,20 @@ + } + } + ++ ++ /* ++ * Traverse thru cpds and send totem membership for cpd, where it is not send yet ++ */ ++ for (iter = cpg_pd_list_head.next; iter != &cpg_pd_list_head; iter = iter->next) { ++ struct cpg_pd *cpd = list_entry (iter, struct cpg_pd, list); ++ ++ if ((cpd->flags & CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF) && (cpd->initial_totem_conf_sent == 0)) { ++ cpd->initial_totem_conf_sent = 1; ++ ++ notify_lib_totem_membership (cpd->conn, my_old_member_list_entries, my_old_member_list); ++ } ++ } ++ + return CPG_OK; + } + +@@ -1093,6 +1156,7 @@ + error = CPG_OK; + cpd->cpd_state = CPD_STATE_JOIN_STARTED; + cpd->pid = req_lib_cpg_join->pid; ++ cpd->flags = req_lib_cpg_join->flags; + memcpy (&cpd->group_name, &req_lib_cpg_join->group_name, + sizeof (cpd->group_name)); + +Index: lib/cpg.c +=================================================================== +--- lib/cpg.c (revision 2769) ++++ lib/cpg.c (revision 2770) +@@ -62,8 +62,11 @@ + struct cpg_inst { + hdb_handle_t handle; + int finalize; +- cpg_callbacks_t callbacks; + void *context; ++ union { ++ cpg_model_data_t model_data; ++ cpg_model_v1_data_t model_v1_data; ++ }; + struct list_head iteration_list_head; + }; + +@@ -118,9 +121,32 @@ + cpg_handle_t *handle, + cpg_callbacks_t *callbacks) + { ++ cpg_model_v1_data_t model_v1_data; ++ ++ memset (&model_v1_data, 0, sizeof (cpg_model_v1_data_t)); ++ ++ if (callbacks) { ++ model_v1_data.cpg_deliver_fn = callbacks->cpg_deliver_fn; ++ model_v1_data.cpg_confchg_fn = callbacks->cpg_confchg_fn; ++ } ++ ++ return (cpg_model_initialize (handle, CPG_MODEL_V1, (cpg_model_data_t *)&model_v1_data, NULL)); ++} ++ ++cs_error_t cpg_model_initialize ( ++ cpg_handle_t *handle, ++ cpg_model_t model, ++ cpg_model_data_t *model_data, ++ void *context) ++{ + cs_error_t error; + struct cpg_inst *cpg_inst; + ++ if (model != CPG_MODEL_V1) { ++ error = CPG_ERR_INVALID_PARAM; ++ goto error_no_destroy; ++ } ++ + error = hdb_error_to_cs (hdb_handle_create (&cpg_handle_t_db, sizeof (struct cpg_inst), handle)); + if (error != CS_OK) { + goto error_no_destroy; +@@ -142,10 +168,26 @@ + goto error_put_destroy; + } + +- if (callbacks) { +- memcpy (&cpg_inst->callbacks, callbacks, sizeof (cpg_callbacks_t)); ++ if (model_data != NULL) { ++ switch (model) { ++ case CPG_MODEL_V1: ++ memcpy (&cpg_inst->model_v1_data, model_data, sizeof (cpg_model_v1_data_t)); ++ if ((cpg_inst->model_v1_data.flags & ~(CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF)) != 0) { ++ error = CS_ERR_INVALID_PARAM; ++ ++ goto error_destroy; ++ } ++ break; ++ default: ++ error = CS_ERR_LIBRARY; ++ goto error_destroy; ++ break; ++ } + } + ++ cpg_inst->model_data.model = model; ++ cpg_inst->context = context; ++ + list_init(&cpg_inst->iteration_list_head); + + hdb_handle_put (&cpg_handle_t_db, *handle); +@@ -283,7 +325,8 @@ + struct cpg_inst *cpg_inst; + struct res_lib_cpg_confchg_callback *res_cpg_confchg_callback; + struct res_lib_cpg_deliver_callback *res_cpg_deliver_callback; +- cpg_callbacks_t callbacks; ++ struct res_lib_cpg_totem_confchg_callback *res_cpg_totem_confchg_callback; ++ struct cpg_inst cpg_inst_copy; + coroipc_response_header_t *dispatch_data; + struct cpg_address member_list[CPG_MEMBERS_MAX]; + struct cpg_address left_list[CPG_MEMBERS_MAX]; +@@ -292,6 +335,8 @@ + mar_cpg_address_t *left_list_start; + mar_cpg_address_t *joined_list_start; + unsigned int i; ++ struct cpg_ring_id ring_id; ++ uint32_t totem_member_list[CPG_MEMBERS_MAX]; + + error = hdb_error_to_cs (hdb_handle_get (&cpg_handle_t_db, handle, (void *)&cpg_inst)); + if (error != CS_OK) { +@@ -332,74 +377,96 @@ + * A risk of this dispatch method is that the callback routines may + * operate at the same time that cpgFinalize has been called. + */ +- memcpy (&callbacks, &cpg_inst->callbacks, sizeof (cpg_callbacks_t)); +- /* +- * Dispatch incoming message +- */ +- switch (dispatch_data->id) { +- case MESSAGE_RES_CPG_DELIVER_CALLBACK: +- if (callbacks.cpg_deliver_fn == NULL) { ++ memcpy (&cpg_inst_copy, cpg_inst, sizeof (struct cpg_inst)); ++ ++ switch (cpg_inst_copy.model_data.model) { ++ case CPG_MODEL_V1: ++ /* ++ * Dispatch incoming message ++ */ ++ switch (dispatch_data->id) { ++ case MESSAGE_RES_CPG_DELIVER_CALLBACK: ++ if (cpg_inst_copy.model_v1_data.cpg_deliver_fn == NULL) { ++ break; ++ } ++ ++ res_cpg_deliver_callback = (struct res_lib_cpg_deliver_callback *)dispatch_data; ++ ++ marshall_from_mar_cpg_name_t ( ++ &group_name, ++ &res_cpg_deliver_callback->group_name); ++ ++ cpg_inst_copy.model_v1_data.cpg_deliver_fn (handle, ++ &group_name, ++ res_cpg_deliver_callback->nodeid, ++ res_cpg_deliver_callback->pid, ++ &res_cpg_deliver_callback->message, ++ res_cpg_deliver_callback->msglen); + break; +- } + +- res_cpg_deliver_callback = (struct res_lib_cpg_deliver_callback *)dispatch_data; ++ case MESSAGE_RES_CPG_CONFCHG_CALLBACK: ++ if (cpg_inst_copy.model_v1_data.cpg_confchg_fn == NULL) { ++ break; ++ } + +- marshall_from_mar_cpg_name_t ( +- &group_name, +- &res_cpg_deliver_callback->group_name); ++ res_cpg_confchg_callback = (struct res_lib_cpg_confchg_callback *)dispatch_data; + +- callbacks.cpg_deliver_fn (handle, +- &group_name, +- res_cpg_deliver_callback->nodeid, +- res_cpg_deliver_callback->pid, +- &res_cpg_deliver_callback->message, +- res_cpg_deliver_callback->msglen); +- break; ++ for (i = 0; i < res_cpg_confchg_callback->member_list_entries; i++) { ++ marshall_from_mar_cpg_address_t (&member_list[i], ++ &res_cpg_confchg_callback->member_list[i]); ++ } ++ left_list_start = res_cpg_confchg_callback->member_list + ++ res_cpg_confchg_callback->member_list_entries; ++ for (i = 0; i < res_cpg_confchg_callback->left_list_entries; i++) { ++ marshall_from_mar_cpg_address_t (&left_list[i], ++ &left_list_start[i]); ++ } ++ joined_list_start = res_cpg_confchg_callback->member_list + ++ res_cpg_confchg_callback->member_list_entries + ++ res_cpg_confchg_callback->left_list_entries; ++ for (i = 0; i < res_cpg_confchg_callback->joined_list_entries; i++) { ++ marshall_from_mar_cpg_address_t (&joined_list[i], ++ &joined_list_start[i]); ++ } ++ marshall_from_mar_cpg_name_t ( ++ &group_name, ++ &res_cpg_confchg_callback->group_name); + +- case MESSAGE_RES_CPG_CONFCHG_CALLBACK: +- if (callbacks.cpg_confchg_fn == NULL) { ++ cpg_inst_copy.model_v1_data.cpg_confchg_fn (handle, ++ &group_name, ++ member_list, ++ res_cpg_confchg_callback->member_list_entries, ++ left_list, ++ res_cpg_confchg_callback->left_list_entries, ++ joined_list, ++ res_cpg_confchg_callback->joined_list_entries); ++ + break; +- } ++ case MESSAGE_RES_CPG_TOTEM_CONFCHG_CALLBACK: ++ if (cpg_inst_copy.model_v1_data.cpg_totem_confchg_fn == NULL) { ++ break; ++ } + +- res_cpg_confchg_callback = (struct res_lib_cpg_confchg_callback *)dispatch_data; ++ res_cpg_totem_confchg_callback = (struct res_lib_cpg_totem_confchg_callback *)dispatch_data; + +- for (i = 0; i < res_cpg_confchg_callback->member_list_entries; i++) { +- marshall_from_mar_cpg_address_t (&member_list[i], +- &res_cpg_confchg_callback->member_list[i]); +- } +- left_list_start = res_cpg_confchg_callback->member_list + +- res_cpg_confchg_callback->member_list_entries; +- for (i = 0; i < res_cpg_confchg_callback->left_list_entries; i++) { +- marshall_from_mar_cpg_address_t (&left_list[i], +- &left_list_start[i]); +- } +- joined_list_start = res_cpg_confchg_callback->member_list + +- res_cpg_confchg_callback->member_list_entries + +- res_cpg_confchg_callback->left_list_entries; +- for (i = 0; i < res_cpg_confchg_callback->joined_list_entries; i++) { +- marshall_from_mar_cpg_address_t (&joined_list[i], +- &joined_list_start[i]); +- } +- marshall_from_mar_cpg_name_t ( +- &group_name, +- &res_cpg_confchg_callback->group_name); ++ marshall_from_mar_cpg_ring_id_t (&ring_id, &res_cpg_totem_confchg_callback->ring_id); ++ for (i = 0; i < res_cpg_totem_confchg_callback->member_list_entries; i++) { ++ totem_member_list[i] = res_cpg_totem_confchg_callback->member_list[i]; ++ } + +- callbacks.cpg_confchg_fn (handle, +- &group_name, +- member_list, +- res_cpg_confchg_callback->member_list_entries, +- left_list, +- res_cpg_confchg_callback->left_list_entries, +- joined_list, +- res_cpg_confchg_callback->joined_list_entries); +- break; +- +- default: +- coroipcc_dispatch_put (cpg_inst->handle); +- error = CS_ERR_LIBRARY; +- goto error_put; +- break; +- } ++ cpg_inst_copy.model_v1_data.cpg_totem_confchg_fn (handle, ++ ring_id, ++ res_cpg_totem_confchg_callback->member_list_entries, ++ totem_member_list); ++ break; ++ default: ++ coroipcc_dispatch_put (cpg_inst->handle); ++ error = CS_ERR_LIBRARY; ++ goto error_put; ++ break; ++ } /* - switch (dispatch_data->id) */ ++ break; /* case CPG_MODEL_V1 */ ++ } /* - switch (cpg_inst_copy.model_data.model) */ + coroipcc_dispatch_put (cpg_inst->handle); + + /* +@@ -434,6 +501,14 @@ + req_lib_cpg_join.header.size = sizeof (struct req_lib_cpg_join); + req_lib_cpg_join.header.id = MESSAGE_REQ_CPG_JOIN; + req_lib_cpg_join.pid = getpid(); ++ req_lib_cpg_join.flags = 0; ++ ++ switch (cpg_inst->model_data.model) { ++ case CPG_MODEL_V1: ++ req_lib_cpg_join.flags = cpg_inst->model_v1_data.flags; ++ break; ++ } ++ + marshall_to_mar_cpg_name_t (&req_lib_cpg_join.group_name, + group); + +Index: lib/libcpg.verso +=================================================================== +--- lib/libcpg.verso (revision 2769) ++++ lib/libcpg.verso (revision 2770) +@@ -1 +1 @@ +-4.0.1 ++4.1.0 +Index: man/cpg_initialize.3 +=================================================================== +--- man/cpg_initialize.3 (revision 2769) ++++ man/cpg_initialize.3 (revision 2770) +@@ -41,7 +41,10 @@ + .SH DESCRIPTION + The + .B cpg_initialize +-function is used to initialize a connection to the closed process groups API. ++function is used to initialize a connection to the closed process groups API. This function is deprecated ++and ++.B cpg_model_initialize ++should be used in newly written code. + .PP + Each application may have several connections to the CPG API. Each application + uses the +@@ -167,5 +170,6 @@ + .BR cpg_context_get (3) + .BR cpg_context_set (3) + .BR cpg_local_get (3) ++.BR cpg_model_initialize (3) + + .PP +Index: man/cpg_overview.8 +=================================================================== +--- man/cpg_overview.8 (revision 2769) ++++ man/cpg_overview.8 (revision 2770) +@@ -61,6 +61,7 @@ + .BR cpg_join (3), + .BR cpg_leave (3), + .BR cpg_mcast_joined (3), ++.BR cpg_model_initialize (3), + .BR cpg_membership_get (3) + .BR cpg_zcb_alloc (3) + .BR cpg_zcb_free (3) +Index: man/cpg_model_initialize.3 +=================================================================== +--- man/cpg_model_initialize.3 (revision 0) ++++ man/cpg_model_initialize.3 (revision 2770) +@@ -0,0 +1,231 @@ ++.\"/* ++.\" * Copyright (c) 2010 Red Hat, Inc. ++.\" * ++.\" * All rights reserved. ++.\" * ++.\" * Author: Jan Friesse ++.\" * Author: Christine Caulfield ++.\" * ++.\" * This software licensed under BSD license, the text of which follows: ++.\" * ++.\" * Redistribution and use in source and binary forms, with or without ++.\" * modification, are permitted provided that the following conditions are met: ++.\" * ++.\" * - Redistributions of source code must retain the above copyright notice, ++.\" * this list of conditions and the following disclaimer. ++.\" * - Redistributions in binary form must reproduce the above copyright notice, ++.\" * this list of conditions and the following disclaimer in the documentation ++.\" * and/or other materials provided with the distribution. ++.\" * - Neither the name of the MontaVista Software, Inc. nor the names of its ++.\" * contributors may be used to endorse or promote products derived from this ++.\" * software without specific prior written permission. ++.\" * ++.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ++.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ++.\" * THE POSSIBILITY OF SUCH DAMAGE. ++.\" */ ++.TH CPG_MODEL_INITIALIZE 3 2010-04-07 "corosync Man Page" "Corosync Cluster Engine Programmer's Manual" ++.SH NAME ++cpg_model_initialize \- Create a new connection to the CPG service ++.SH SYNOPSIS ++.B #include ++.sp ++.BI "cs_error_t cpg_model_initialize(cpg_handle_t *" handle ", cpg_model_t " model ", cpg_model_data_t *" model_data ", void *" context "); ++ ++.SH DESCRIPTION ++The ++.B cpg_model_initialize ++function is used to initialize a connection to the closed process groups API. ++.PP ++Each application may have several connections to the CPG API. Each application ++uses the ++.I handle ++argument to uniquely identify the connection. The ++.I handle ++argument is then used in other function calls to identify the connection to be used ++for communication with the CPG service. ++.PP ++Argument ++.I model ++is used to explicitly choose set of callbacks and internal parameters. Currently only model ++.I CPG_MODEL_V1 ++is defined. ++.PP ++Callbacks and internal parameters are passed by ++.I model_data ++argument. This is casted pointer (idea is similar as in sockaddr function) to one of structures ++corresponding to chosen model. Currently only ++.I cpg_model_v1_data_t ++is needed. ++.SH MODEL_V1 ++The ++.I MODEL_V1 ++is backwards compatible with original callbacks initialized by ++.I cpg_initialize ++but new callback ++.I cpg_totem_confchg_fn ++is defined. ++.PP ++Every time an CPG event occurs within the joined group, one of the callbacks specified by the argument ++.I callbacks ++is called. The callback functions are described by the following type definitions: ++.PP ++.PP ++.IP ++.RS ++.ne 18 ++.nf ++.ta 4n 20n 32n ++ ++typedef void (*cpg_deliver_fn_t) ( ++ cpg_handle_t handle, ++ const struct cpg_name *group_name, ++ uint32_t nodeid, ++ uint32_t pid, ++ const void *msg, ++ size_t msg_len); ++ ++ ++typedef void (*cpg_confchg_fn_t) ( ++ cpg_handle_t handle, ++ const struct cpg_name *group_name, ++ const struct cpg_address *member_list, size_t member_list_entries, ++ const struct cpg_address *left_list, size_t left_list_entries, ++ const struct cpg_address *joined_list, size_t joined_list_entries); ++ ++ ++typedef void (*cpg_totem_confchg_fn_t) ( ++ cpg_handle_t handle, ++ struct cpg_ring_id ring_id, ++ uint32_t member_list_entries, ++ const uint32_t *member_list); ++.ta ++.fi ++.RE ++.IP ++.PP ++.PP ++The ++.I cpg_model_v1_data_t ++structure is defined as: ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++typedef struct { ++ cpg_model_t model; ++ cpg_deliver_fn_t cpg_deliver_fn; ++ cpg_confchg_fn_t cpg_confchg_fn; ++ cpg_totem_confchg_fn_t cpg_totem_confchg_fn; ++ unsigned int flags; ++} cpg_model_v1_data_t; ++.ta ++.fi ++.RE ++.IP ++.PP ++When a configuration change occurs or a message is to be delivered one of the callbacks ++is called from the ++.B cpg_dispatch() ++function. If a configuration change occurs, ++.I cpg_confchg_fn ++is called. If a delivery of a message occurs, ++.I cpg_deliver_fn ++is called. ++When totem membership change occurs, ++.I cpg_totem_confchg_fn ++is called. You can OR ++.I CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF ++constant to flags to get callback after first confchg event. ++ ++The ++.I cpg_address ++structure is defined ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++struct cpg_address { ++ unsigned int nodeid; ++ unsigned int pid; ++ unsigned int reason; ++}; ++.ta ++.fi ++.RE ++.IP ++.PP ++where nodeid is a 32 bit unique node identifier, pid is the process ID of the process that has joined/left the group ++or sent the message, and reason is an integer code indicating why the node joined/left the group. ++.PP ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++CPG_REASON_JOIN - the process joined a group using cpg_join(). ++CPG_REASON_LEAVE - the process left a group using cpg_leave() ++CPG_REASON_NODEDOWN - the process left a group because the node left the cluster. ++CPG_REASON_NODEUP - the process joined a group because it was already a member of a group on a node that has just joined the cluster ++CPG_REASON_PROCDOWN - the process left a group without calling cpg_leave() ++.ta ++.fi ++.RE ++.IP ++.PP ++The ++.I cpg_ring_id ++structure is defined ++.IP ++.RS ++.ne 18 ++.nf ++.PP ++struct cpg_ring_id { ++ uint32_t nodeid; ++ uint64_t seq; ++}; ++.ta ++.fi ++.RE ++.IP ++.PP ++where ++.I nodeid ++is if of node of current Totem leader and seq is increasing number. ++ ++.PP ++.SH RETURN VALUE ++This call returns the CPG_OK value if successful, otherwise an error is returned. ++.PP ++.SH ERRORS ++The errors are undocumented. ++.SH "SEE ALSO" ++.BR cpg_overview (8), ++.BR cpg_initialize (3), ++.BR cpg_finalize (3), ++.BR cpg_fd_get (3), ++.BR cpg_dispatch (3), ++.BR cpg_join (3), ++.BR cpg_leave (3), ++.BR cpg_mcast_joined (3), ++.BR cpg_membership_get (3) ++.BR cpg_zcb_alloc (3) ++.BR cpg_zcb_free (3) ++.BR cpg_zcb_mcast_joined (3) ++.BR cpg_context_get (3) ++.BR cpg_context_set (3) ++.BR cpg_local_get (3) ++.BR cpg_model_initialize (3) ++ ++.PP +Index: man/Makefile.am +=================================================================== +--- man/Makefile.am (revision 2769) ++++ man/Makefile.am (revision 2770) +@@ -71,6 +71,7 @@ + cpg_leave.3 \ + cpg_local_get.3 \ + cpg_mcast_joined.3 \ ++ cpg_model_initialize.3 \ + cpg_zcb_mcast_joined.3 \ + cpg_zcb_alloc.3 \ + cpg_zcb_free.3 \ diff --git a/sources b/sources index 9f490cb..e99be3c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -cba5eb5da41630f53e54b90c449c056d corosync-1.2.1.tar.gz +03b8cc311619c07ae1a84a5d59f13d0b corosync-1.2.3.tar.gz From 7d9ad2b86499086cf084757b8b69295dab6217b6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 12:12:25 +0000 Subject: [PATCH 11/12] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - import.log | 2 -- 4 files changed, 24 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 030097c..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: corosync -# $Id$ -NAME := corosync -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index baa94ef..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-13 diff --git a/import.log b/import.log deleted file mode 100644 index f1ab5e0..0000000 --- a/import.log +++ /dev/null @@ -1,2 +0,0 @@ -corosync-0_92-1_fc10:HEAD:corosync-0.92-1.fc10.src.rpm:1222323286 -corosync-0_92-2_fc10:HEAD:corosync-0.92-2.fc10.src.rpm:1222462910 From 7f9f0d1107c1b00d5751015945394b311565ea12 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 28 Jul 2010 12:12:27 +0000 Subject: [PATCH 12/12] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - import.log | 2 -- 4 files changed, 24 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch delete mode 100644 import.log diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index 030097c..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: corosync -# $Id$ -NAME := corosync -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 06de2d2..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -F-12 diff --git a/import.log b/import.log deleted file mode 100644 index f1ab5e0..0000000 --- a/import.log +++ /dev/null @@ -1,2 +0,0 @@ -corosync-0_92-1_fc10:HEAD:corosync-0.92-1.fc10.src.rpm:1222323286 -corosync-0_92-2_fc10:HEAD:corosync-0.92-2.fc10.src.rpm:1222462910