summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2013-04-19 15:16:56 +0530
committerVijay Bellur <vbellur@redhat.com>2013-06-05 05:26:55 -0700
commite59bce74ca3f684c82d028a4166f9fb647e58881 (patch)
tree5aa3270d2ee784683ddc86fc3a306535525934b8 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent6cfc9c7f1d447451dc3d4af02a22058b861235eb (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-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c24
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 94bfe5fe137..0309a539cbe 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -7516,7 +7516,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);
@@ -7529,5 +7530,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;
}