cndaimin commented on a change in pull request #3548:
URL: https://github.com/apache/hadoop/pull/3548#discussion_r728860506



##########
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:
       Many thanks for the review! @sodonnel 
   1. My understanding to this why not pick the first one is that the EC 
background reconstruction procedure has the ability to compute the rest 2 
blocks based on the 3 good blocks(take RS-3-2 policy for example).
   2. I did notice a todo in code comments of this method: "Include 
lastFullStripeIdx+1 stripe in safeLength, if there exists such a stripe (and it 
must be partial).", but I might not involve this since that work may take a 
while :(
   3. `cellIdxInBlk * cellSize * dataBlkNum` in `offsetInBlkToOffsetInBG` has 
the same problem, I am glad to fix that too.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to