From 4af3ddd26b53ea2f2d7923ba097946deee46f527 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 18 May 2016 11:21:39 +0000 Subject: Revert glusterd/afr: store afr pending xattrs as a volume option This patch reverts changes introduced by commit 6e635284a4411b816d4d860a28262c9e6dc4bd6a in the release-3.8 branch. The commit itself was inherited from http://review.gluster.org/#/c/12738/ in master when the branch was created. Reverting it for the same reason it was reverted in 3.7 branch as well: It breaks the rolling upgrade scenario and these changes will be required only when server side AFR materializes, possibly for gluster 4.0. Change-Id: Ib3bb78994d7375f7c34df9897dfaf653ea909924 BUG: 1337130 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/14414 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/cluster/afr/src/afr.c | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) (limited to 'xlators/cluster/afr/src') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index d01a806fe86..bc417a4a2c8 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -259,8 +259,6 @@ init (xlator_t *this) int read_subvol_index = -1; xlator_t *fav_child = NULL; char *qtype = NULL; - char *xattrs_list = NULL; - char *ptr = NULL; if (!this->children) { gf_msg (this->name, GF_LOG_ERROR, 0, @@ -433,7 +431,6 @@ init (xlator_t *this) goto out; } - GF_OPTION_INIT ("afr-pending-xattr", xattrs_list, str, out); priv->pending_key = GF_CALLOC (sizeof (*priv->pending_key), child_count, gf_afr_mt_char); @@ -441,32 +438,20 @@ init (xlator_t *this) ret = -ENOMEM; goto out; } - if (!xattrs_list) { - ret = -EINVAL; - gf_msg (this->name, GF_LOG_ERROR, -ret, AFR_MSG_NO_CHANGELOG, - "Unable to fetch afr pending changelogs. Is op-version" - " >= 30707?"); - goto out; - } - ptr = gf_strdup (xattrs_list); - if (!ptr) { - ret = -ENOMEM; - goto out; - } - for (i = 0, ptr = strtok (ptr, ","); ptr; ptr = strtok (NULL, ",")) { - ret = gf_asprintf (&priv->pending_key[i], "%s.%s", - AFR_XATTR_PREFIX, ptr); - if (ret == -1) { - ret = -ENOMEM; - goto out; - } - i++; - } trav = this->children; i = 0; while (i < child_count) { priv->children[i] = trav->xlator; + + ret = gf_asprintf (&priv->pending_key[i], "%s.%s", + AFR_XATTR_PREFIX, + trav->xlator->name); + if (-1 == ret) { + ret = -ENOMEM; + goto out; + } + trav = trav->next; i++; } @@ -502,7 +487,6 @@ init (xlator_t *this) ret = 0; out: - GF_FREE (ptr); return ret; } @@ -843,11 +827,6 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_STR, .default_value = AFR_DIRTY_DEFAULT, }, - { .key = {"afr-pending-xattr"}, - .type = GF_OPTION_TYPE_STR, - .description = "Comma seperated list of xattrs that are used to " - "capture information on pending heals." - }, { .key = {"metadata-splitbrain-forced-heal"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "off", -- cgit