cluster: RHEL55 - resource-agents: Report bad config from vm.sh
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: da220abc1de33c59cef58f23433d434ceab3638f
Parent: 4ad333b7009ada0af3c1a2a5ad8f9815fb67b582
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Oct 30 17:23:03 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 30 17:23:03 2009 -0400
resource-agents: Report bad config from vm.sh
Resolves: rhbz#529926
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index df0c9b7..02bb5ff 100755
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -585,11 +585,24 @@ validate_all()
echo "Management tool: virsh"
export OCF_RESKEY_use_virsh=1
else
+ if [ "$OCF_RESKEY_hypervisor" != "xen" ]; then
+ ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor with 'path' attribute"
+ return $OCF_ERR_ARGS
+ fi
+
echo "Management tool: xm"
export OCF_RESKEY_use_virsh=0
fi
fi
+ if [ "$OCF_RESKEY_use_virsh" = "0" ]; then
+ if [ "$OCF_RESKEY_hypervisor" = "qemu" ] ||
+ [ "$OCF_RESKEY_hypervisor" = "kvm" ]; then
+ ocf_log err "Cannot use $OCF_RESKEY_hypervisor hypervisor without using virsh"
+ return $OCF_ERR_ARGS
+ fi
+ fi
+
#
# Set the hypervisor URI
#
14 years, 6 months
cluster: RHEL55 - qdiskd: fix () so that it actually works again
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4ad333b7009ada0af3c1a2a5ad8f9815fb67b582
Parent: fe46f6b6e9ed9a40c37fa60966fafc1cf07e36d2
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Oct 21 12:55:15 2009 +0200
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 30 16:37:46 2009 -0400
qdiskd: fix () so that it actually works again
Resolves: rhbz#511113
Part 4/4
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 250406a..cc18a05 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -894,9 +894,9 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
while (_running) {
/* XXX this was getuptime() in clumanager */
get_time(&oldtime, (ctx->qc_flags&RF_UPTIME));
-
+
/* Read everyone else's status */
- if ( (errors = read_node_blocks(ctx, ni, max) == 0 ))
+ if ((errors = read_node_blocks(ctx, ni, max)) == 0 )
get_time(&rd_lastok, ctx->qc_flags&RF_UPTIME);
/* Check for node transitions */
14 years, 6 months
cluster: RHEL55 - qdisk: Implement I/O timeout for read
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: fe46f6b6e9ed9a40c37fa60966fafc1cf07e36d2
Parent: 8742ae97a69c8cc282faf39d8c1e7bfda441e5b2
Author: Eduardo Damato <edamato(a)redhat.com>
AuthorDate: Tue Sep 29 10:06:26 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 30 16:37:12 2009 -0400
qdisk: Implement I/O timeout for read
This patch creates a timer for last successful read and
reboots the system if last successful read was more than
interval*tko ago.
Resolves: rhbz#511113
Part 3/4
Signed-off-by: Eduardo Damato <edamato(a)redhat.com>
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/main.c | 32 ++++++++++++++++++++++++++------
1 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index b698f2c..250406a 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -867,7 +867,7 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
int low_id, bid_pending = 0, score, score_max, score_req,
upgrade = 0, count, errors, error_cycles = 0;
memb_mask_t mask, master_mask;
- struct timeval maxtime, oldtime, newtime, diff, sleeptime, interval, lastok;
+ struct timeval maxtime, oldtime, newtime, diff, sleeptime, interval, rd_lastok, wr_lastok;
ctx->qc_status = S_NONE;
@@ -877,8 +877,11 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
interval.tv_usec = 0;
interval.tv_sec = ctx->qc_interval;
- lastok.tv_usec = 0;
- lastok.tv_sec = 0;
+ rd_lastok.tv_usec = 0;
+ rd_lastok.tv_sec = 0;
+
+ wr_lastok.tv_usec = 0;
+ wr_lastok.tv_sec = 0;
get_my_score(&score, &score_max);
if (score_max < ctx->qc_scoremin) {
@@ -893,7 +896,8 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
get_time(&oldtime, (ctx->qc_flags&RF_UPTIME));
/* Read everyone else's status */
- errors = read_node_blocks(ctx, ni, max);
+ if ( (errors = read_node_blocks(ctx, ni, max) == 0 ))
+ get_time(&rd_lastok, ctx->qc_flags&RF_UPTIME);
/* Check for node transitions */
check_transitions(ctx, ni, max, mask);
@@ -1069,7 +1073,7 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
errors++; /* this value isn't really used
at this point */
} else {
- get_time(&lastok, ctx->qc_flags&RF_UPTIME);
+ get_time(&wr_lastok, ctx->qc_flags&RF_UPTIME);
}
/* write out our local status */
@@ -1082,7 +1086,7 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
/*
* Reboot if the last successful hearbeat was longer ago than interval*TKO_COUNT
*/
- _diff_tv(&diff, &lastok, &newtime);
+ _diff_tv(&diff, &wr_lastok, &newtime);
if (_cmp_tv(&maxtime, &diff) == 1 &&
ctx->qc_flags & RF_IOTIMEOUT) {
clulog(LOG_EMERG, "Failed to send a heartbeat within "
@@ -1094,6 +1098,22 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
if (!(ctx->qc_flags & RF_DEBUG))
reboot(RB_AUTOBOOT);
}
+
+ /*
+ * Reboot if the last successful hearbeat was longer ago than interval*TKO_COUNT
+ */
+ _diff_tv(&diff, &rd_lastok, &newtime);
+ if (_cmp_tv(&maxtime, &diff) == 1 &&
+ ctx->qc_flags & RF_IOTIMEOUT) {
+ clulog(LOG_EMERG, "Failed to read from qdisk within "
+ "%d second%s (%d.%06d) - REBOOTING\n",
+ (int)maxtime.tv_sec,
+ maxtime.tv_sec==1?"":"s",
+ (int)diff.tv_sec,
+ (int)diff.tv_usec);
+ if (!(ctx->qc_flags & RF_DEBUG))
+ reboot(RB_AUTOBOOT);
+ }
/*
* Reboot if we didn't send a heartbeat in interval*TKO_COUNT
14 years, 6 months
cluster: RHEL55 - qdisk: Disable max_error_cycles when using io_timeout
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 8742ae97a69c8cc282faf39d8c1e7bfda441e5b2
Parent: fe9a89972834d0459c312bede9e4a32df52e445a
Author: Eduardo Damato <edamato(a)redhat.com>
AuthorDate: Tue Sep 29 10:03:09 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 30 16:31:08 2009 -0400
qdisk: Disable max_error_cycles when using io_timeout
Resolves: rgbz#511113
Part 2/4
Signed-off-by: Eduardo Damato <edamato(a)redhat.com>
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/man/qdisk.5 | 6 ++++--
cman/qdisk/main.c | 5 ++++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/cman/man/qdisk.5 b/cman/man/qdisk.5
index 513d56b..7d28f90 100644
--- a/cman/man/qdisk.5
+++ b/cman/man/qdisk.5
@@ -295,7 +295,8 @@ pass. The default for this value is 0 (off).
.in 12
If set to 1 (on), qdiskd will watch internal timers and reboot the node
if qdisk is not able to write to disk after (interval * tko) seconds.
-The default for this value is 0 (off).
+The default for this value is 0 (off). If io_timeout is active
+max_error_cycles is overridden and set to off.
.in 9
\fIscheduler\fP\fB="\fPrr\fB"\fP
@@ -360,7 +361,8 @@ device name.
If we receive an I/O error during a cycle, we do not poll CMAN and tell
it we are alive. If specified, this value will cause qdiskd to exit
after the specified number of consecutive cycles during which I/O errors
-occur. The default is 0 (no maximum).
+occur. The default is 0 (no maximum). This option is ignored if
+io_timeout is set to 1.
.in 8
\fB...>\fP
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index c86759e..b698f2c 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -1425,12 +1425,15 @@ get_config_data(char *cluster_name, qd_ctx *ctx, struct h_data *h, int maxh,
/*
* How many consecutive error cycles do we allow before
* giving up?
+ *
+ * Notice that max_error_cycles is disabled if io_timeout is
+ * active.
*/
/* default = no max */
snprintf(query, sizeof(query), "/cluster/quorumd/@max_error_cycles");
if (ccs_get(ccsfd, query, &val) == 0) {
ctx->qc_max_error_cycles = atoi(val);
- if (ctx->qc_max_error_cycles <= 0)
+ if ((ctx->qc_max_error_cycles <= 0) || (ctx->qc_flags & RF_IOTIMEOUT))
ctx->qc_max_error_cycles = 0;
free(val);
}
14 years, 6 months
cluster: RHEL55 - qdisk: Implement I/O timeouts in qdiskd
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: fe9a89972834d0459c312bede9e4a32df52e445a
Parent: 1efff01c28dadf735cab90433c20a7dcbe3c81ef
Author: Eduardo Damato <edamato(a)redhat.com>
AuthorDate: Tue Sep 29 09:58:18 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Oct 30 16:30:23 2009 -0400
qdisk: Implement I/O timeouts in qdiskd
This allows administrators to make qdiskd reboot the
system if it can not write its status out for interval*tko
seconds.
Resolves: rhbz#511113
Part 1/4
Signed-off-by: Eduardo Damato <edamato(a)redhat.com>
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/man/qdisk.5 | 7 +++++++
cman/qdisk/disk.h | 3 ++-
cman/qdisk/main.c | 34 ++++++++++++++++++++++++++++++++--
3 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/cman/man/qdisk.5 b/cman/man/qdisk.5
index 65b9956..513d56b 100644
--- a/cman/man/qdisk.5
+++ b/cman/man/qdisk.5
@@ -291,6 +291,13 @@ if it takes more than (interval * tko) seconds to complete a quorum disk
pass. The default for this value is 0 (off).
.in 9
+\fIio_timeout\fP\fB="\fP0\fB"\fP
+.in 12
+If set to 1 (on), qdiskd will watch internal timers and reboot the node
+if qdisk is not able to write to disk after (interval * tko) seconds.
+The default for this value is 0 (off).
+
+.in 9
\fIscheduler\fP\fB="\fPrr\fB"\fP
.in 12
Valid values are 'rr', 'fifo', and 'other'. Selects the scheduling queue
diff --git a/cman/qdisk/disk.h b/cman/qdisk/disk.h
index 3509339..0b652b2 100644
--- a/cman/qdisk/disk.h
+++ b/cman/qdisk/disk.h
@@ -73,7 +73,8 @@ typedef enum {
RF_PARANOID = 0x8,
RF_ALLOW_KILL = 0x10,
RF_UPTIME = 0x20,
- RF_CMAN_LABEL = 0x40
+ RF_CMAN_LABEL = 0x40,
+ RF_IOTIMEOUT = 0x80
} run_flag_t;
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 81999a0..c86759e 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -867,7 +867,7 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
int low_id, bid_pending = 0, score, score_max, score_req,
upgrade = 0, count, errors, error_cycles = 0;
memb_mask_t mask, master_mask;
- struct timeval maxtime, oldtime, newtime, diff, sleeptime, interval;
+ struct timeval maxtime, oldtime, newtime, diff, sleeptime, interval, lastok;
ctx->qc_status = S_NONE;
@@ -877,6 +877,9 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
interval.tv_usec = 0;
interval.tv_sec = ctx->qc_interval;
+ lastok.tv_usec = 0;
+ lastok.tv_sec = 0;
+
get_my_score(&score, &score_max);
if (score_max < ctx->qc_scoremin) {
clulog(LOG_WARNING, "Minimum score (%d) is impossible to "
@@ -1065,6 +1068,8 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
clulog(LOG_ERR, "Error writing to quorum disk\n");
errors++; /* this value isn't really used
at this point */
+ } else {
+ get_time(&lastok, ctx->qc_flags&RF_UPTIME);
}
/* write out our local status */
@@ -1073,11 +1078,27 @@ quorum_loop(qd_ctx *ctx, node_info_t *ni, int max)
/* Cycle. We could time the loop and sleep
usleep(interval-looptime), but this is fine for now.*/
get_time(&newtime, ctx->qc_flags&RF_UPTIME);
- _diff_tv(&diff, &oldtime, &newtime);
+ /*
+ * Reboot if the last successful hearbeat was longer ago than interval*TKO_COUNT
+ */
+ _diff_tv(&diff, &lastok, &newtime);
+ if (_cmp_tv(&maxtime, &diff) == 1 &&
+ ctx->qc_flags & RF_IOTIMEOUT) {
+ clulog(LOG_EMERG, "Failed to send a heartbeat within "
+ "%d second%s (%d.%06d) - REBOOTING\n",
+ (int)maxtime.tv_sec,
+ maxtime.tv_sec==1?"":"s",
+ (int)diff.tv_sec,
+ (int)diff.tv_usec);
+ if (!(ctx->qc_flags & RF_DEBUG))
+ reboot(RB_AUTOBOOT);
+ }
+
/*
* Reboot if we didn't send a heartbeat in interval*TKO_COUNT
*/
+ _diff_tv(&diff, &oldtime, &newtime);
if (_cmp_tv(&maxtime, &diff) == 1 &&
ctx->qc_flags & RF_PARANOID) {
clulog(LOG_EMERG, "Failed to complete a cycle within "
@@ -1347,6 +1368,15 @@ get_config_data(char *cluster_name, qd_ctx *ctx, struct h_data *h, int maxh,
free(val);
}
+ /* default = off, so, 1 to turn on */
+ snprintf(query, sizeof(query), "/cluster/quorumd/@io_timeout");
+ if (ccs_get(ccsfd, query, &val) == 0) {
+ if (!atoi(val))
+ ctx->qc_flags &= ~RF_IOTIMEOUT;
+ else
+ ctx->qc_flags |= RF_IOTIMEOUT;
+ free(val);
+ }
/*
* Get flag to see if we're supposed to reboot if we can't complete
14 years, 6 months
resource-agents: master - resource-agents: Fix error messages in apache.sh
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git...
Commit: bf230b3eb1cc4576a001ce173704c398a3f3cef6
Parent: 92b73b0922265e7fc63d8ad0fea1f07a84b7fcf5
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Oct 29 14:40:17 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Oct 29 14:42:55 2009 -0400
resource-agents: Fix error messages in apache.sh
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/apache.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/resources/apache.sh b/rgmanager/src/resources/apache.sh
index bb225aa..ca0325f 100644
--- a/rgmanager/src/resources/apache.sh
+++ b/rgmanager/src/resources/apache.sh
@@ -62,7 +62,7 @@ verify_all()
fi
if [ ! -r "$APACHE_serverConfigFile" ]; then
- clog_check_file_exist $CLOG_FAILED_NOT_READABLE "$APACHE_config_file"
+ clog_check_file_exist $CLOG_FAILED_NOT_READABLE "$APACHE_serverConfigFile"
return $OCF_ERR_ARGS
fi
@@ -80,11 +80,11 @@ verify_all()
$OCF_RESKEY_httpd_options &> /dev/null
if [ $? -ne 0 ]; then
- clog_check_syntax $CLOG_FAILED "$APACHE_config_file"
+ clog_check_syntax $CLOG_FAILED "$APACHE_serverConfigFile"
return $OCF_ERR_GENERIC
fi
- clog_check_syntax $CLOG_SUCCEED "$APACHE_config_file"
+ clog_check_syntax $CLOG_SUCCEED "$APACHE_serverConfigFile"
return 0
}
14 years, 6 months
cluster: STABLE3 - resource-agents: Fix error messages in apache.sh
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 4bd7ebb83bb8dddb6907a20a84ee7d5dd3b31c9c
Parent: 7ad3b039132287a77480ba19bf7ce6c8df1feb94
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Oct 29 14:40:17 2009 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Oct 29 14:40:17 2009 -0400
resource-agents: Fix error messages in apache.sh
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/apache.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/resources/apache.sh b/rgmanager/src/resources/apache.sh
index bb225aa..ca0325f 100644
--- a/rgmanager/src/resources/apache.sh
+++ b/rgmanager/src/resources/apache.sh
@@ -62,7 +62,7 @@ verify_all()
fi
if [ ! -r "$APACHE_serverConfigFile" ]; then
- clog_check_file_exist $CLOG_FAILED_NOT_READABLE "$APACHE_config_file"
+ clog_check_file_exist $CLOG_FAILED_NOT_READABLE "$APACHE_serverConfigFile"
return $OCF_ERR_ARGS
fi
@@ -80,11 +80,11 @@ verify_all()
$OCF_RESKEY_httpd_options &> /dev/null
if [ $? -ne 0 ]; then
- clog_check_syntax $CLOG_FAILED "$APACHE_config_file"
+ clog_check_syntax $CLOG_FAILED "$APACHE_serverConfigFile"
return $OCF_ERR_GENERIC
fi
- clog_check_syntax $CLOG_SUCCEED "$APACHE_config_file"
+ clog_check_syntax $CLOG_SUCCEED "$APACHE_serverConfigFile"
return 0
}
14 years, 6 months
cluster: RHEL4 - dlm-kernel: can_be_granted workaround for user lockspaces
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 18411e7ca35ad8b970bb57192c89ef2b067c8432
Parent: 6397a742c02d186ac97d55dc9ea9d50dbbce2493
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Oct 29 12:23:54 2009 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Oct 29 12:23:54 2009 -0500
dlm-kernel: can_be_granted workaround for user lockspaces
bz 483685
There is a problem in the _can_be_granted() logic regarding the
waitqueue. Normally, a lock request cannot be granted if there's
another lock already on the waitqueue. This gives FIFO fairness.
One of the big problems in the RHEL4 dlm is that the waitqueue is
misused, and locks are kept there while waiting for on a remote
lock request. This can mess up the normal lock granting logic.
Example:
Requests for lkb1 and lkb2 are both sent to another node we think
is master. Both are kept on the rsb waitqueue while waiting for a
reply. The remote node ends up not being the master and returns
EINVAL for lkb1.
Local processing of lkb1 after getting the EINVAL reply:
- lkb1 is removed from the waitqueue
- we look up the master again (resdir is local for this rsb)
- the master ends up being us
- rsb nodeid set to 0
- lkb1 is passed into dlm_lock_stage2 and dlm_lock_stage3
- lkb1 is passed into _can_be_granted
- _can_be_granted sees lkb2 on the waitqueue so says lkb1 cannot
be granted
- so lkb1 is added to the waitqueue (in the proper sense,
i.e. not because it's waiting for a remote reply but because
of the master granting logic)
Local processing of lkb2 after getting its EINVAL reply:
- lkb2 removed from the waitqueue
- we see we are now the master, rsb nodid is 0
- lkb2 is passed into dlm_lock_stage2 and dlm_lock_stage3
- lkb2 is passed into _can_be_granted
- _can_be_granted sees lkb1 on the waitqueue so says lkb2 cannot be
granted
- so lkb2 is added to the waitqueue (again in the proper sense)
Other lock requests then arrive for this rsb, and all continue to
be added to the waitqueue because it's not empty.
This patch makes _can_be_granted return TRUE for locks, like lkb1,
that are being requested/tested by the grant logic for the first
time since being requested, i.e. they are not already on the
waitqueue.
To avoid regressions in this particularly sensitive area of code,
the fix is only enabled for user lockspaces (e.g. clvmd and
rgmanager), and the fix can be disabled by
echo 0 > /proc/cluster/config/dlm/user_grant_now
in case it causes a regression in some user lockspace workload.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm-kernel/src/config.c | 8 +++++++-
dlm-kernel/src/config.h | 1 +
dlm-kernel/src/device.c | 11 +++++++++++
dlm-kernel/src/dlm_internal.h | 1 +
dlm-kernel/src/locking.c | 9 +++++++++
5 files changed, 29 insertions(+), 1 deletions(-)
diff --git a/dlm-kernel/src/config.c b/dlm-kernel/src/config.c
index 2858c4f..3ce052c 100644
--- a/dlm-kernel/src/config.c
+++ b/dlm-kernel/src/config.c
@@ -29,6 +29,7 @@
#define DEFAULT_CONN_INCREMENT 32
#define DEFAULT_DEADLOCKTIME 10
#define DEFAULT_RECOVER_TIMER 5
+#define DEFAULT_USER_GRANT_NOW 1
struct config_info dlm_config = {
.tcp_port = DEFAULT_TCP_PORT,
@@ -40,7 +41,8 @@ struct config_info dlm_config = {
.dirtbl_size = DEFAULT_DIRTBL_SIZE,
.conn_increment = DEFAULT_CONN_INCREMENT,
.deadlocktime = DEFAULT_DEADLOCKTIME,
- .recover_timer = DEFAULT_RECOVER_TIMER
+ .recover_timer = DEFAULT_RECOVER_TIMER,
+ .user_grant_now = DEFAULT_USER_GRANT_NOW
};
@@ -87,6 +89,10 @@ static struct config_proc_info {
{
.name = "recover_timer",
.value = &dlm_config.recover_timer,
+ },
+ {
+ .name = "user_grant_now",
+ .value = &dlm_config.user_grant_now,
}
};
static struct proc_dir_entry *dlm_dir;
diff --git a/dlm-kernel/src/config.h b/dlm-kernel/src/config.h
index 0b37cf4..e0dab07 100644
--- a/dlm-kernel/src/config.h
+++ b/dlm-kernel/src/config.h
@@ -25,6 +25,7 @@ struct config_info {
int conn_increment;
int deadlocktime;
int recover_timer;
+ int user_grant_now;
};
extern struct config_info dlm_config;
diff --git a/dlm-kernel/src/device.c b/dlm-kernel/src/device.c
index d7afeaf..44e1379 100644
--- a/dlm-kernel/src/device.c
+++ b/dlm-kernel/src/device.c
@@ -37,6 +37,8 @@
#include "dlm_internal.h"
#include "device.h"
+#include "config.h"
+#include "lockspace.h"
extern struct dlm_lkb *dlm_get_lkb(struct dlm_ls *, int);
static struct file_operations _dlm_fops;
@@ -179,6 +181,7 @@ static void add_lockspace_to_list(struct user_ls *lsinfo)
device for userland to access it */
static int register_lockspace(char *name, struct user_ls **ls, int flags)
{
+ struct dlm_ls *dlmls;
struct user_ls *newls;
int status;
int namelen;
@@ -223,6 +226,14 @@ static int register_lockspace(char *name, struct user_ls **ls, int flags)
if (flags & DLM_USER_LSFLG_DEFAULTLS)
set_bit(LS_FLAG_DEFAULT, &newls->ls_flags);
+ dlmls = find_lockspace_by_name(name, strlen(name));
+ if (!dlmls) {
+ log_print("skip GRANT_NOW flag, lockspace not found");
+ } else {
+ if (dlm_config.user_grant_now)
+ set_bit(LSFL_USER_GRANT_NOW, &dlmls->ls_flags);
+ }
+
add_lockspace_to_list(newls);
*ls = newls;
return 0;
diff --git a/dlm-kernel/src/dlm_internal.h b/dlm-kernel/src/dlm_internal.h
index 3400ee7..ed54db3 100644
--- a/dlm-kernel/src/dlm_internal.h
+++ b/dlm-kernel/src/dlm_internal.h
@@ -232,6 +232,7 @@ struct dlm_recover {
#define LSFL_ALL_NODES_VALID (11)
#define LSFL_REQUEST_WARN (12)
#define LSFL_RECOVERD_EXIT (13)
+#define LSFL_USER_GRANT_NOW (14)
#define LSST_NONE (0)
#define LSST_INIT (1)
diff --git a/dlm-kernel/src/locking.c b/dlm-kernel/src/locking.c
index 51be67d..73897e9 100644
--- a/dlm-kernel/src/locking.c
+++ b/dlm-kernel/src/locking.c
@@ -229,6 +229,7 @@ static int conversion_deadlock_detect(struct dlm_rsb *rsb, struct dlm_lkb *lkb)
static int _can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now)
{
+ struct dlm_ls *ls = r->res_ls;
int8_t conv = (lkb->lkb_grmode != DLM_LOCK_IV);
/*
@@ -340,6 +341,14 @@ static int _can_be_granted(struct dlm_rsb *r, struct dlm_lkb *lkb, int now)
first_in_list(lkb, &r->res_waitqueue))
return TRUE;
+ /* special case for
+ https://bugzilla.redhat.com/show_bug.cgi?id=483685 */
+
+ if (test_bit(LSFL_USER_GRANT_NOW, &ls->ls_flags) &&
+ now && !conv && list_empty(&r->res_convertqueue) &&
+ list_empty(&r->res_grantqueue))
+ return TRUE;
+
out:
/*
* The following, enabled by CONVDEADLK, departs from VMS.
14 years, 6 months
cluster: STABLE3 - Fence agents: Fix traceback when using any SNMP agent
by Jan Friesse
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 7ad3b039132287a77480ba19bf7ce6c8df1feb94
Parent: f6f23734ebb47d6ed18bad53faf19fd25ff76c28
Author: Jan Friesse <jfriesse(a)redhat.com>
AuthorDate: Thu Oct 29 11:52:44 2009 +0100
Committer: Jan Friesse <jfriesse(a)redhat.com>
CommitterDate: Thu Oct 29 11:56:22 2009 +0100
Fence agents: Fix traceback when using any SNMP agent
Main problem was hidden in forgotten "self" in
fencing_snmp caused by commit:
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
Date: Fri Oct 9 13:36:25 2009 +0200
fencing: Timeout options added
RHBZ#531724
---
fence/agents/lib/fencing_snmp.py.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/fencing_snmp.py.py b/fence/agents/lib/fencing_snmp.py.py
index d6f6ab4..94f5af5 100644
--- a/fence/agents/lib/fencing_snmp.py.py
+++ b/fence/agents/lib/fencing_snmp.py.py
@@ -80,7 +80,7 @@ class FencingSnmp:
try:
self.log_command(command)
- (res_output,res_code)=pexpect.run(command,int(options["-Y"])+int(options["-y"])+additional_timemout,True)
+ (res_output,res_code)=pexpect.run(command,int(self.options["-Y"])+int(self.options["-y"])+additional_timemout,True)
if (res_code==None):
fail(EC_TIMED_OUT)
14 years, 6 months
fence-agents: master - Fence agents: Fix traceback when using any SNMP agent
by Jan Friesse
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: dd4badc487c104422a389e7b5a18921beb5459fa
Parent: cd8c9ee12db21f53586c60c58f35745b19f9d71c
Author: Jan Friesse <jfriesse(a)redhat.com>
AuthorDate: Thu Oct 29 11:52:44 2009 +0100
Committer: Jan Friesse <jfriesse(a)redhat.com>
CommitterDate: Thu Oct 29 11:52:44 2009 +0100
Fence agents: Fix traceback when using any SNMP agent
Main problem was hidden in forgotten "self" in
fencing_snmp caused by commit:
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
Date: Fri Oct 9 13:36:25 2009 +0200
fencing: Timeout options added
RHBZ#531724
---
fence/agents/lib/fencing_snmp.py.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/fencing_snmp.py.py b/fence/agents/lib/fencing_snmp.py.py
index d6f6ab4..94f5af5 100644
--- a/fence/agents/lib/fencing_snmp.py.py
+++ b/fence/agents/lib/fencing_snmp.py.py
@@ -80,7 +80,7 @@ class FencingSnmp:
try:
self.log_command(command)
- (res_output,res_code)=pexpect.run(command,int(options["-Y"])+int(options["-y"])+additional_timemout,True)
+ (res_output,res_code)=pexpect.run(command,int(self.options["-Y"])+int(self.options["-y"])+additional_timemout,True)
if (res_code==None):
fail(EC_TIMED_OUT)
14 years, 6 months