[ 
https://issues.apache.org/jira/browse/HDFS-11018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15585784#comment-15585784
 ] 

Wei-Chiu Chuang commented on HDFS-11018:
----------------------------------------

Hi [~linyiqun] thanks for your patch. I think it generally looks good to me. 
One nit: 
{code}
                + ": GenerationStamp not matched, info=" + infoByBlockId);
{code}
Instead of printing the whole ReplicaInfo which we do not need,
(it looks like this, if you are curious)
{noformat}
FinalizedReplica, blk_1073803461_74266, FINALIZED
  getNumBytes()     = 54739015
  getBytesOnDisk()  = 54739015
  getVisibleLength()= 54739015
  getVolume()       = /data/4/dfs/dn/current
  getBlockFile()    = 
/data/4/dfs/dn/current/BP-1092022411-10.0.0.55-1474407949037/current/finalized/subdir0/subdir240/blk_1073803461
{noformat}
 I think we just need to print the block:

so probably Block.toString(infoByBlockId)

Also, instead of printing "info=", use more self explanatory message, like 
"existing replica is "
What do you think?

> Incorrect check and message in FsDatasetImpl#invalidate
> -------------------------------------------------------
>
>                 Key: HDFS-11018
>                 URL: https://issues.apache.org/jira/browse/HDFS-11018
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>            Reporter: Wei-Chiu Chuang
>            Assignee: Yiqun Lin
>         Attachments: HDFS-11018.001.patch, HDFS-11018.002.patch
>
>
> The following error check and message is incorrect, because {{info}} is null 
> if (1) the block id does not exist in ReplicaMap or (2) the generation stamp 
> of block does not match the replica entry in ReplicaMap.
> {code:title=FsDatasetImpl#invalidate}
>        final ReplicaInfo info = volumeMap.get(bpid, invalidBlks[i]);
>         if (info == null) {
>           // It is okay if the block is not found -- it may be deleted 
> earlier.
>           LOG.info("Failed to delete replica " + invalidBlks[i]
>               + ": ReplicaInfo not found.");
>           continue;
>         }
>         if (info.getGenerationStamp() != invalidBlks[i].getGenerationStamp()) 
> {
>           errors.add("Failed to delete replica " + invalidBlks[i]
>               + ": GenerationStamp not matched, info=" + info);
>           continue;
>         }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to