Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 95129 invoked from network); 14 Aug 2009 00:58:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Aug 2009 00:58:30 -0000 Received: (qmail 17204 invoked by uid 500); 14 Aug 2009 00:58:37 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 17148 invoked by uid 500); 14 Aug 2009 00:58:37 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 17138 invoked by uid 99); 14 Aug 2009 00:58:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2009 00:58:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2009 00:58:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id CB60D234C004 for ; Thu, 13 Aug 2009 17:58:14 -0700 (PDT) Message-ID: <1585171663.1250211494818.JavaMail.jira@brutus> Date: Thu, 13 Aug 2009 17:58:14 -0700 (PDT) From: "Suresh Srinivas (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Commented: (HDFS-173) Recursively deleting a directory with millions of files makes NameNode unresponsive for other commands until the deletion completes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743042#action_12743042 ] Suresh Srinivas commented on HDFS-173: -------------------------------------- Here is the approach I am planning to take: Currently all the files and subdirectories is recursively deleted holding FSNameSystem lock. Deletion of a directory with large number of files could take significant time. This results in other operations having to wait until the completion of delete to perform any namenode operation. The proposed change is to perform deletion incrementally. First the target directory to be deleted will be removed from the directory tree, to prevent further changes in that directory. Then the files and directories under it are deleted 1000 at a time, holding the FSNameSystem lock. Between two deletes, relinquish FSNameSystem lock, to allow namenode operations for other clients. There is no sleep between deletes, as it could add up to long deletion time, when deleting a large directory. Client that issues delete would block until the deletion is complete. > Recursively deleting a directory with millions of files makes NameNode unresponsive for other commands until the deletion completes > ----------------------------------------------------------------------------------------------------------------------------------- > > Key: HDFS-173 > URL: https://issues.apache.org/jira/browse/HDFS-173 > Project: Hadoop HDFS > Issue Type: Bug > Reporter: Suresh Srinivas > Assignee: Suresh Srinivas > > Delete a directory with millions of files. This could take several minutes (observed 12 mins for 9 million files). While the operation is in progress FSNamesystem lock is held and the requests from clients are not handled until deletion completes. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.