You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2012/12/31 06:02:16 UTC

[jira] [Comment Edited] (HBASE-7467) CleanerChore checkAndDeleteDirectory not deleting empty directories.

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

Ted Yu edited comment on HBASE-7467 at 12/31/12 5:01 AM:
---------------------------------------------------------

Attached is Jesse's patch + mine both in a single file. But they can still noth be applied separatly. I'm not sure what's the best way to go, so I will let you pickup the recommanded one.

Also, I'm wondering if I should replace
if (children == null) return fs.delete(toCheck, false);

by 
{code}
if (children == null) {
  try {
    return fs.delete(toCheck, false);
  } catch (IOException e) {
    if (LOG.isTraceEnabled()) {
      LOG.trace("Couldn't delete directory: " + toCheck, e);
    }
  }
  // couldn't delete w/o exception, so we can't return success.
  return false;
}
{code}
Like Jesse did too...
                
      was (Author: jmspaggi):
    Attached is Jesse's patch + mine both in a single file. But they can still noth be applied separatly. I'm not sure what's the best way to go, so I will let you pickup the recommanded one.

Also, I'm wondering if I should replace
if (children == null) return fs.delete(toCheck, false);

by 
if (children == null) {
  try {
    return fs.delete(toCheck, false);
  } catch (IOException e) {
    if (LOG.isTraceEnabled()) {
      LOG.trace("Couldn't delete directory: " + toCheck, e);
    }
  }
  // couldn't delete w/o exception, so we can't return success.
  return false;
}

Like Jesse did too...
                  
> CleanerChore checkAndDeleteDirectory not deleting empty directories.
> --------------------------------------------------------------------
>
>                 Key: HBASE-7467
>                 URL: https://issues.apache.org/jira/browse/HBASE-7467
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Jean-Marc Spaggiari
>            Priority: Minor
>             Fix For: 0.96.0, 0.94.5
>
>         Attachments: HBASE-7465_7467-v3.patch, HBASE-7467.patch, HBASE-7467-v2.patch
>
>
> CleanerChore checkAndDeleteDirectory is not deleting empty directories. As a result, some directories are kept in the FS but should have been removed.
> To reproduce, simply create an empty directory under /hbase/.archive/table_name/. If you place a file into this directory, it's not more empty and therefore it's correctly removed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira