sodonnel commented on a change in pull request #3548:
URL: https://github.com/apache/hadoop/pull/3548#discussion_r728476447
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/util/StripedBlockUtil.java
##########
@@ -245,8 +245,7 @@ public static long getSafeLength(ErasureCodingPolicy
ecPolicy,
Arrays.sort(cpy);
// full stripe is a stripe has at least dataBlkNum full cells.
// lastFullStripeIdx is the index of the last full stripe.
- int lastFullStripeIdx =
- (int) (cpy[cpy.length - dataBlkNum] / cellSize);
+ long lastFullStripeIdx = cpy[cpy.length - dataBlkNum] / cellSize;
Review comment:
The change you have made here makes sense to me, although I still don't
fully understand how the method is used in practice. However I do worry where
else a bug like this may exist.
I think there is a similar problem in `offsetInBlkToOffsetInBG()` in this
same class. It only seems to be used in test code, but it would be good to fix
it incase it is used in non-test code later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]