summaryrefslogtreecommitdiffstats
path: root/glusterfs-hadoop/0.20.2
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2012-04-02 12:47:55 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-06 02:35:05 -0700
commit7768d700a18f5bdb1e4640070ec5dd380384c7a9 (patch)
treefe4fbec7d64cd919f68832c7aa7c3fcabf2e3c69 /glusterfs-hadoop/0.20.2
parentf132cc666ba4aa5e804de1c4529674618ca0d875 (diff)
hadoop-glusterfs: Fix IndexOutOfBounds Exception
Fix IndexOutOfBounds Exception which is hit when one of the replica pair is down. Problematic code existed in assuming a uniform size for each replica in pathinfo string. Change-Id: I85377ba5549e0603fe86e8d787115004f50e0c6a BUG: 808009 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.com/3087 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: M S Vishwanath Bhat <vishwanath@gluster.com> Reviewed-by: M S Vishwanath Bhat <vishwanath@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'glusterfs-hadoop/0.20.2')
-rw-r--r--glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java b/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java
index 18e9003b43e..455dda97e9c 100644
--- a/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java
+++ b/glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java
@@ -327,7 +327,6 @@ public class GlusterFSXattr {
}
}
- rsize = replicas.get(0).size();
stripeSize = meta.get("block-size");
nrAllocs = (int) (((len - start) / stripeSize) + 1);
@@ -350,6 +349,8 @@ public class GlusterFSXattr {
done = true;
}
+ rsize = replicas.get(counter).size();
+
if (hnts == null)
repl[allocCtr] = new GlusterFSBrickRepl(rsize, stripeStart, (stripeEnd - stripeStart));