Skip to content

Commit 7768d70

Browse files
vshankarvbellur
authored andcommitted
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 <[email protected]> Reviewed-on: http://review.gluster.com/3087 Tested-by: Gluster Build System <[email protected]> Tested-by: M S Vishwanath Bhat <[email protected]> Reviewed-by: M S Vishwanath Bhat <[email protected]> Reviewed-by: Vijay Bellur <[email protected]>
1 parent f132cc6 commit 7768d70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: glusterfs-hadoop/0.20.2/src/main/java/org/apache/hadoop/fs/glusterfs/GlusterFSXattr.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ static BlockLocation[] getHints (HashMap<String, ArrayList<String>> vol,
327327
}
328328
}
329329

330-
rsize = replicas.get(0).size();
331330
stripeSize = meta.get("block-size");
332331

333332
nrAllocs = (int) (((len - start) / stripeSize) + 1);
@@ -350,6 +349,8 @@ static BlockLocation[] getHints (HashMap<String, ArrayList<String>> vol,
350349
done = true;
351350
}
352351

352+
rsize = replicas.get(counter).size();
353+
353354
if (hnts == null)
354355
repl[allocCtr] = new GlusterFSBrickRepl(rsize, stripeStart, (stripeEnd - stripeStart));
355356

0 commit comments

Comments
 (0)