diff options
| author | Kaushal M <kaushal@redhat.com> | 2013-04-19 15:16:56 +0530 | 
|---|---|---|
| committer | Vijay Bellur <vbellur@redhat.com> | 2013-05-28 22:01:43 -0700 | 
| commit | 7d0cf52a344e476963fe97e71f86488d5bb17b1c (patch) | |
| tree | 393e54f17ff9ef176b66165715abfc45875a424d /xlators/mgmt/glusterd/src/glusterd-utils.c | |
| parent | ea982a764b7cb447eb866129fef2cfafaa48eb6a (diff) | |
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 <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4866
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
| -rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 24 | 
1 files changed, 23 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 27b974796ad..65cc2df967d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -7528,7 +7528,8 @@ _update_volume_op_versions (dict_t *this, char *key, data_t *value, void *data)  void  gd_update_volume_op_versions (glusterd_volinfo_t *volinfo)  { -        glusterd_conf_t    *conf = NULL; +        glusterd_conf_t *conf = NULL; +        gf_boolean_t    ob_enabled = _gf_false;          GF_ASSERT (volinfo); @@ -7541,5 +7542,26 @@ gd_update_volume_op_versions (glusterd_volinfo_t *volinfo)          dict_foreach (volinfo->dict, _update_volume_op_versions, volinfo); +        /* Special case for open-behind +         * If cluster op-version >= 2 and open-behind hasn't been explicitly +         * disabled, volume op-versions must be updated to account for it +         */ + +        /* TODO: Remove once we have a general way to update automatically +         * enabled features +         */ +        if (conf->op_version >= 2) { +                ob_enabled = dict_get_str_boolean (volinfo->dict, +                                                   "performance.open-behind", +                                                   _gf_true); +                if (ob_enabled) { + +                        if (volinfo->op_version < 2) +                                volinfo->op_version = 2; +                        if (volinfo->client_op_version < 2) +                                volinfo->client_op_version = 2; +                } +        } +          return;  }  | 
