diff options
author | Kaushal M <kaushal@redhat.com> | 2013-04-19 15:16:56 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-06-05 05:26:55 -0700 |
commit | e59bce74ca3f684c82d028a4166f9fb647e58881 (patch) | |
tree | 5aa3270d2ee784683ddc86fc3a306535525934b8 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 6cfc9c7f1d447451dc3d4af02a22058b861235eb (diff) |
glusterd-volgen: Enable open-behind based on op-version
Backport of patch on master branch, under review at
http://review.gluster.org/4866
This patch enables the open-behind by default only when the op-version
allows it. Also the volume op-version calculations take account of this
enablement.
BUG: 954256
Change-Id: Ie739bc23ba90ec2f009feecef28187912a37487c
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/5095
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index aa0543609..acd851663 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1619,6 +1619,19 @@ glusterd_op_set_volume (dict_t *dict) goto out; } + /* Update the cluster op-version before regenerating volfiles so that + * correct volfiles are generated + */ + if (new_op_version > priv->op_version) { + priv->op_version = new_op_version; + ret = glusterd_store_global_info (this); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, + "Failed to store op-version"); + goto out; + } + } + if (!global_opt) { ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { @@ -1672,16 +1685,6 @@ glusterd_op_set_volume (dict_t *dict) } } - if (new_op_version > priv->op_version) { - priv->op_version = new_op_version; - ret = glusterd_store_global_info (this); - if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "Failed to store op-version"); - goto out; - } - } - out: GF_FREE (key_fixed); gf_log (this->name, GF_LOG_DEBUG, "returning %d", ret); |