From 5f1de83d50d8245b92ebdbeb2dd20a5d462286c1 Mon Sep 17 00:00:00 2001 From: "zengqiang.xu" Date: Thu, 13 Oct 2022 14:22:05 +0800 Subject: [PATCH] HDFS-16793. Fix failed UT --- .../apache/hadoop/hdfs/server/namenode/FileJournalManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java index 7c0924cd466..2ed6dd828e4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FileJournalManager.java @@ -244,7 +244,8 @@ public class FileJournalManager implements JournalManager { if (elf.getFirstTxId() >= firstTxId) { ret.add(new RemoteEditLog(elf.firstTxId, elf.lastTxId, elf.isInProgress())); - } else if (elf.getFirstTxId() < firstTxId && firstTxId <= elf.getLastTxId()) { + } else if (elf.getFirstTxId() < firstTxId && + (firstTxId <= elf.getLastTxId() || elf.isInProgress())) { // If the firstTxId is in the middle of an edit log segment. Return this // anyway and let the caller figure out whether it wants to use it. ret.add(new RemoteEditLog(elf.firstTxId, elf.lastTxId,