You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by su...@apache.org on 2022/03/31 06:02:08 UTC
[hadoop] branch trunk updated: HDFS-16507. [SBN read] Avoid purging edit log which is in progress (#4082)
This is an automated email from the ASF dual-hosted git repository.
sunchao pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 9a4dddd HDFS-16507. [SBN read] Avoid purging edit log which is in progress (#4082)
9a4dddd is described below
commit 9a4dddd64080bc1a1bf3a6e2d6116ce29e024e49
Author: litao <to...@gmail.com>
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 53c6633..850b2fc 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
@@ -1515,11 +1515,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: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org