summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Kumar Acharya <sheggodu@redhat.com>2017-02-27 15:35:17 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2017-03-24 09:35:16 -0400
commitb1b4b1bc4778bbad955bb0039e3f10b7d7536ea8 (patch)
treeb760d592312a80fad3b6f64361923bac5f83c9f0
parentc986f10adfbc5d4f728ea84640cc1c81532105ae (diff)
cluster/ec: Metadata healing fails to update the version
During meatadata heal, we were not updating the version though all the inode attributes were in sync. Updated the code to adjust version when all the inode attributes are in sync. >BUG: 1425703 >Change-Id: I6723be3c5f748b286d4efdaf3c71e9d2087c7235 >Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com> >Reviewed-on: https://review.gluster.org/16772 >Smoke: Gluster Build System <jenkins@build.gluster.org> >Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> >CentOS-regression: Gluster Build System <jenkins@build.gluster.org> BUG: 1434296 Change-Id: I07fe126ebb7dac0b0de0f41cae139790e7eb4b37 Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com> Reviewed-on: https://review.gluster.org/16932 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
-rw-r--r--xlators/cluster/ec/src/ec-heal.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c
index 19ba5787006..e4f9c0e3539 100644
--- a/xlators/cluster/ec/src/ec-heal.c
+++ b/xlators/cluster/ec/src/ec-heal.c
@@ -410,6 +410,8 @@ ec_adjust_versions (call_frame_t *frame, ec_t *ec, ec_txn_t type,
if (EC_COUNT (sources, ec->nodes) +
EC_COUNT (healed_sinks, ec->nodes) == ec->nodes)
erase_dirty = _gf_true;
+ else
+ op_ret = -ENOTCONN;
for (i = 0; i < ec->nodes; i++) {
if (!sources[i] && !healed_sinks[i])
@@ -510,7 +512,7 @@ ec_heal_metadata_find_direction (ec_t *ec, default_args_cbk_t *replies,
if (!are_dicts_equal(replies[i].xdata, replies[j].xdata,
ec_sh_key_match, NULL))
continue;
- groups[j] = i; /*If iatts match put them into a group*/
+ groups[j] = i;
same_count++;
}
@@ -542,7 +544,6 @@ out:
return ret;
}
-
int
__ec_heal_metadata_prepare (call_frame_t *frame, ec_t *ec, inode_t *inode,
unsigned char *locked_on, default_args_cbk_t *replies,
@@ -680,15 +681,12 @@ __ec_heal_metadata (call_frame_t *frame, ec_t *ec, inode_t *inode,
goto out;
}
- if (EC_COUNT (sources, ec->nodes) == ec->nodes) {
+ if ((EC_COUNT (sources, ec->nodes) == ec->nodes) ||
+ (EC_COUNT (healed_sinks, ec->nodes) == 0)) {
ret = 0;
goto erase_dirty;
}
- if (EC_COUNT (healed_sinks, ec->nodes) == 0) {
- ret = -ENOTCONN;
- goto out;
- }
source_buf = replies[source].stat;
ret = cluster_setattr (ec->xl_list, healed_sinks, ec->nodes, sreplies,
output, frame, ec->xl, &loc,