diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 36a70b86dc..fd1d6deb36 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -2196,6 +2196,9 @@ Release 2.8.0 - UNRELEASED HDFS-9044. Give Priority to FavouredNodes , before selecting nodes from FavouredNode's Node Group (J.Andreina via vinayakumarb) + HDFS-9332. Fix Precondition failures from NameNodeEditLogRoller while + saving namespace. (wang) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index 29ee0879f3..8d70fbc611 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -3729,9 +3729,7 @@ public NameNodeEditLogRoller(long rollThreshold, int sleepIntervalMs) { public void run() { while (fsRunning && shouldRun) { try { - FSEditLog editLog = getFSImage().getEditLog(); - long numEdits = - editLog.getLastWrittenTxId() - editLog.getCurSegmentTxId(); + long numEdits = getTransactionsSinceLastLogRoll(); if (numEdits > rollThreshold) { FSNamesystem.LOG.info("NameNode rolling its own edit log because" + " number of edits in open segment exceeds threshold of "