summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/cluster/dht/src/tier.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index b152a43f72e..31d5e8b627e 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -104,14 +104,14 @@ tier_check_same_node (xlator_t *this, loc_t *loc, gf_defrag_info_t *defrag)
}
if (gf_uuid_parse (uuid_str, node_uuid)) {
- gf_msg (this->name, GF_LOG_INFO, 0, DHT_MSG_LOG_TIER_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0, DHT_MSG_LOG_TIER_ERROR,
"uuid_parse failed for %s", loc->path);
goto out;
}
if (gf_uuid_compare (node_uuid, defrag->node_uuid)) {
- gf_msg_trace (this->name, 0,
- "%s does not belong to this node", loc->path);
+ gf_msg_trace (this->name, 0,
+ "%s does not belong to this node", loc->path);
ret = 1;
goto out;
}
@@ -258,6 +258,12 @@ tier_migrate_using_query_file (void *_args)
loc_t loc = {0,};
dict_t *migrate_data = NULL;
inode_t *linked_inode = NULL;
+ /*
+ * per_file_status and per_link_status
+ * 0 : success
+ * -1 : failure
+ * 1 : ignore the status and dont count for migration
+ * */
int per_file_status = 0;
int per_link_status = 0;
int total_status = 0;
@@ -496,9 +502,18 @@ tier_migrate_using_query_file (void *_args)
src_subvol->name,
loc.name);
- if (tier_check_same_node (this, &loc, defrag)) {
- if (ret < 0)
+
+ ret = tier_check_same_node (this, &loc, defrag);
+ if (ret != 0) {
+ if (ret < 0) {
per_link_status = -1;
+ goto abort;
+ }
+ ret = 0;
+ /* By setting per_linl_status to 1 we are
+ * ignoring this status and will not be counting
+ * this file for migration */
+ per_link_status = 1;
goto abort;
}
@@ -571,14 +586,16 @@ abort:
}
per_file_status = per_link_status;
per_file_out:
- if (per_file_status) {
+ if (per_file_status < 0) {/* Failure */
pthread_mutex_lock (&dm_stat_mutex);
defrag->total_failures++;
pthread_mutex_unlock (&dm_stat_mutex);
- } else {
+ } else if (per_file_status == 0) {/* Success */
pthread_mutex_lock (&dm_stat_mutex);
defrag->total_files++;
pthread_mutex_unlock (&dm_stat_mutex);
+ } else if (per_file_status == 1) {/* Ignore */
+ per_file_status = 0;
}
total_status = total_status + per_file_status;
per_link_status = 0;