summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-06-15 06:17:44 +0000
committerAnand Avati <avati@gluster.com>2011-06-16 09:15:52 -0700
commit9d2b83aaecd66c161863379be3ec22d45ffbe4fb (patch)
treeb29306a5efa74060fe4d69d1654e4972cbfe7b72
parent1b70ee9a2e469d2d970abf8e07c1c522c8bdc1df (diff)
PUMP: perform opendir on pump xlator instead of its child
When replace-brick is performed, there is a high probability for the directories on the source brick to not have any pending entry xattrs. So for proper self-heal we need the force merge to kick in. If the opendir is performed on pump xlator directory is examined and if the entries on its children do not match then force merge is triggered, so missing entries will be created on the sink. Pending xattrs are set from source to sink on the files present on source in this process. So when the lookup happens the self-heal is triggered. Before this fix, the code is working because the self-heal source is decided based on what file is biggest in size which is a wrong and removed. Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2586 (read child is set without checking the xattr) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2586
-rw-r--r--xlators/cluster/afr/src/pump.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c
index 76280ea8120..0d4929d8926 100644
--- a/xlators/cluster/afr/src/pump.c
+++ b/xlators/cluster/afr/src/pump.c
@@ -415,8 +415,6 @@ gf_pump_traverse_directory (loc_t *loc)
struct iatt iatt, parent;
dict_t *xattr_rsp;
- int source = 0;
-
char *file_path = NULL;
int ret = 0;
gf_boolean_t is_directory_empty = _gf_true;
@@ -434,7 +432,7 @@ gf_pump_traverse_directory (loc_t *loc)
goto out;
}
- ret = syncop_opendir (priv->children[source], loc, fd);
+ ret = syncop_opendir (this, loc, fd);
if (ret < 0) {
gf_log (this->name, GF_LOG_DEBUG,
"opendir failed on %s", loc->path);
@@ -445,7 +443,7 @@ gf_pump_traverse_directory (loc_t *loc)
"pump opendir on %s returned=%d",
loc->path, ret);
- while (syncop_readdirp (priv->children[source], fd, 131072, offset, &entries)) {
+ while (syncop_readdirp (this, fd, 131072, offset, &entries)) {
if (list_empty (&entries.list)) {
gf_log (this->name, GF_LOG_TRACE,