diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java index 6cb2062..243945e 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/logaggregation/filecontroller/ifile/LogAggregationIndexedFileController.java @@ -392,7 +392,8 @@ public void postWrite(LogAggregationFileControllerContext record) this.fsDataOStream.writeInt(length); byte[] separator = this.uuid.getBytes(Charset.forName("UTF-8")); this.fsDataOStream.write(separator); - if (logAggregationSuccessfullyInThisCyCle) { + if (logAggregationSuccessfullyInThisCyCle && + record.isLogAggregationInRolling()) { deleteFileWithRetries(fc, ugi, remoteLogCheckSumFile); } }