Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f6…
Commit: f6994d1db1688140ae011c733efdbaa0af6808fb
Parent: 41a8154dbe97608a45bcd80666b7b5f74527a5f9
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Mar 31 15:51:27 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Mar 31 15:53:27 2010 -0500
gfs_controld: set last_plock_time for ownership operations
last_plock_time was not being set for ops related to ownership mode
like "own" and "drop" which change the plock state that is saved in
checkpoints. Not changing last_plock_time means we don't detect
that plock state has changed when it has, and may end up reusing an
old checkpoint, causing a mounting node to read incorrect resource
ownership state.
bz 578626
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/gfs_controld/plock.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c
index 39113cf..710e73a 100644
--- a/group/gfs_controld/plock.c
+++ b/group/gfs_controld/plock.c
@@ -1034,6 +1034,8 @@ static void _receive_own(struct mountgroup *mg, char *buf, int len, int from)
int should_not_happen = 0;
int rv;
+ mg->last_plock_time = time(NULL);
+
memcpy(&info, buf + sizeof(struct gdlm_header), sizeof(info));
info_bswap_in(&info);
@@ -1200,6 +1202,8 @@ static void _receive_sync(struct mountgroup *mg, char *buf, int len, int from)
struct resource *r;
int rv;
+ mg->last_plock_time = time(NULL);
+
memcpy(&info, buf + sizeof(struct gdlm_header), sizeof(info));
info_bswap_in(&info);
@@ -1245,6 +1249,8 @@ static void _receive_drop(struct mountgroup *mg, char *buf, int len, int from)
struct resource *r;
int rv;
+ mg->last_plock_time = time(NULL);
+
memcpy(&info, buf + sizeof(struct gdlm_header), sizeof(info));
info_bswap_in(&info);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=46…
Commit: 46ae11537137ce73b55b67343e67c6c469fdddd1
Parent: e2ccbf90543cf1d163d1a067bf5a8ce049a9c134
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Mar 31 15:05:49 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Mar 31 15:41:28 2010 -0500
dlm_controld: set last_plock_time for ownership operations
last_plock_time was not being set for ops related to ownership mode
like "own" and "drop" which change the plock state that is saved in
checkpoints. Not changing last_plock_time means we don't detect
that plock state has changed when it has, and may end up reusing an
old checkpoint, causing a mounting node to read incorrect resource
ownership state.
bz 578626
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/plock.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c
index 1321af4..a534300 100644
--- a/group/dlm_controld/plock.c
+++ b/group/dlm_controld/plock.c
@@ -1073,6 +1073,8 @@ static void _receive_own(struct lockspace *ls, struct dlm_header *hd, int len)
int from = hd->nodeid;
int rv;
+ ls->last_plock_time = time(NULL);
+
memcpy(&info, (char *)hd + sizeof(struct dlm_header), sizeof(info));
info_bswap_in(&info);
@@ -1245,6 +1247,8 @@ static void _receive_sync(struct lockspace *ls, struct dlm_header *hd, int len)
int from = hd->nodeid;
int rv;
+ ls->last_plock_time = time(NULL);
+
memcpy(&info, (char *)hd + sizeof(struct dlm_header), sizeof(info));
info_bswap_in(&info);
@@ -1290,6 +1294,8 @@ static void _receive_drop(struct lockspace *ls, struct dlm_header *hd, int len)
int from = hd->nodeid;
int rv;
+ ls->last_plock_time = time(NULL);
+
memcpy(&info, (char *)hd + sizeof(struct dlm_header), sizeof(info));
info_bswap_in(&info);
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=58…
Commit: 58a768b6e836ad6406a3da7d71138e2d4ccbe7aa
Parent: b3d878676e3f1984ae8e830c176f0a83443f97c7
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 9 16:53:33 2009 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Mar 29 11:11:09 2010 -0500
groupd: clean up leaving failed node
bz 521817
Due to shutdown+failure scenarios that aren't fully understood,
a node that fails while shutting down can cause the other nodes
to get stuck trying to restart the clvmd group (whether other
groups could be affected is unknown.)
The other nodes will all show something like this from group_tool -v:
dlm 1 clvmd 00010002 LEAVE_STOP_WAIT 1 100020002 1
and group_tool dump will show things like:
1260396236 1:clvmd waiting for 1 more stopped messages before LEAVE_ALL_STOPPED 1
1260396236 1:clvmd waiting for 1 more stopped messages before LEAVE_ALL_STOPPED 1
This fix is to more or less watch out for this very specific
situation where things get messed up and forcibly clean things
up so the other nodes aren't stuck.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/daemon/app.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/group/daemon/app.c b/group/daemon/app.c
index df17896..03952df 100644
--- a/group/daemon/app.c
+++ b/group/daemon/app.c
@@ -228,6 +228,8 @@ struct recovery_set *get_recovery_set(int nodeid)
and goes away, and then we get the add_recovery_set_cpg() matching
the _cman() variant that we ignored? */
+static void clean_up_dead_node(int nodeid);
+
void add_recovery_set_cman(int nodeid)
{
struct recovery_set *rs;
@@ -245,6 +247,9 @@ void add_recovery_set_cman(int nodeid)
log_debug("free recovery set %d not running groupd", nodeid);
list_del(&rs->list);
free(rs);
+
+ clean_up_dead_node(nodeid);
+
return;
}
@@ -1845,3 +1850,39 @@ void groupd_down(int nodeid)
}
}
+/* More hacks to try to work around similar kinds of problems that don't
+ make much sense, bz 521817. I believe the following produces effectively
+ the same problem as in the bz, on one node:
+ service cman start (with groupd -s0, not sure if this could happen otherwise)
+ service clvmd start
+ killall -9 dlm_controld
+ killall -9 groupd
+ killall -9 aisexec
+
+ At this point, the clvmd group in groupd on the other nodes is stuck in
+ LEAVE_ALL_STOPPED waiting for a stopped message from the killed node.
+ The groupd cpg confchg would ordinarily clean things up, but that probably
+ doesn't do anything because the event type is LEAVE instead of a failure.
+ Another way to deal with this would possibly be to do it when we see
+ the nodeid leave the groupd cpg. */
+
+static void clean_up_dead_node(int nodeid)
+{
+ group_t *g;
+ event_t *ev;
+
+ list_for_each_entry(g, &gd_groups, list) {
+ if (g->app && g->app->current_event &&
+ g->app->current_event->nodeid == nodeid) {
+ ev = g->app->current_event;
+
+ log_group(g, "clean_up_dead_node %d ev %d", nodeid,
+ ev->state);
+
+ if (ev->state == EST_LEAVE_STOP_WAIT) {
+ mark_node_stopped(g->app, nodeid);
+ }
+ }
+ }
+}
+
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=97…
Commit: 971ae8c3478df85910f65ea26dd29b37c7ad0a06
Parent: dc78211c8df17704c76ef968f7850495094f8c03
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Dec 9 16:53:33 2009 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Mar 29 11:09:58 2010 -0500
groupd: clean up leaving failed node
bz 521817
Due to shutdown+failure scenarios that aren't fully understood,
a node that fails while shutting down can cause the other nodes
to get stuck trying to restart the clvmd group (whether other
groups could be affected is unknown.)
The other nodes will all show something like this from group_tool -v:
dlm 1 clvmd 00010002 LEAVE_STOP_WAIT 1 100020002 1
and group_tool dump will show things like:
1260396236 1:clvmd waiting for 1 more stopped messages before LEAVE_ALL_STOPPED 1
1260396236 1:clvmd waiting for 1 more stopped messages before LEAVE_ALL_STOPPED 1
This fix is to more or less watch out for this very specific
situation where things get messed up and forcibly clean things
up so the other nodes aren't stuck.
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/daemon/app.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/group/daemon/app.c b/group/daemon/app.c
index df17896..03952df 100644
--- a/group/daemon/app.c
+++ b/group/daemon/app.c
@@ -228,6 +228,8 @@ struct recovery_set *get_recovery_set(int nodeid)
and goes away, and then we get the add_recovery_set_cpg() matching
the _cman() variant that we ignored? */
+static void clean_up_dead_node(int nodeid);
+
void add_recovery_set_cman(int nodeid)
{
struct recovery_set *rs;
@@ -245,6 +247,9 @@ void add_recovery_set_cman(int nodeid)
log_debug("free recovery set %d not running groupd", nodeid);
list_del(&rs->list);
free(rs);
+
+ clean_up_dead_node(nodeid);
+
return;
}
@@ -1845,3 +1850,39 @@ void groupd_down(int nodeid)
}
}
+/* More hacks to try to work around similar kinds of problems that don't
+ make much sense, bz 521817. I believe the following produces effectively
+ the same problem as in the bz, on one node:
+ service cman start (with groupd -s0, not sure if this could happen otherwise)
+ service clvmd start
+ killall -9 dlm_controld
+ killall -9 groupd
+ killall -9 aisexec
+
+ At this point, the clvmd group in groupd on the other nodes is stuck in
+ LEAVE_ALL_STOPPED waiting for a stopped message from the killed node.
+ The groupd cpg confchg would ordinarily clean things up, but that probably
+ doesn't do anything because the event type is LEAVE instead of a failure.
+ Another way to deal with this would possibly be to do it when we see
+ the nodeid leave the groupd cpg. */
+
+static void clean_up_dead_node(int nodeid)
+{
+ group_t *g;
+ event_t *ev;
+
+ list_for_each_entry(g, &gd_groups, list) {
+ if (g->app && g->app->current_event &&
+ g->app->current_event->nodeid == nodeid) {
+ ev = g->app->current_event;
+
+ log_group(g, "clean_up_dead_node %d ev %d", nodeid,
+ ev->state);
+
+ if (ev->state == EST_LEAVE_STOP_WAIT) {
+ mark_node_stopped(g->app, nodeid);
+ }
+ }
+ }
+}
+