hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill de hOra (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (HADOOP-3614) TestLeaseRecovery fails when run with assertions enabled.
Date Sun, 03 Aug 2008 17:59:44 GMT

    [ 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:57 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:


{code:java}
  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;
  }
{code}
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 (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. 
  
> 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.


Mime
View raw message