[ https://issues.apache.org/jira/browse/HDFS-16776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17608065#comment-17608065 ]
ASF GitHub Bot commented on HDFS-16776: --------------------------------------- tasanuma commented on code in PR #4901: URL: https://github.com/apache/hadoop/pull/4901#discussion_r977173136 ########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/StripedWriter.java: ########## @@ -82,8 +82,10 @@ class StripedWriter { assert targetStorageIds != null; writers = new StripedBlockWriter[targets.length]; - targetIndices = new short[targets.length]; + Preconditions.checkArgument( + targetIndices.length <= dataBlkNum + parityBlkNum - reconstructor.getNumLiveBlocks(), + "Reconstrutcion work gets too much targets."); Review Comment: @Kidd53685368 Sorry, I have one more request. `Reconstrutcion` is a typo of `Reconstruction`. > Erasure Coding: The length of targets should be checked when DN gets a > reconstruction task > ------------------------------------------------------------------------------------------ > > Key: HDFS-16776 > URL: https://issues.apache.org/jira/browse/HDFS-16776 > Project: Hadoop HDFS > Issue Type: Improvement > Reporter: Kidd5368 > Assignee: Kidd5368 > Priority: Major > Labels: pull-request-available > > The length of targets should be checked when DN gets a EC reconstruction > task.For some reason (HDFS-14768, HDFS-16739) , the length of targets will be > larger than additionalReplRequired which causes some elements in targets get > the default value 0. It may trigger the bug which leads to the data > corrupttion just like HDFS-14768. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org