[ https://issues.apache.org/jira/browse/HADOOP-18439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601480#comment-17601480 ]
ASF GitHub Bot commented on HADOOP-18439: ----------------------------------------- steveloughran commented on code in PR #4862: URL: https://github.com/apache/hadoop/pull/4862#discussion_r965175671 ########## hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ChecksumFileSystem.java: ########## @@ -396,11 +407,33 @@ static ByteBuffer checkBytes(ByteBuffer sumsBytes, return data; } + /** + * Validates range parameters. + * In case of CheckSum FS, we already have calculated + * fileLength so failing fast here. + * @param ranges requested ranges. + * @param fileLen length of file. + * @throws EOFException end of file exception. + */ + private void validateRangeRequest(List<? extends FileRange> ranges, long fileLen) throws EOFException { + for (FileRange range : ranges) { + VectoredReadUtils.validateRangeRequest(range); + if (range.getOffset() + range.getLength() > fileLen) { + LOG.warn("Requested range [{}, {}) is beyond EOF for path {}", + range.getOffset(), range.getLength(), file); + throw new EOFException("Requested range [" + range.getOffset() + ", " Review Comment: you could just string.format this into a string and use it in the log and exception > Fix VectoredIO for LocalFileSystem when checksum is enabled. > ------------------------------------------------------------ > > Key: HADOOP-18439 > URL: https://issues.apache.org/jira/browse/HADOOP-18439 > Project: Hadoop Common > Issue Type: Sub-task > Components: common > Affects Versions: 3.3.9 > Reporter: Mukund Thakur > Assignee: Mukund Thakur > Priority: Major > Labels: pull-request-available > > While merging the ranges in CheckSumFs, they are rounded up based on the > value of checksum bytes size > which leads to some ranges crossing the EOF thus they need to be fixed else > it will cause EOFException during actual reads. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org