Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
1.0.0
-
None
-
None
Description
I saw the following NPE for a client on branch-1 that looks like it accessed a block not in the volume map, probably because the block was already deleted (otherwise the primary should have a block file). Looks like a create is racing with a delete.
DFSClient.java in updateBlockInfo..
Block newBlock = primary.getBlockInfo(last.getBlock());
long newBlockSize = newBlock.getNumBytes(); <--------
From getBlockInfo to getStoredBlock..
public synchronized Block getStoredBlock(long blkid) throws IOException { File blockfile = findBlockFile(blkid); if (blockfile == null) { return null; }
Digging into findBlockFile..
public synchronized File findBlockFile(long blockId) { final Block b = new Block(blockId); File blockfile = null; ActiveFile activefile = ongoingCreates.get(b); if (activefile != null) { blockfile = activefile.file; } if (blockfile == null) { blockfile = getFile(b); } if (blockfile == null) { if (DataNode.LOG.isDebugEnabled()) { DataNode.LOG.debug("ongoingCreates=" + ongoingCreates); DataNode.LOG.debug("volumeMap=" + volumeMap); } } return blockfile;
Into getFile..
public synchronized File getFile(Block b) { DatanodeBlockInfo info = volumeMap.get(b); if (info != null) { return info.getFile(); } return null;