Merge back from F17
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
This commit is contained in:
commit
74cba63d6b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/dlm-3.99.0.tar.gz
|
||||
/dlm-3.99.1.tar.gz
|
||||
|
26
dlm.spec
26
dlm.spec
@ -1,20 +1,21 @@
|
||||
Name: dlm
|
||||
Version: 3.99.0
|
||||
Release: 8%{?dist}
|
||||
Version: 3.99.1
|
||||
Release: 4%{?dist}
|
||||
License: GPLv2 and GPLv2+ and LGPLv2+
|
||||
# For a breakdown of the licensing, see README.license
|
||||
Group: System Environment/Kernel
|
||||
Summary: Cluster control daemon and tool
|
||||
URL: https://fedorahosted.org/cluster
|
||||
BuildRequires: glibc-kernheaders
|
||||
BuildRequires: corosynclib-devel >= 1.99.8
|
||||
BuildRequires: corosynclib-devel >= 1.99.9
|
||||
BuildRequires: pacemaker-libs-devel >= 1.1.7
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: systemd-units
|
||||
Source0: http://people.redhat.com/teigland/%{name}-%{version}.tar.gz
|
||||
Patch0: upstream_head_2ad89c869.patch
|
||||
Patch0: dlm_stonith-link-with-ldl.patch
|
||||
|
||||
Requires: %{name}-lib = %{version}-%{release}
|
||||
Requires: corosync >= 1.99.8
|
||||
Requires: corosync >= 1.99.9
|
||||
Requires(post): systemd-units
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
@ -31,10 +32,12 @@ The kernel dlm requires a user daemon to control cluster membership.
|
||||
# upstream does not require configure
|
||||
# upstream does not support _smp_mflags
|
||||
CFLAGS=$RPM_OPT_FLAGS make
|
||||
CFLAGS=$RPM_OPT_FLAGS make -C fence
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
make -C fence install LIBDIR=%{_libdir} DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
install -Dm 0644 init/dlm.service %{buildroot}%{_unitdir}/dlm.service
|
||||
|
||||
@ -61,6 +64,7 @@ fi
|
||||
%{_unitdir}/dlm.service
|
||||
%{_sbindir}/dlm_controld
|
||||
%{_sbindir}/dlm_tool
|
||||
%{_sbindir}/dlm_stonith
|
||||
%{_mandir}/man8/dlm*
|
||||
%{_mandir}/man3/*dlm*
|
||||
|
||||
@ -99,6 +103,18 @@ developing applications that use %{name}.
|
||||
%{_libdir}/pkgconfig/*.pc
|
||||
|
||||
%changelog
|
||||
* Thu Mar 29 2012 Fabio M. Di Nitto <fdinitto@redhat.com> - 3.99.1-4
|
||||
- Merge back from F17
|
||||
|
||||
* Wed Mar 21 2012 David Teigland <teigland@redhat.com> - 3.99.1-3
|
||||
- Fix dlm_stonith linking
|
||||
|
||||
* Wed Mar 21 2012 David Teigland <teigland@redhat.com> - 3.99.1-2
|
||||
- Require pacemaker-libs-devel to build dlm_stonith
|
||||
|
||||
* Wed Mar 21 2012 David Teigland <teigland@redhat.com> - 3.99.1-1
|
||||
- Update to 3.99.1
|
||||
|
||||
* Fri Mar 16 2012 Fabio M. Di Nitto <fdinitto@redhat.com> - 3.99.0-8
|
||||
- Rebuild against new corosync (soname change).
|
||||
|
||||
|
25
dlm_stonith-link-with-ldl.patch
Normal file
25
dlm_stonith-link-with-ldl.patch
Normal file
@ -0,0 +1,25 @@
|
||||
From 470688a483678f01341f45815d7376b9002d2ebb Mon Sep 17 00:00:00 2001
|
||||
From: David Teigland <teigland@redhat.com>
|
||||
Date: Wed, 21 Mar 2012 16:09:01 -0500
|
||||
Subject: [PATCH] dlm_stonith: link with -ldl
|
||||
|
||||
Signed-off-by: David Teigland <teigland@redhat.com>
|
||||
---
|
||||
fence/Makefile | 1 +
|
||||
1 files changed, 1 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/fence/Makefile b/fence/Makefile
|
||||
index c6ff2c0..41af463 100644
|
||||
--- a/fence/Makefile
|
||||
+++ b/fence/Makefile
|
||||
@@ -35,6 +35,7 @@ BIN_CFLAGS += -I../include
|
||||
|
||||
BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
|
||||
BIN_LDFLAGS += `xml2-config --libs`
|
||||
+BIN_LDFLAGS += -ldl
|
||||
|
||||
all: $(BIN_TARGET)
|
||||
|
||||
--
|
||||
1.7.6.5
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
4cd371abe5d977b386796d8d0b9066d0 dlm-3.99.0.tar.gz
|
||||
0acd0fe9d652f895485d04eb63bc7f02 dlm-3.99.1.tar.gz
|
||||
|
@ -1,400 +0,0 @@
|
||||
diff --git a/dlm_controld/action.c b/dlm_controld/action.c
|
||||
index ae3f6cd..d4bf11d 100644
|
||||
--- a/dlm_controld/action.c
|
||||
+++ b/dlm_controld/action.c
|
||||
@@ -67,14 +67,14 @@ static int detect_cluster_name(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- rv = cmap_get_string(handle, "cluster.name", &str);
|
||||
+ rv = cmap_get_string(handle, "totem.cluster_name", &str);
|
||||
if (rv != CS_OK) {
|
||||
- log_error("cmap_get_string cluster.name error %d", rv);
|
||||
+ log_error("cmap_get_string totem.cluster_name error %d", rv);
|
||||
goto out;
|
||||
} else
|
||||
err = 0;
|
||||
|
||||
- log_debug("cmap cluster.name = '%s'", str);
|
||||
+ log_debug("cmap totem.cluster_name = '%s'", str);
|
||||
|
||||
strncpy(cluster_name, str, DLM_LOCKSPACE_LEN);
|
||||
out:
|
||||
@@ -848,10 +848,12 @@ int setup_configfs_options(void)
|
||||
|
||||
detect_cluster_name();
|
||||
|
||||
- if (cluster_name[0])
|
||||
+ if (cluster_name[0]) {
|
||||
set_configfs_cluster("cluster_name", cluster_name, 0);
|
||||
- else
|
||||
+ } else {
|
||||
log_error("no cluster name");
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
diff --git a/dlm_controld/cpg.c b/dlm_controld/cpg.c
|
||||
index f490cf5..ced912f 100644
|
||||
--- a/dlm_controld/cpg.c
|
||||
+++ b/dlm_controld/cpg.c
|
||||
@@ -280,7 +280,7 @@ const char *msg_name(int type)
|
||||
static int _send_message(cpg_handle_t h, void *buf, int len, int type)
|
||||
{
|
||||
struct iovec iov;
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
int retries = 0;
|
||||
|
||||
iov.iov_base = buf;
|
||||
@@ -288,7 +288,7 @@ static int _send_message(cpg_handle_t h, void *buf, int len, int type)
|
||||
|
||||
retry:
|
||||
error = cpg_mcast_joined(h, CPG_TYPE_AGREED, &iov, 1);
|
||||
- if (error == CPG_ERR_TRY_AGAIN) {
|
||||
+ if (error == CS_ERR_TRY_AGAIN) {
|
||||
retries++;
|
||||
usleep(1000);
|
||||
if (!(retries % 100))
|
||||
@@ -296,7 +296,7 @@ static int _send_message(cpg_handle_t h, void *buf, int len, int type)
|
||||
retries, msg_name(type));
|
||||
goto retry;
|
||||
}
|
||||
- if (error != CPG_OK) {
|
||||
+ if (error != CS_OK) {
|
||||
log_error("cpg_mcast_joined error %d handle %llx %s",
|
||||
error, (unsigned long long)h, msg_name(type));
|
||||
return -1;
|
||||
@@ -686,6 +686,11 @@ static int need_fencing(struct lockspace *ls)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/* we don't need to ask fenced to initiate fencing; it does
|
||||
+ so itself when it sees a fence domain member fail. Without
|
||||
+ fenced we'll probably need to ask another daemon to initiate
|
||||
+ fencing, then check with it above, like we check libfenced. */
|
||||
+
|
||||
static void request_fencing(struct lockspace *ls)
|
||||
{
|
||||
struct node *node;
|
||||
@@ -693,12 +698,7 @@ static void request_fencing(struct lockspace *ls)
|
||||
list_for_each_entry(node, &ls->node_history, list) {
|
||||
if (!node->request_fencing)
|
||||
continue;
|
||||
-
|
||||
- /* we don't need to ask fenced to initiate fencing; it does
|
||||
- so itself when it sees a fence domain member fail. Without
|
||||
- fenced we'll probably need to ask another daemon to initiate
|
||||
- fencing, then check with it above, like we check libfenced. */
|
||||
-
|
||||
+ fence_request(node->nodeid);
|
||||
node->request_fencing = 0;
|
||||
}
|
||||
}
|
||||
@@ -1886,11 +1886,11 @@ static cpg_model_v1_data_t cpg_callbacks = {
|
||||
void update_flow_control_status(void)
|
||||
{
|
||||
cpg_flow_control_state_t flow_control_state;
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
|
||||
error = cpg_flow_control_state_get(cpg_handle_daemon,
|
||||
&flow_control_state);
|
||||
- if (error != CPG_OK) {
|
||||
+ if (error != CS_OK) {
|
||||
log_error("cpg_flow_control_state_get %d", error);
|
||||
return;
|
||||
}
|
||||
@@ -1911,7 +1911,7 @@ void update_flow_control_status(void)
|
||||
static void process_cpg_lockspace(int ci)
|
||||
{
|
||||
struct lockspace *ls;
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
|
||||
ls = find_ls_ci(ci);
|
||||
if (!ls) {
|
||||
@@ -1919,8 +1919,8 @@ static void process_cpg_lockspace(int ci)
|
||||
return;
|
||||
}
|
||||
|
||||
- error = cpg_dispatch(ls->cpg_handle, CPG_DISPATCH_ALL);
|
||||
- if (error != CPG_OK) {
|
||||
+ error = cpg_dispatch(ls->cpg_handle, CS_DISPATCH_ALL);
|
||||
+ if (error != CS_OK) {
|
||||
log_error("cpg_dispatch error %d", error);
|
||||
return;
|
||||
}
|
||||
@@ -1932,7 +1932,7 @@ static void process_cpg_lockspace(int ci)
|
||||
|
||||
int dlm_join_lockspace(struct lockspace *ls)
|
||||
{
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
cpg_handle_t h;
|
||||
struct cpg_name name;
|
||||
int i = 0, fd, ci, rv;
|
||||
@@ -1947,7 +1947,7 @@ int dlm_join_lockspace(struct lockspace *ls)
|
||||
|
||||
error = cpg_model_initialize(&h, CPG_MODEL_V1,
|
||||
(cpg_model_data_t *)&cpg_callbacks, NULL);
|
||||
- if (error != CPG_OK) {
|
||||
+ if (error != CS_OK) {
|
||||
log_error("cpg_model_initialize error %d", error);
|
||||
rv = -1;
|
||||
goto fail_free;
|
||||
@@ -1976,13 +1976,13 @@ int dlm_join_lockspace(struct lockspace *ls)
|
||||
log_group(ls, "cpg_join %s ...", name.value);
|
||||
retry:
|
||||
error = cpg_join(h, &name);
|
||||
- if (error == CPG_ERR_TRY_AGAIN) {
|
||||
+ if (error == CS_ERR_TRY_AGAIN) {
|
||||
sleep(1);
|
||||
if (!(++i % 10))
|
||||
log_error("cpg_join error retrying");
|
||||
goto retry;
|
||||
}
|
||||
- if (error != CPG_OK) {
|
||||
+ if (error != CS_OK) {
|
||||
log_error("cpg_join error %d", error);
|
||||
cpg_finalize(h);
|
||||
rv = -1;
|
||||
@@ -2005,7 +2005,7 @@ int dlm_join_lockspace(struct lockspace *ls)
|
||||
|
||||
int dlm_leave_lockspace(struct lockspace *ls)
|
||||
{
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
struct cpg_name name;
|
||||
int i = 0;
|
||||
|
||||
@@ -2017,13 +2017,13 @@ int dlm_leave_lockspace(struct lockspace *ls)
|
||||
|
||||
retry:
|
||||
error = cpg_leave(ls->cpg_handle, &name);
|
||||
- if (error == CPG_ERR_TRY_AGAIN) {
|
||||
+ if (error == CS_ERR_TRY_AGAIN) {
|
||||
sleep(1);
|
||||
if (!(++i % 10))
|
||||
log_error("cpg_leave error retrying");
|
||||
goto retry;
|
||||
}
|
||||
- if (error != CPG_OK)
|
||||
+ if (error != CS_OK)
|
||||
log_error("cpg_leave error %d", error);
|
||||
|
||||
return 0;
|
||||
@@ -2563,16 +2563,16 @@ static cpg_model_v1_data_t cpg_callbacks_daemon = {
|
||||
|
||||
void process_cpg_daemon(int ci)
|
||||
{
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
|
||||
- error = cpg_dispatch(cpg_handle_daemon, CPG_DISPATCH_ALL);
|
||||
- if (error != CPG_OK)
|
||||
+ error = cpg_dispatch(cpg_handle_daemon, CS_DISPATCH_ALL);
|
||||
+ if (error != CS_OK)
|
||||
log_error("daemon cpg_dispatch error %d", error);
|
||||
}
|
||||
|
||||
int setup_cpg_daemon(void)
|
||||
{
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
struct cpg_name name;
|
||||
int i = 0;
|
||||
|
||||
@@ -2597,7 +2597,7 @@ int setup_cpg_daemon(void)
|
||||
error = cpg_model_initialize(&cpg_handle_daemon, CPG_MODEL_V1,
|
||||
(cpg_model_data_t *)&cpg_callbacks_daemon,
|
||||
NULL);
|
||||
- if (error != CPG_OK) {
|
||||
+ if (error != CS_OK) {
|
||||
log_error("daemon cpg_initialize error %d", error);
|
||||
return -1;
|
||||
}
|
||||
@@ -2611,13 +2611,13 @@ int setup_cpg_daemon(void)
|
||||
log_debug("cpg_join %s ...", name.value);
|
||||
retry:
|
||||
error = cpg_join(cpg_handle_daemon, &name);
|
||||
- if (error == CPG_ERR_TRY_AGAIN) {
|
||||
+ if (error == CS_ERR_TRY_AGAIN) {
|
||||
sleep(1);
|
||||
if (!(++i % 10))
|
||||
log_error("daemon cpg_join error retrying");
|
||||
goto retry;
|
||||
}
|
||||
- if (error != CPG_OK) {
|
||||
+ if (error != CS_OK) {
|
||||
log_error("daemon cpg_join error %d", error);
|
||||
goto fail;
|
||||
}
|
||||
@@ -2633,7 +2633,7 @@ int setup_cpg_daemon(void)
|
||||
void close_cpg_daemon(void)
|
||||
{
|
||||
struct lockspace *ls;
|
||||
- cpg_error_t error;
|
||||
+ cs_error_t error;
|
||||
struct cpg_name name;
|
||||
int i = 0;
|
||||
|
||||
@@ -2649,13 +2649,13 @@ void close_cpg_daemon(void)
|
||||
log_debug("cpg_leave %s ...", name.value);
|
||||
retry:
|
||||
error = cpg_leave(cpg_handle_daemon, &name);
|
||||
- if (error == CPG_ERR_TRY_AGAIN) {
|
||||
+ if (error == CS_ERR_TRY_AGAIN) {
|
||||
sleep(1);
|
||||
if (!(++i % 10))
|
||||
log_error("daemon cpg_leave error retrying");
|
||||
goto retry;
|
||||
}
|
||||
- if (error != CPG_OK)
|
||||
+ if (error != CS_OK)
|
||||
log_error("daemon cpg_leave error %d", error);
|
||||
fin:
|
||||
list_for_each_entry(ls, &lockspaces, list) {
|
||||
diff --git a/dlm_controld/dlm_daemon.h b/dlm_controld/dlm_daemon.h
|
||||
index 497e6e8..3899550 100644
|
||||
--- a/dlm_controld/dlm_daemon.h
|
||||
+++ b/dlm_controld/dlm_daemon.h
|
||||
@@ -348,6 +348,7 @@ void process_cluster_cfg(int ci);
|
||||
void kick_node_from_cluster(int nodeid);
|
||||
|
||||
/* fence.c */
|
||||
+void fence_request(int nodeid);
|
||||
int fence_node_time(int nodeid, uint64_t *last_fenced_time);
|
||||
int fence_in_progress(int *count);
|
||||
|
||||
diff --git a/dlm_controld/fence.c b/dlm_controld/fence.c
|
||||
index 95a8bc1..f91d9de 100644
|
||||
--- a/dlm_controld/fence.c
|
||||
+++ b/dlm_controld/fence.c
|
||||
@@ -7,38 +7,30 @@
|
||||
*/
|
||||
|
||||
#include "dlm_daemon.h"
|
||||
-//#include "libfenced.h"
|
||||
+#ifdef STONITH
|
||||
+#include <pacemaker/crm/stonith-ng.h>
|
||||
+#endif
|
||||
|
||||
-int fence_node_time(int nodeid, uint64_t *last_fenced_time)
|
||||
+void fence_request(int nodeid)
|
||||
{
|
||||
-/*
|
||||
- struct fenced_node nodeinfo;
|
||||
+#ifdef STONITH
|
||||
int rv;
|
||||
+ rv = stonith_api_kick_cs_helper(nodeid, 300, 1);
|
||||
+ if (rv)
|
||||
+ log_error("stonith_api_kick_cs_helper %d error %d", nodeid, rv);
|
||||
+#endif
|
||||
+}
|
||||
|
||||
- memset(&nodeinfo, 0, sizeof(nodeinfo));
|
||||
-
|
||||
- rv = fenced_node_info(nodeid, &nodeinfo);
|
||||
- if (rv < 0)
|
||||
- return rv;
|
||||
-
|
||||
- *last_fenced_time = nodeinfo.last_fenced_time;
|
||||
-*/
|
||||
+int fence_node_time(int nodeid, uint64_t *last_fenced_time)
|
||||
+{
|
||||
+#ifdef STONITH
|
||||
+ *last_fenced_time = stonith_api_time_cs_helper(nodeid, 0);
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fence_in_progress(int *count)
|
||||
{
|
||||
-/* struct fenced_domain domain;
|
||||
- int rv;
|
||||
-
|
||||
- memset(&domain, 0, sizeof(domain));
|
||||
-
|
||||
- rv = fenced_domain_info(&domain);
|
||||
- if (rv < 0)
|
||||
- return rv;
|
||||
-
|
||||
- *count = domain.victim_count;
|
||||
-*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/dlm_controld/member.c b/dlm_controld/member.c
|
||||
index 4a445c8..7af581c 100644
|
||||
--- a/dlm_controld/member.c
|
||||
+++ b/dlm_controld/member.c
|
||||
@@ -265,7 +265,6 @@ static void shutdown_callback(corosync_cfg_handle_t h,
|
||||
static corosync_cfg_callbacks_t cfg_callbacks =
|
||||
{
|
||||
.corosync_cfg_shutdown_callback = shutdown_callback,
|
||||
- .corosync_cfg_state_track_callback = NULL,
|
||||
};
|
||||
|
||||
void process_cluster_cfg(int ci)
|
||||
@@ -302,9 +301,16 @@ int setup_cluster_cfg(void)
|
||||
corosync_cfg_finalize(ch);
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
our_nodeid = nodeid;
|
||||
log_debug("our_nodeid %d", our_nodeid);
|
||||
|
||||
+ if (our_nodeid < 0) {
|
||||
+ log_error("negative nodeid, set corosync totem.clear_node_high_bit");
|
||||
+ corosync_cfg_finalize(ch);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
return fd;
|
||||
}
|
||||
|
||||
diff --git a/init/dlm.init b/init/dlm.init
|
||||
index db8f17f..7f3da2d 100644
|
||||
--- a/init/dlm.init
|
||||
+++ b/init/dlm.init
|
||||
@@ -26,7 +26,7 @@ progdir="cluster"
|
||||
lockfile="/var/run/$progdir/$prog.pid"
|
||||
exec="/usr/sbin/$prog"
|
||||
|
||||
-[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
|
||||
+[ -f /etc/sysconfig/dlm ] && . /etc/sysconfig/dlm
|
||||
|
||||
setup() {
|
||||
modprobe dlm > /dev/null 2>&1
|
||||
diff --git a/init/dlm.service b/init/dlm.service
|
||||
index e275843..d7cf9c7 100644
|
||||
--- a/init/dlm.service
|
||||
+++ b/init/dlm.service
|
||||
@@ -4,7 +4,10 @@ After=syslog.target network.target corosync.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
-ExecStart=/usr/sbin/dlm_controld $OPTIONS
|
||||
+EnvironmentFile=/etc/sysconfig/dlm
|
||||
+ExecStartPre=/sbin/modprobe dlm
|
||||
+ExecStart=/usr/sbin/dlm_controld $DLM_CONTROLD_OPTS
|
||||
+#ExecStopPost=/sbin/modprobe -r dlm
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
diff --git a/libdlm/51-dlm.rules b/libdlm/51-dlm.rules
|
||||
index f71e79d..9d21fc0 100644
|
||||
--- a/libdlm/51-dlm.rules
|
||||
+++ b/libdlm/51-dlm.rules
|
||||
@@ -1,5 +1,4 @@
|
||||
-KERNEL=="dlm-control", NAME="misc/dlm-control", MODE="0666"
|
||||
-KERNEL=="dlm-monitor", NAME="misc/dlm-monitor", MODE="0666"
|
||||
-KERNEL=="dlm_default", NAME="misc/dlm_default", MODE="0666"
|
||||
-KERNEL=="dlm_*", NAME="misc/%k", MODE="0660"
|
||||
-
|
||||
+KERNEL=="dlm-control", MODE="0666", SYMLINK+="misc/dlm-control"
|
||||
+KERNEL=="dlm-monitor", MODE="0666", SYMLINK+="misc/dlm-monitor"
|
||||
+KERNEL=="dlm_plock", MODE="0666", SYMLINK+="misc/dlm_plock"
|
||||
+KERNEL=="dlm_*", MODE="0660", SYMLINK+="misc/%k"
|
Loading…
Reference in New Issue
Block a user