New upstream release

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
This commit is contained in:
Jan Friesse 2012-05-22 10:42:02 +02:00
parent 8fbedd4f31
commit c06da6b7a8
4 changed files with 15 additions and 83 deletions

1
.gitignore vendored
View File

@ -17,3 +17,4 @@ corosync-1.2.7.tar.gz
/corosync-1.99.8.tar.gz
/corosync-1.99.9.tar.gz
/corosync-2.0.0.tar.gz
/corosync-2.0.1.tar.gz

View File

@ -16,13 +16,16 @@
Name: corosync
Summary: The Corosync Cluster Engine and Application Programming Interfaces
Version: 2.0.0
Release: 2%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
Version: 2.0.1
Release: 1%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
License: BSD
Group: System Environment/Base
URL: http://ftp.corosync.org
Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}.tar.gz
Patch0: ipcs_allow_connections_only_after_all_services_are_ready.patch
%if 0%{?rhel}
ExclusiveArch: i686 x86_64
%endif
# Runtime bits
Requires: corosynclib = %{version}-%{release}
@ -37,7 +40,7 @@ Obsoletes: cman, clusterlib, clusterlib-devel
%define buildtrunk 0
%{?_with_buildtrunk: %define buildtrunk 1}
BuildRequires: libqb-devel >= 0.11.1
BuildRequires: libqb-devel >= 0.13.0
BuildRequires: nss-devel
%if %{buildtrunk}
BuildRequires: autoconf automake
@ -62,7 +65,6 @@ BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
%prep
%setup -q -n %{name}-%{version}%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
%patch0 -p1
%build
%if %{buildtrunk}
@ -172,6 +174,9 @@ fi
%if %{with systemd}
%{_unitdir}/corosync.service
%{_unitdir}/corosync-notifyd.service
%dir %{_datadir}/corosync
%{_datadir}/corosync/corosync
%{_datadir}/corosync/corosync-notifyd
%else
%{_initrddir}/corosync
%{_initrddir}/corosync-notifyd
@ -293,6 +298,9 @@ The Corosync Cluster Engine APIs.
%{_mandir}/man8/quorum_overview.8*
%changelog
* Tue May 12 2012 Jan Friesse <jfriesse@redhat.com> - 2.0.1-1
- New upstream release
* Tue Apr 17 2012 Fabio M. Di Nitto <fdinitto@redhat.com> - 2.0.0-2
- Backport IPCS fix from master (ack by Steven)

View File

@ -1,77 +0,0 @@
commit b34c1e28704fef38fb3f5eb1a0b418c84a2f0863
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
Date: Mon Apr 16 13:39:03 2012 +0200
ipcs: allow connections only after all services are ready
this fixes a rather annoying race condition at startup where a client
connects to corosync "too fast" before the service is ready to operate
and client gets some random data during initialization phase.
With this fix, we allow connections to ipc only after the main engine
is operational and configured (and after the first totem transition).
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
diff --git a/exec/ipc_glue.c b/exec/ipc_glue.c
index c1d6034..592f9f6 100644
--- a/exec/ipc_glue.c
+++ b/exec/ipc_glue.c
@@ -69,6 +69,7 @@ static int32_t ipc_not_enough_fds_left = 0;
static int32_t ipc_fc_is_quorate; /* boolean */
static int32_t ipc_fc_totem_queue_level; /* percentage used */
static int32_t ipc_fc_sync_in_process; /* boolean */
+static int32_t ipc_allow_connections = 0; /* boolean */
struct cs_ipcs_mapper {
int32_t id;
@@ -149,6 +150,11 @@ static const char* cs_ipcs_serv_short_name(int32_t service_id)
return name;
}
+void cs_ipc_allow_connections(int32_t allow)
+{
+ ipc_allow_connections = allow;
+}
+
int32_t cs_ipcs_service_destroy(int32_t service_id)
{
if (ipcs_mapper[service_id].inst) {
@@ -164,6 +170,11 @@ static int32_t cs_ipcs_connection_accept (qb_ipcs_connection_t *c, uid_t euid, g
uint8_t u8;
char key_name[ICMAP_KEYNAME_MAXLEN];
+ if (!ipc_allow_connections) {
+ log_printf(LOGSYS_LEVEL_DEBUG, "Denied connection, corosync is not ready");
+ return -EAGAIN;
+ }
+
if (corosync_service[service] == NULL ||
corosync_service_exiting[service] ||
ipcs_mapper[service].inst == NULL) {
diff --git a/exec/main.c b/exec/main.c
index 474e0c2..2f3d242 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -252,6 +252,7 @@ static void corosync_sync_completed (void)
sync_in_process = 0;
cs_ipcs_sync_state_changed(sync_in_process);
+ cs_ipc_allow_connections(1);
}
static int corosync_sync_callbacks_retrieve (
diff --git a/exec/main.h b/exec/main.h
index 9d27670..13b7e12 100644
--- a/exec/main.h
+++ b/exec/main.h
@@ -119,6 +119,8 @@ extern void cs_ipc_refcnt_inc(void *conn);
extern void cs_ipc_refcnt_dec(void *conn);
+extern void cs_ipc_allow_connections(int32_t allow);
+
int coroparse_configparse (const char **error_string);
#endif /* MAIN_H_DEFINED */

View File

@ -1 +1 @@
72592510e7a142e60191ff2468c116f8 corosync-2.0.0.tar.gz
9e23f3f5594676455ff39ff363658155 corosync-2.0.1.tar.gz