Sfoglia il codice sorgente

HDFS-11352. Potential deadlock in NN when failing over. Contributed by Erik Krogen.

Akira Ajisaka 8 anni fa
parent
commit
3acc96edbf

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -4768,7 +4768,7 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
   @Metric({"TransactionsSinceLastCheckpoint",
       "Number of transactions since last checkpoint"})
   public long getTransactionsSinceLastCheckpoint() {
-    return getEditLog().getLastWrittenTxId() -
+    return getEditLog().getLastWrittenTxIdWithoutLock() -
         getFSImage().getStorage().getMostRecentCheckpointTxId();
   }