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

Chris Nauroth commented on HDFS-5394:
-------------------------------------

I just tested with patch version 7, and the datanode didn't uncache previously 
cached blocks after receiving the DNA_CACHE message.  Debug logging shows that 
it's due to the following logic in {{FsDatasetCache#uncacheBlock}}.  I assume 
{{case CACHED}} should be doing the same as the {{default}} block and 
submitting an {{UncachingTask}}.

{code}
    case CACHED:
      if (LOG.isDebugEnabled()) {
        LOG.debug("Block with id " + blockId + ", pool " + bpid + " " +
            "does not need to be uncached, because it is " +
            "in state " + prevValue.state + ".");
      }
      break;
{code}


> fix race conditions in DN caching and uncaching
> -----------------------------------------------
>
>                 Key: HDFS-5394
>                 URL: https://issues.apache.org/jira/browse/HDFS-5394
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, namenode
>    Affects Versions: 3.0.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-5394-caching.001.patch, 
> HDFS-5394-caching.002.patch, HDFS-5394-caching.003.patch, 
> HDFS-5394-caching.004.patch, HDFS-5394.005.patch, HDFS-5394.006.patch, 
> HDFS-5394.007.patch
>
>
> The DN needs to handle situations where it is asked to cache the same replica 
> more than once.  (Currently, it can actually do two mmaps and mlocks.)  It 
> also needs to handle the situation where caching a replica is cancelled 
> before said caching completes.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to