hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Payne (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-1257) Race condition on FSNamesystem#recentInvalidateSets introduced by HADOOP-5124
Date Wed, 10 Aug 2011 17:04:27 GMT

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

Eric Payne commented on HDFS-1257:
----------------------------------

I am still seeing this race condition on trunk.

I have attached a patch that seems to fix it for me.

I have synchronized() around the recentInvalidateSets Map in the BlockManager class.

Most of the changes are whitespace that needed to happend because the code is now contained
within synchronized() blocks.

Since iterations through Map lists will cause the ConcurrentModificationException if something
is modifying the list, I synchronized() around adds, removes, and iterations to the Map.

I have not yet included a unit test. It's not so easy to unit test a race condition that only
shows up under stress. I'm still working on it, but I wanted to get the patch out there for
your consideration.

Thanks,
-Eric

> Race condition on FSNamesystem#recentInvalidateSets introduced by HADOOP-5124
> -----------------------------------------------------------------------------
>
>                 Key: HDFS-1257
>                 URL: https://issues.apache.org/jira/browse/HDFS-1257
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>            Reporter: Ramkumar Vadali
>            Assignee: Eric Payne
>         Attachments: HDFS-1257.1.20110810.patch, HDFS-1257.patch
>
>
> HADOOP-5124 provided some improvements to FSNamesystem#recentInvalidateSets. But it introduced
unprotected access to the data structure recentInvalidateSets. Specifically, FSNamesystem.computeInvalidateWork
accesses recentInvalidateSets without read-lock protection. If there is concurrent activity
(like reducing replication on a file) that adds to recentInvalidateSets, the name-node crashes
with a ConcurrentModificationException.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message