summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-05-28 15:31:36 +0530
committerAnand Avati <avati@redhat.com>2012-06-01 15:37:32 -0700
commit1904ef07f6b0f71e4b01a505c95606a7e364596e (patch)
tree786c452905685773386492940d234e2064580332
parent1d799568db8e5dc068795c53b864aa355040be15 (diff)
glusterd: regenerate brick vol-files on upgrade
If upgrade/downgrade option is set in glusterd it terminates after the volfiles are regenerated. No need for 'sleep 10' hack anymore. BUG: 825872 Change-Id: I12e666eb871aad7e7efa954b9307993952745d92 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3482 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
-rw-r--r--glusterfs.spec.in7
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c5
2 files changed, 8 insertions, 4 deletions
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 8d017484010..e607c811e65 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -325,11 +325,10 @@ if [ $? -eq 0 ]; then
killall glusterd &> /dev/null
#add marker translator
- glusterd --xlator-option *.upgrade=on
+ glusterd --xlator-option *.upgrade=on -N
+ glusterd
else
- glusterd --xlator-option *.upgrade=on
- sleep 10
- killall glusterd &> /dev/null
+ glusterd --xlator-option *.upgrade=on -N
fi
%preun server
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index b3b39a1f59b..da778f1e230 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4984,6 +4984,7 @@ glusterd_handle_upgrade_downgrade (dict_t *options, glusterd_conf_t *conf)
gf_boolean_t upgrade = _gf_false;
gf_boolean_t downgrade = _gf_false;
gf_boolean_t regenerate_brick_volfiles = _gf_false;
+ gf_boolean_t terminate = _gf_false;
ret = dict_get_str (options, "upgrade", &type);
if (!ret) {
@@ -5018,10 +5019,14 @@ glusterd_handle_upgrade_downgrade (dict_t *options, glusterd_conf_t *conf)
if (!upgrade && !downgrade)
ret = 0;
+ else
+ terminate = _gf_true;
if (regenerate_brick_volfiles) {
ret = glusterd_recreate_bricks (conf);
}
out:
+ if (terminate && (ret == 0))
+ kill (getpid(), SIGTERM);
return ret;
}