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

This commit is contained in:
Akira Ajisaka 2017-01-24 14:55:27 +09:00
parent b0b3966851
commit 3acc96edbf
1 changed files with 1 additions and 1 deletions

View File

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