summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2018-08-27 12:18:21 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-08-27 11:37:19 +0000
commit1b499e9dfe63ce051a071cacc19e3161b7a32636 (patch)
treec96c434734d1334b2864e8c997c61f57e34f6941 /xlators/mgmt/glusterd
parenta03f31290674d1a446e9551aabb1e306fc9064a8 (diff)
glusterd: glusterd_brick_start shouldn't cleanup pidfile if only_connect is true
Problem: Sometime glusterd cleanup pidfile even brick is started and cli shows volume status "N/A" Solution: Update the condition in glusterd_brick_start to avoid pidfile cleanup in case if only_connect flag is true Fixes: bz#1622422 Change-Id: I8decb34597126b848e3a44d957e138833dd97350 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 40fd4bb83f2..9a3353a1e50 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -6177,6 +6177,8 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
brickpath = search_brick_path_from_proc
(pid, brickinfo->path);
if (!brickpath) {
+ if (only_connect)
+ return 0;
gf_log (this->name, GF_LOG_INFO,
"Either pid %d is not running or brick"
" path %s is not consumed so cleanup pidfile",
@@ -6187,14 +6189,14 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
if (sys_access (pidfile , R_OK) == 0) {
sys_unlink (pidfile);
}
- if (only_connect)
- return 0;
goto run;
}
GF_FREE (brickpath);
ret = glusterd_get_sock_from_brick_pid (pid, socketpath,
sizeof(socketpath));
if (ret) {
+ if (only_connect)
+ return 0;
gf_log (this->name, GF_LOG_INFO,
"Either pid %d is not running or does "
"not match with any running brick "
@@ -6203,8 +6205,6 @@ glusterd_brick_start (glusterd_volinfo_t *volinfo,
if (sys_access (pidfile , R_OK) == 0) {
sys_unlink (pidfile);
}
- if (only_connect)
- return 0;
goto run;
}
}