From 7d0cf52a344e476963fe97e71f86488d5bb17b1c Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Fri, 19 Apr 2013 15:16:56 +0530 Subject: glusterd-volgen: Enable open-behind based on op-version 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. Change-Id: Idf7a3c274ec4828aafc815cdd1df829ecb853354 BUG: 954256 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/4866 Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index dbc23525fe2..7f19be07212 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1629,6 +1629,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) { @@ -1682,16 +1695,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); -- cgit