hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hu Liu, (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-7294) Use stored timestamp instead of timestamp provided by client in FsDatasetImpl#getBlockLocalPathInfo
Date Mon, 27 Oct 2014 10:01:34 GMT
Hu Liu, created HDFS-7294:
-----------------------------

             Summary: Use stored timestamp instead of timestamp provided by client in FsDatasetImpl#getBlockLocalPathInfo
                 Key: HDFS-7294
                 URL: https://issues.apache.org/jira/browse/HDFS-7294
             Project: Hadoop HDFS
          Issue Type: Bug
    Affects Versions: 2.5.1
            Reporter: Hu Liu,


In current implementation, datanode use the timestamp provided by client without checking:
{code}
  public BlockLocalPathInfo getBlockLocalPathInfo(ExtendedBlock block)
      throws IOException {
    File datafile = getBlockFile(block);
    File metafile = FsDatasetUtil.getMetaFile(datafile,     block.getGenerationStamp());
{code}
But in some scenario, the client may provide wrong timestamp and the getBlockLocalPathInfo
will return wrong path to client. We can fix it by using timestamp of stored block.
Meanwhile, we should also check the  meta file like data file if there is disk failure.
{code}
  File validateBlockFile(String bpid, Block b) {
    //Should we check for metadata file too?
    final File f;
    synchronized(this) {
      f = getFile(bpid, b.getBlockId());
    }
    
    if(f != null ) {
      if(f.exists())
        return f;
   
      // if file is not null, but doesn't exist - possibly disk failed
      datanode.checkDiskError();
    }
{code}



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

Mime
View raw message