[ https://issues.apache.org/jira/browse/HDFS-80?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Allen Wittenauer resolved HDFS-80. ---------------------------------- Resolution: Incomplete Closing this as stale. > Rename of a directory with many opened files blocks name-node for a long > time. changeLease() to blame. > ------------------------------------------------------------------------------------------------------ > > Key: HDFS-80 > URL: https://issues.apache.org/jira/browse/HDFS-80 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Konstantin Shvachko > > I am creating a directory containing 200,000 files, and then renaming it. > The rename operation is twice as long as the the total time for creating all > those files. > The worst thing is that the rename blocks the name-node for minutes. I tried > it with a bigger directory containing 1 mln files - it blocks for 30 minutes. > The rename itself is fast, its the changeLease() called after renaming that > takes all the time. > As I can see from the code changeLease() gets tailMap() of the directory that > it renames and scans the whole tail. > If the number of open files is large as in my case this takes forever because > the tailMap includes all files in the subtree. > Simple way to reproduce it is to run > {code} > NNThroughputBenchmark -op open -files N > {code} > with a large N. This will first create N files in directory > "/NNThroughputBenchmark/create" and then rename it to > "/NNThroughputBenchmark/open". -- This message was sent by Atlassian JIRA (v6.2#6252)