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>
This commit is contained in:
Venky Shankar 2012-04-02 12:47:55 +05:30 committed by Vijay Bellur
parent f132cc666b
commit 7768d700a1

View File

@ -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));