You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Bill de hOra (JIRA)" <ji...@apache.org> on 2008/08/03 19:57:44 UTC

[jira] Issue Comment Edited: (HADOOP-3614) TestLeaseRecovery fails when run with assertions enabled.

    [ https://issues.apache.org/jira/browse/HADOOP-3614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619354#action_12619354 ] 

dehora edited comment on HADOOP-3614 at 8/3/08 10:56 AM:
---------------------------------------------------------------

When I step through the tests I see that 1001L is the value of the generationStamp for newblocks[i] below (from TestLeaseRecovery.testBlockSynchronization)

{code:java}
      //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]);
      }
{code}

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.

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 HADOOP-3310 (r662513; I wish svn had bisect). 

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. 

      was (Author: dehora):
    When I step through the tests I see that 1001L is the value of the generationStamp for newblocks[i] below

{code:java}
      //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]);
      }
{code}

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.

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 HADOOP-3310 (r662513; I wish svn had bisect). 

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. 
  
> TestLeaseRecovery fails when run with assertions enabled.
> ---------------------------------------------------------
>
>                 Key: HADOOP-3614
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3614
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.18.0
>            Reporter: Konstantin Shvachko
>             Fix For: 0.19.0
>
>
> I used -ea jvm options to run the test, and it fails in FSDataset.findBlockFile(Block) on 
> {code}
> assert b.generationStamp == GenerationStamp.WILDCARD_STAMP;
> {code}
> Without asserts on the test passes.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.