hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Umesh Agashe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-16930) AssignmentManager.java:checkWals() function can recur infinitely
Date Fri, 21 Oct 2016 22:58:59 GMT

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

Umesh Agashe commented on HBASE-16930:
--------------------------------------

See the code below:
{code}
  private boolean checkWals(FileSystem fs, Path dir) throws IOException {
    if (!fs.exists(dir)) {
      LOG.debug(dir + " doesn't exist");
      return false;
    }
    if (!fs.getFileStatus(dir).isDirectory()) {
      LOG.warn(dir + " is not a directory");
      return false;
    }
    FileStatus[] files = FSUtils.listStatus(fs, dir);
    if (files == null || files.length == 0) {
      LOG.debug(dir + " has no files");
      return false;
    }
    for (int i = 0; i < files.length; i++) {
      if (files[i].isFile() && files[i].getLen() > 0) {
        LOG.debug(dir + " has a non-empty file: " + files[i].getPath());
        return true;
      } else if (files[i].isDirectory() && checkWals(fs, dir)) {
        LOG.debug(dir + " is a directory and has a non-empty file: " + files[i].getPath());
        return true;
      }
    }
    LOG.debug("Found 0 non-empty wal files for :" + dir);
    return false;
  }
{code}

dir is input arg and without changing it passed to call to checkWals() if child directory
is found.

> AssignmentManager.java:checkWals() function can recur infinitely
> ----------------------------------------------------------------
>
>                 Key: HBASE-16930
>                 URL: https://issues.apache.org/jira/browse/HBASE-16930
>             Project: HBase
>          Issue Type: Bug
>          Components: Region Assignment
>            Reporter: Umesh Agashe
>            Assignee: Umesh Agashe
>         Attachments: HBASE-16930.v1.patch
>
>
> Recursion in AssignmentManager.checkWals() uses the same input argument.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message