|
@@ -1095,9 +1095,7 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
writeLock();
|
|
|
try {
|
|
|
stopSecretManager();
|
|
|
- if (leaseManager != null) {
|
|
|
- leaseManager.stopMonitor();
|
|
|
- }
|
|
|
+ leaseManager.stopMonitor();
|
|
|
if (nnrmthread != null) {
|
|
|
((NameNodeResourceMonitor) nnrmthread.getRunnable()).stopMonitor();
|
|
|
nnrmthread.interrupt();
|
|
@@ -3775,20 +3773,10 @@ public class FSNamesystem implements Namesystem, FSClusterStats,
|
|
|
final BlockInfo lastBlock = pendingFile.getLastBlock();
|
|
|
BlockUCState lastBlockState = lastBlock.getBlockUCState();
|
|
|
BlockInfo penultimateBlock = pendingFile.getPenultimateBlock();
|
|
|
- boolean penultimateBlockMinReplication;
|
|
|
- BlockUCState penultimateBlockState;
|
|
|
- if (penultimateBlock == null) {
|
|
|
- penultimateBlockState = BlockUCState.COMPLETE;
|
|
|
- // If penultimate block doesn't exist then its minReplication is met
|
|
|
- penultimateBlockMinReplication = true;
|
|
|
- } else {
|
|
|
- penultimateBlockState = BlockUCState.COMMITTED;
|
|
|
- penultimateBlockMinReplication =
|
|
|
+
|
|
|
+ // If penultimate block doesn't exist then its minReplication is met
|
|
|
+ boolean penultimateBlockMinReplication = penultimateBlock == null ? true :
|
|
|
blockManager.checkMinReplication(penultimateBlock);
|
|
|
- }
|
|
|
- assert penultimateBlockState == BlockUCState.COMPLETE ||
|
|
|
- penultimateBlockState == BlockUCState.COMMITTED :
|
|
|
- "Unexpected state of penultimate block in " + src;
|
|
|
|
|
|
switch(lastBlockState) {
|
|
|
case COMPLETE:
|