summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-11-22 12:09:53 +0530
committerVijay Bellur <vbellur@redhat.com>2013-11-26 10:37:41 -0800
commit2f218e1335d5fdab0b41716cc5c8976b20c367f6 (patch)
treeb10138a2a8268464ee61535a90de1d362974116f /xlators/cluster
parentd4c9d342f64636304720d0091a605c85ea9f0e4d (diff)
cluster/dht: Handle Link-info getxattr failure in rebalance
When getxattr fails with errno other than ENODATA fail rebalance on that file. Log the reason for error. Change-Id: Ia519870b88e6e6dd464d1c0415411aa999f80bc9 BUG: 1032927 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/6341 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <sgowda@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 99d92459c12..c123a4425b3 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -1128,6 +1128,7 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,
double elapsed = {0,};
struct timeval start = {0,};
int32_t err = 0;
+ int loglevel = GF_LOG_TRACE;
gf_log (this->name, GF_LOG_INFO, "migrate data called on %s",
loc->path);
@@ -1268,17 +1269,24 @@ gf_defrag_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, loc_t *loc,
/* if distribute is present, it will honor this key.
- * -1 is returned if distribute is not present or file
- * doesn't have a link-file. If file has link-file, the
- * path of link-file will be the value, and also that
- * guarantees that file has to be mostly migrated */
+ * -1, ENODATA is returned if distribute is not present
+ * or file doesn't have a link-file. If file has
+ * link-file, the path of link-file will be the value,
+ * and also that guarantees that file has to be mostly
+ * migrated */
ret = syncop_getxattr (this, &entry_loc, &dict,
GF_XATTR_LINKINFO_KEY);
if (ret < 0) {
- gf_log (this->name, GF_LOG_TRACE, "failed to "
- "get link-to key for %s",
- entry_loc.path);
+ if (errno != ENODATA) {
+ loglevel = GF_LOG_ERROR;
+ defrag->total_failures += 1;
+ } else {
+ loglevel = GF_LOG_TRACE;
+ }
+ gf_log (this->name, loglevel, "%s: failed to "
+ "get "GF_XATTR_LINKINFO_KEY" key - %s",
+ entry_loc.path, strerror (errno));
continue;
}