|
@@ -523,6 +523,9 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
|
|
|
LocatedBlocks blocks) throws IOException {
|
|
|
String path = file.getFullName(parent);
|
|
|
boolean isOpen = blocks.isUnderConstruction();
|
|
|
+ if (isOpen && !showOpenFiles) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
int missing = 0;
|
|
|
int corrupt = 0;
|
|
|
long missize = 0;
|
|
@@ -530,8 +533,15 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
|
|
|
int misReplicatedPerFile = 0;
|
|
|
StringBuilder report = new StringBuilder();
|
|
|
int blockNumber = 0;
|
|
|
+ final LocatedBlock lastBlock = blocks.getLastLocatedBlock();
|
|
|
for (LocatedBlock lBlk : blocks.getLocatedBlocks()) {
|
|
|
ExtendedBlock block = lBlk.getBlock();
|
|
|
+ if (!blocks.isLastBlockComplete() && lastBlock != null &&
|
|
|
+ lastBlock.getBlock().equals(block)) {
|
|
|
+ // this is the last block and this is not complete. ignore it since
|
|
|
+ // it is under construction
|
|
|
+ continue;
|
|
|
+ }
|
|
|
BlockManager bm = namenode.getNamesystem().getBlockManager();
|
|
|
|
|
|
final BlockInfo storedBlock = bm.getStoredBlock(
|