From d57dba99428cbe3f3dfcec834d79f709e7529ef9 Mon Sep 17 00:00:00 2001 From: Junping Du Date: Wed, 1 Nov 2017 14:48:16 -0700 Subject: [PATCH] YARN-7400. Incorrect log preview displayed in jobhistory server ui. Contributed by Xuan Gong. --- .../filecontroller/ifile/IndexedFileAggregatedLogsBlock.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/IndexedFileAggregatedLogsBlock.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/IndexedFileAggregatedLogsBlock.java index 5439b534b05..db2915ab256 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/IndexedFileAggregatedLogsBlock.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/IndexedFileAggregatedLogsBlock.java @@ -221,8 +221,8 @@ public class IndexedFileAggregatedLogsBlock extends LogAggregationHtmlBlock { __(" for the full log.").__(); } long totalSkipped = 0; - while (totalSkipped < start) { - long ret = in.skip(start - totalSkipped); + while (totalSkipped < startIndex) { + long ret = in.skip(startIndex - totalSkipped); if (ret == 0) { //Read one byte int nextByte = in.read();