|
[
Permlink
| « Hide
]
Konstantin Shvachko added a comment - 20/Jun/08 11:07 PM
I see the same assert with TestLeaseRecovery2.
When I step through the tests I see that 1001L is the value of the generationStamp for newblocks[i] below (from TestLeaseRecovery.testBlockSynchronization)
//update blocks with random block sizes Block[] newblocks = new Block[REPLICATION_NUM]; for(int i = 0; i < REPLICATION_NUM; i++) { newblocks[i] = new Block(lastblock.getBlockId(), newblocksizes[i], lastblock.getGenerationStamp()); idps[i].updateBlock(lastblock, newblocks[i], false); checkMetaInfo(newblocks[i], idps[i]); } when that gets to FSDataset.findBlockFile the assert line in evaluates to 1 != 1001L because GenerationStamp.WILDCARD_STAMP is 1. I'm assuming the 1001L value is being calculated as an offset from GenerationStamp.FIRST_VALID_STAMP (which is 1000L) and 1001L comes from using the GenerationStamp.nextStamp() method: public File findBlockFile(Block b) { assert b.getGenerationStamp() == GenerationStamp.WILDCARD_STAMP; 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; } That part of the code was last touched in r673857 as part of HADOOP-2885, where findBlockFile was made public. Trawling the commits it looks like the assert was added as part of What I don't understand is why the assert line is there; I don't see how it could ever work where stamps are actually being calculated. I suspect the assert needs to come out and you just might be the first person to run with assert on. Linking this to
I think assert is right here. It means that findBlockFile() method should find a file containing the block by its block id no matter what its generation stamp is, and therefore findBlockFile should always be called with the generation stamp == WILDCARD_STAMP.
What is incorrect here is the api. findBlockFile(long blockID) should take block ID as a parameter and then the assert can be removed. A comment stating exactly what the method does would be extremely helpful. 3614_20080926.patch: fixed the bug.
3614_20080926b.patch: fixed some comments and codes.
3614_20080926c.patch: incorporated Konstantin's comments
+1
Looks like this is a bug and should be committed in all version starting from 0.18 The patch fixed a bug which may cause other append-related tests failed.
Passed all tests locally. Submitting...
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12391069/3614_20080926c.patch against trunk revision 699517. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 Eclipse classpath. The patch retains Eclipse classpath integrity. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3387/testReport/ This message is automatically generated. 3614_20080926c_0.18.patch: for 0.18
I just committed this to 0.18, 0.19 and trunk.
Integrated in Hadoop-trunk #618 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/618/
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||