summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
diff options
context:
space:
mode:
authorKaushal M <kaushal@gluster.com>2011-08-10 17:57:04 +0530
committerAnand Avati <avati@gluster.com>2011-08-17 21:02:23 -0700
commitc0180cc22f5f52f5776c74a6d1ae90100dbb5087 (patch)
tree4afb66cab55a76e7783ff7492d4a2141da3286ba /xlators/mgmt
parentcef6d3596fcbda71c19e66c5a6de502847aece9e (diff)
glusterd: fix for volume stop causing inconsistent volume status
This fixes problem caused by race between glusterd and glusterfsd occuring when they try to unlink pidfile during volume stop, which led to the volume being stopped, but the status of the volume remained in started state. Change-Id: Ia99bb1a1fc6c78db138211538dfd10c577e82917 BUG: 3147 Reviewed-on: http://review.gluster.com/206 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 1cdb0faa4..fb7f75c52 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -886,6 +886,9 @@ glusterd_service_stop (const char *service, char *pidfile, int sig,
if (ret && (ENOENT != errno)) {
gf_log ("", GF_LOG_ERROR, "Unable to "
"unlink stale pidfile: %s", pidfile);
+ } else if (ret && (ENOENT == errno)){
+ ret = 0;
+ gf_log ("", GF_LOG_INFO, "Brick already stopped");
}
goto out;
}
@@ -1224,7 +1227,7 @@ glusterd_volume_stop_glusterfs (glusterd_volinfo_t *volinfo,
ret = glusterd_service_stop ("brick", pidfile, SIGTERM, _gf_false);
if (ret == 0) {
glusterd_set_brick_status (brickinfo, GF_BRICK_STOPPED);
- ret = glusterd_brick_unlink_socket_file (volinfo, brickinfo);
+ (void) glusterd_brick_unlink_socket_file (volinfo, brickinfo);
}
return ret;
}