summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Lambright <dlambrig@redhat.com>2015-09-16 10:26:44 -0400
committerDan Lambright <dlambrig@redhat.com>2015-09-16 10:31:42 -0700
commitef231e41af79803a0e1e8829920b67e736578109 (patch)
treecfe067b23695914867183cac15d63c2a0d9d66ac
parent5c20e71dcadbbf6f7509e24257e7bd69375ae220 (diff)
cluster/tier do not flag migration error on already migrated file
In some cases a brick will try to migrate a file that has already been migrated. This is a legal case, e.g. when both bricks are replica pairs. Change-Id: If2578b947014cbbdfb3c6591db9044d6b1d92774 BUG: 1262408 Signed-off-by: Dan Lambright <dlambrig@redhat.com> Reviewed-on: http://review.gluster.org/12186 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Joseph Fernandes Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/cluster/dht/src/tier.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c
index 1afbbd86634..4fe6166c4ba 100644
--- a/xlators/cluster/dht/src/tier.c
+++ b/xlators/cluster/dht/src/tier.c
@@ -257,7 +257,7 @@ tier_migrate_using_query_file (void *_args)
DHT_MSG_LOG_TIER_ERROR,
"failed parsing %s\n", link_str);
per_link_status = -1;
- goto error;
+ goto abort;
}
gf_uuid_copy (p_loc.gfid, link_info->pargfid);
@@ -268,7 +268,7 @@ tier_migrate_using_query_file (void *_args)
DHT_MSG_LOG_TIER_ERROR,
"failed parsing %s\n", link_str);
per_link_status = -1;
- goto error;
+ goto abort;
}
ret = syncop_lookup (this, &p_loc, &par_stbuf, NULL,
@@ -278,7 +278,7 @@ tier_migrate_using_query_file (void *_args)
DHT_MSG_LOG_TIER_ERROR,
" ERROR in parent lookup\n");
per_link_status = -1;
- goto error;
+ goto abort;
}
linked_inode = inode_link (p_loc.inode, NULL, NULL,
&par_stbuf);
@@ -296,7 +296,7 @@ tier_migrate_using_query_file (void *_args)
DHT_MSG_LOG_TIER_ERROR, "ERROR in "
"memory allocation\n");
per_link_status = -1;
- goto error;
+ goto abort;
}
loc.path = gf_strdup (link_info->file_path);
@@ -305,7 +305,7 @@ tier_migrate_using_query_file (void *_args)
DHT_MSG_LOG_TIER_ERROR, "ERROR in "
"memory allocation\n");
per_link_status = -1;
- goto error;
+ goto abort;
}
gf_uuid_copy (loc.parent->gfid, link_info->pargfid);
@@ -317,7 +317,7 @@ tier_migrate_using_query_file (void *_args)
DHT_MSG_LOG_TIER_ERROR, "ERROR in "
"current lookup\n");
per_link_status = -1;
- goto error;
+ goto abort;
}
linked_inode = inode_link (loc.inode, NULL, NULL,
&current);
@@ -326,20 +326,19 @@ tier_migrate_using_query_file (void *_args)
/*
* Do not promote/demote if file already is where it
- * should be. This shall become a skipped count.
+ * should be. It means another brick moved the file
+ * so is not an error.
*/
src_subvol = dht_subvol_get_cached(this, loc.inode);
if (query_cbk_args->is_promotion &&
src_subvol == conf->subvolumes[1]) {
- per_link_status = -1;
- goto error;
+ goto abort;
}
if (!query_cbk_args->is_promotion &&
src_subvol == conf->subvolumes[0]) {
- per_link_status = -1;
- goto error;
+ goto abort;
}
gf_msg (this->name, GF_LOG_INFO, 0,
@@ -351,7 +350,7 @@ tier_migrate_using_query_file (void *_args)
if (tier_check_same_node (this, &loc, defrag)) {
per_link_status = -1;
- goto error;
+ goto abort;
}
gf_uuid_copy (loc.gfid, loc.inode->gfid);
@@ -365,15 +364,14 @@ tier_migrate_using_query_file (void *_args)
loc.name,
loc.path);
per_link_status = -1;
- goto error;
+ goto abort;
}
if (query_cbk_args->is_promotion)
defrag->total_files_promoted++;
else
defrag->total_files_demoted++;
-
-error:
+abort:
loc_wipe(&loc);
loc_wipe(&p_loc);