This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new 6b24b85 HDFS-16507. [SBN read] Avoid purging edit log which is in
progress (#4082)
6b24b85 is described below
commit 6b24b85e3ffc13a86cc3260fd2a3114057e72429
Author: litao <[email protected]>
AuthorDate: Thu Mar 31 14:01:48 2022 +0800
HDFS-16507. [SBN read] Avoid purging edit log which is in progress (#4082)
---
.../org/apache/hadoop/hdfs/server/namenode/FSEditLog.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
index a24e5dd..7e58d38 100644
---
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
+++
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
@@ -1481,11 +1481,12 @@ public class FSEditLog implements LogsPurgeable {
if (!isOpenForWrite()) {
return;
}
-
- assert curSegmentTxId == HdfsServerConstants.INVALID_TXID || // on format
this is no-op
- minTxIdToKeep <= curSegmentTxId :
- "cannot purge logs older than txid " + minTxIdToKeep +
- " when current segment starts at " + curSegmentTxId;
+
+ Preconditions.checkArgument(
+ curSegmentTxId == HdfsServerConstants.INVALID_TXID || // on format
this is no-op
+ minTxIdToKeep <= curSegmentTxId,
+ "cannot purge logs older than txid " + minTxIdToKeep +
+ " when current segment starts at " + curSegmentTxId);
if (minTxIdToKeep == 0) {
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]