cluster: RHEL6 - schema: add RRP attributes to <token>
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=d4ec75242b7...
Commit: d4ec75242b7f7e7463113eb36cfba07112630125
Parent: 7d2ddea9781b8ff33e1e28dfbdca041be290195a
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Thu Nov 26 14:04:17 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Thu Nov 26 14:04:17 2015 +0000
schema: add RRP attributes to <token>
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
config/tools/xml/cluster.rng.in.head | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/cluster.rng.in.head b/config/tools/xml/cluster.rng.in.head
index f42269c..e811909 100644
--- a/config/tools/xml/cluster.rng.in.head
+++ b/config/tools/xml/cluster.rng.in.head
@@ -290,6 +290,28 @@ To validate your cluster.conf against this schema, run:
rha:default="3" rha:sample="5"/>
</optional>
<optional>
+ <attribute name="rrp_problem_count_mcast_threshold" rha:description="This
+ specifies the number of times a problem is detected with
+ multicast before setting the link faulty for passive rrp mode.
+ This variable is unused in active rrp mode.
+ The default is 10 times rrp_problem_count_threshold."/>
+ </optional>
+ <optional>
+ <attribute name="rrp_problem_count_timeout" rha:description="This
+ specifies the time in milliseconds to wait before decrementing
+ the problem count by 1 for a particular ring to ensure a
+ link is not marked faulty for transient network failures.
+ The default is 2000 milliseconds."
+ rha:default="2000"/>
+ </optional>
+ <optional>
+ <attribute name="rrp_autorecovery_check_timeout" rha:description="This
+ specifies the time in milliseconds to check if the failed
+ ring can be auto-recovered.
+ The default is 1000 milliseconds."
+ rha:default="1000"/>
+ </optional>
+ <optional>
<attribute name="secauth" rha:description="This attribute specifies
that HMAC/SHA1 authentication should be used to authenticate all
messages. It further specifies that all data should be encrypted
8 years, 5 months
cluster: RHEL6 - qdiskd: don't leak memory if we fail to read from
disk
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=7d2ddea9781...
Commit: 7d2ddea9781b8ff33e1e28dfbdca041be290195a
Parent: ade39882b26b8ac0cdcca9bff689f076e78aec91
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 21 17:15:54 2011 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 16:08:01 2015 +0000
qdiskd: don't leak memory if we fail to read from disk
Spotted by Coverity Scan
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/disk.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/cman/qdisk/disk.c b/cman/qdisk/disk.c
index 524742c..b0cc0f0 100644
--- a/cman/qdisk/disk.c
+++ b/cman/qdisk/disk.c
@@ -605,6 +605,7 @@ qdisk_read(target_info_t *disk, __off64_t offset, void *bufin, int count)
rv = diskRawReadShadow(disk, offset, (char *)hdrp, disk->d_blksz);
if (rv == -1) {
+ free(hdrp);
return -1;
}
8 years, 5 months
cluster: RHEL6 - qdiskd: fix memcpy direction and possible memory leak
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=ade39882b26...
Commit: ade39882b26b8ac0cdcca9bff689f076e78aec91
Parent: b9e9dc905459e10caa4563a43d6c584599e06b50
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Nov 28 16:48:28 2011 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 16:07:51 2015 +0000
qdiskd: fix memcpy direction and possible memory leak
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/disk.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cman/qdisk/disk.c b/cman/qdisk/disk.c
index 9884ea7..524742c 100644
--- a/cman/qdisk/disk.c
+++ b/cman/qdisk/disk.c
@@ -432,10 +432,10 @@ diskRawRead(target_info_t *disk, char *buf, int len)
io_state(STATE_NONE);
if (readret > 0) {
if (readret > len) {
- memcpy(alignedBuf, buf, len);
+ memcpy(buf, alignedBuf, len);
readret = len;
} else {
- memcpy(alignedBuf, buf, readret);
+ memcpy(buf, alignedBuf, readret);
}
}
@@ -505,13 +505,14 @@ diskRawWrite(target_info_t *disk, char *buf, int len)
}
if (len > disk->d_blksz) {
+ free(alignedBuf);
logt_print(LOG_ERR,
"diskRawWrite: not setup for larger than %d.\n",
(int)disk->d_blksz);
return (-1);
}
- memcpy(buf, alignedBuf, len);
+ memcpy(alignedBuf, buf, len);
io_state(STATE_WRITE);
ret = write(disk->d_fd, alignedBuf, writelen);
io_state(STATE_NONE);
8 years, 5 months
cluster: RHEL6 - gfs_tool: Show more than 128 mounted filesystems
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=b9e9dc90545...
Commit: b9e9dc905459e10caa4563a43d6c584599e06b50
Parent: 9cfdf3caa14da886360ee43162a7d9ea8386fba2
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Nov 20 16:03:46 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 16:03:46 2015 +0000
gfs_tool: Show more than 128 mounted filesystems
Also do the same for DLM too. The maximum is now 1024
filesystems/lockspaces.
rhbz#1243944#1243944#1243944
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
dlm/tool/main.c | 2 +-
group/gfs_control/main.c | 2 +-
group/tool/main.c | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlm/tool/main.c b/dlm/tool/main.c
index 4752008..2494549 100644
--- a/dlm/tool/main.c
+++ b/dlm/tool/main.c
@@ -44,7 +44,7 @@ static int verbose;
static int wide;
static int summarize;
-#define MAX_LS 128
+#define MAX_LS 1024
#define MAX_NODES 128
/* from linux/fs/dlm/dlm_internal.h */
diff --git a/group/gfs_control/main.c b/group/gfs_control/main.c
index 12fee97..55446b7 100644
--- a/group/gfs_control/main.c
+++ b/group/gfs_control/main.c
@@ -28,7 +28,7 @@ static int operation;
static int opt_ind;
static int ls_all_nodes;
-#define MAX_MG 128
+#define MAX_MG 1024
#define MAX_NODES 128
struct gfsc_mountgroup mgs[MAX_MG];
diff --git a/group/tool/main.c b/group/tool/main.c
index 33ea9a1..23e2819 100644
--- a/group/tool/main.c
+++ b/group/tool/main.c
@@ -24,9 +24,9 @@
#define GROUP_LIBCPG 3
#define MAX_NODES 128
-#define MAX_LS 128
-#define MAX_MG 128
-#define MAX_GROUPS 128
+#define MAX_LS 1024
+#define MAX_MG 1024
+#define MAX_GROUPS 1024
#define OP_LIST 1
#define OP_DUMP 2
8 years, 5 months
cluster: RHEL6 - cman: Delete tmpfile if ccs_config_validate fails.
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=9cfdf3caa14...
Commit: 9cfdf3caa14da886360ee43162a7d9ea8386fba2
Parent: 8bbfa3a95f00ebe738c3b07ae58a0f1e15d61014
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Nov 20 15:56:59 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 15:56:59 2015 +0000
cman: Delete tmpfile if ccs_config_validate fails.
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
config/tools/xml/ccs_config_validate.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/config/tools/xml/ccs_config_validate.in b/config/tools/xml/ccs_config_validate.in
index 6573fef..4b30c1b 100644
--- a/config/tools/xml/ccs_config_validate.in
+++ b/config/tools/xml/ccs_config_validate.in
@@ -190,6 +190,7 @@ lecho "Updating relaxng schema"
if [ "$updaterelaxng" != 0 ]; then
updateerr="$(ccs_update_schema 2>&1)"
if [ $? != 0 ]; then
+ [ -z "$notempfilerm" ] && rm -f $tempfile
echo "Unable to update relaxng schema: $updateerr" >&2
exit 255
fi
8 years, 5 months
cluster: RHEL6 - cman: Improve node name matching
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=8bbfa3a95f0...
Commit: 8bbfa3a95f00ebe738c3b07ae58a0f1e15d61014
Parent: 23bae572bfed8abde2f03b878505e511ae92a43a
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Nov 20 15:51:46 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 15:51:46 2015 +0000
cman: Improve node name matching
Be more intelligent about matching node names. Instead of just
looking at the short name and the FQDN, we now look at increasingly
more specific names until we match or fail.
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 99ee80d..ce29e4a 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -468,16 +468,19 @@ static int verify_nodename(struct objdb_iface_ver0 *objdb, char *node)
if (nodelist_byname(objdb, cluster_parent_handle, node))
return 0;
- /* If nodename was from uname, try a domain-less version of it */
+ /* If nodename was from uname, try to match with increasingly more
+ * specific versions of it
+ */
strcpy(nodename2, node);
- dot = strchr(nodename2, '.');
- if (dot) {
+ dot = strrchr(nodename2, '.');
+ while (dot) {
*dot = '\0';
if (nodelist_byname(objdb, cluster_parent_handle, nodename2)) {
strcpy(node, nodename2);
return 0;
}
+ dot = strrchr(nodename2, '.');
}
/* If nodename (from uname) is domain-less, try to match against
8 years, 5 months
cluster: RHEL6 - libcman: Don't segfault if /dev/zero doesn't exist
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=23bae572bfe...
Commit: 23bae572bfed8abde2f03b878505e511ae92a43a
Parent: 04d4a74883ae3e33ceafd72c03f09eb5e75a33a5
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Nov 20 15:48:26 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 15:48:26 2015 +0000
libcman: Don't segfault if /dev/zero doesn't exist
Patch taken from stable32 branch
rhbz#1171241#1171241#1171241
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/lib/libcman.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/cman/lib/libcman.c b/cman/lib/libcman.c
index a99f5a0..1954468 100644
--- a/cman/lib/libcman.c
+++ b/cman/lib/libcman.c
@@ -303,7 +303,7 @@ static cman_handle_t open_socket(const char *name, int namelen, void *privdata)
return NULL;
}
- fcntl(h->fd, F_SETFD, 1); /* Set close-on-exec */
+ fcntl(h->fd, F_SETFD, FD_CLOEXEC);
memset(&sockaddr, 0, sizeof(sockaddr));
memcpy(sockaddr.sun_path, name, namelen);
sockaddr.sun_family = AF_UNIX;
@@ -328,7 +328,10 @@ static cman_handle_t open_socket(const char *name, int namelen, void *privdata)
h = NULL;
errno = saved_errno;
}
- fcntl(h->zero_fd, F_SETFD, 1); /* Set close-on-exec */
+ else
+ {
+ fcntl(h->zero_fd, F_SETFD, FD_CLOEXEC);
+ }
return (cman_handle_t)h;
}
8 years, 5 months
cluster: RHEL6 - fenced: Delay kill due to stateful merge until after
fencing
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=04d4a74883a...
Commit: 04d4a74883ae3e33ceafd72c03f09eb5e75a33a5
Parent: 870ba3e84c99dfa1b36a35ca22dcc37d41b3f501
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Fri Nov 20 14:21:55 2015 +0000
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Fri Nov 20 14:21:55 2015 +0000
fenced: Delay kill due to stateful merge until after fencing
If the cluster merges with state (due to eg a fast disconnect/reconnect)
then delay sending node kill messages until fencing has been attempted.
This stops the 'wrong' node being killed if a two_node cluster splits
& rejoins quickly
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
fence/fenced/cpg.c | 41 ++++++++++++++++++++++++++++++++++++++---
fence/fenced/fd.h | 1 +
fence/fenced/member_cman.c | 11 -----------
3 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index e99e95a..28d8e1d 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -331,6 +331,20 @@ static struct node *get_node_victim(struct fd *fd, int nodeid)
return NULL;
}
+static struct node_history *get_node_history_nodeid(int nodeid)
+{
+ struct fd *fd;
+ struct node_history *node;
+
+ list_for_each_entry(fd, &domains, list) {
+ list_for_each_entry(node, &fd->node_history, list) {
+ if (node->nodeid == nodeid)
+ return node;
+ }
+ }
+ return NULL;
+}
+
static struct node_history *get_node_history(struct fd *fd, int nodeid)
{
struct node_history *node;
@@ -668,6 +682,14 @@ static void receive_victim_done(struct fd *fd, struct fd_header *hd, int len)
nodeh->fence_time_local = time(NULL);
if (hd->nodeid == our_nodeid) {
+ /* We received our own victim_done message. */
+
+ if (nodeh && nodeh->kill_after_fencing) {
+ log_error("kick fence victim %d from cluster", nodeh->nodeid);
+ nodeh->kill_after_fencing = 0;
+ kick_node_from_cluster(nodeh->nodeid);
+ }
+
/* sanity check, I don't think this should happen;
see comment in fence_victims() */
if (node) {
@@ -2068,9 +2090,22 @@ static void receive_protocol(struct fd_header *hd, int len)
quorate_time < node->left_time) {
log_debug("daemon node %d kill due to stateful merge",
hd->nodeid);
- if (!node->killed)
- kick_node_from_cluster(hd->nodeid);
- node->killed = 1;
+ if (!node->killed) {
+ struct node_history *nodeh;
+ nodeh = get_node_history_nodeid(hd->nodeid);
+ if (!nodeh) {
+ log_error("cannot kick node, no node history %d", hd->nodeid);
+ } else if (cluster_quorate && node->left_time &&
+ quorate_time < node->left_time &&
+ nodeh->fence_time >= nodeh->fail_time) {
+ log_error("node %d kill due to stateful merge", hd->nodeid);
+ kick_node_from_cluster(hd->nodeid);
+ } else {
+ log_debug("delay kicking node %d until fencing is done", nodeh->nodeid);
+ nodeh->kill_after_fencing = 1;
+ }
+ node->killed = 1;
+ }
}
/* don't save p->proto into node->proto; we need to come
diff --git a/fence/fenced/fd.h b/fence/fenced/fd.h
index d678bfa..9e8c77e 100644
--- a/fence/fenced/fd.h
+++ b/fence/fenced/fd.h
@@ -141,6 +141,7 @@ struct node_history {
struct list_head list;
int nodeid;
int check_quorum;
+ int kill_after_fencing;
uint64_t add_time;
uint64_t left_time;
uint64_t fail_time;
diff --git a/fence/fenced/member_cman.c b/fence/fenced/member_cman.c
index ced4272..a7f4341 100644
--- a/fence/fenced/member_cman.c
+++ b/fence/fenced/member_cman.c
@@ -32,17 +32,6 @@ void kick_node_from_cluster(int nodeid)
log_error("telling cman to shut down cluster locally");
cman_shutdown(ch_admin, CMAN_SHUTDOWN_ANYWAY);
} else {
-
- /* in a two_node cluster where both nodes maintain quorum
- * by themselves during a partition+merge, both will kick
- * the other, which can leave both dead and unfenced.
- * this delay should help */
-
- if (two_node_mode && our_nodeid > nodeid) {
- log_debug("kick_node_from_cluster %d delay", nodeid);
- sleep(5);
- }
-
log_error("telling cman to remove nodeid %d from cluster",
nodeid);
cman_kill_node(ch_admin, nodeid);
8 years, 5 months
gfs2-utils: master - gfs2_edit: Log descriptor continuation blocks print wrong info
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=c6814b82...
Commit: c6814b82a6ea54d5214b29ca9eceb37de5412ea5
Parent: 2ad0448631bdc37a82d6e7db4e48ea48b892716c
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Nov 12 12:08:27 2015 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Nov 12 12:25:33 2015 -0600
gfs2_edit: Log descriptor continuation blocks print wrong info
Log descriptor continuation blocks are printing misleading
information. First, the offset from the start of the journal is
reported incorrectly. Second, it's trying to print the block
types when it shouldn't. The faulty output looks like this:
0x40e9 (j+4093000): Log descriptor continuation block
0x48202b none 0x481e2d none 0x481c2f none 0x481a31 none
In practice, these are used to continue the job of "revoke" log
descriptors, which have no blocks that follow, so it should not
try to report the types of the blocks that follow.
This patch fixes the journal offset calculation and skips the
reporting of the block types that follow, so the output looks
is given correctly as:
0x40e9 (j+4093): Log descriptor continuation block
0x48202b 0x481e2d 0x481c2f 0x481a31
---
gfs2/edit/journal.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gfs2/edit/journal.c b/gfs2/edit/journal.c
index 15e02de..80c8738 100644
--- a/gfs2/edit/journal.c
+++ b/gfs2/edit/journal.c
@@ -610,7 +610,8 @@ void dump_journal(const char *journal, int tblk)
} else if ((ld_blocks > 0) &&
(sbd.gfs1 || block_type == GFS2_METATYPE_LB)) {
print_gfs2("0x%"PRIx64" (j+%4"PRIx64"): Log descriptor"
- " continuation block", abs_block, jb);
+ " continuation block", abs_block,
+ ((jb + wrappt) % j_size) / sbd.bsize);
eol(0);
print_gfs2(" ");
ld_blocks -= print_ld_blks((uint64_t *)dummy_bh.b_data +
@@ -619,7 +620,7 @@ void dump_journal(const char *journal, int tblk)
(dummy_bh.b_data +
sbd.bsize), start_line,
tblk, &tblk_off, 0, rgd,
- 0, 1, NULL, 1);
+ 0, 1, NULL, 0);
} else if (block_type == 0) {
continue;
}
8 years, 5 months