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

Pankaj Kumar edited comment on HBASE-21598 at 6/25/19 5:54 AM:
---------------------------------------------------------------

This is happening due to FSUtils.getWALTableDir(),
{code:java}
  public static Path getWALTableDir(final Configuration conf, final TableName 
tableName)
      throws IOException {
    return new Path(new Path(getWALRootDir(conf), 
tableName.getNamespaceAsString()),
        tableName.getQualifierAsString());
  }
{code}
Here it returns the table dir path without including "data" in path, so it is 
creating namespace dir under the root dir when "hbase.wal.dir" not configured.

Simple fix will be,
{code:java}
  public static Path getWALTableDir(final Configuration conf, final TableName 
tableName)
      throws IOException {
    return new Path(new Path(new Path(getWALRootDir(conf), 
HConstants.BASE_NAMESPACE_DIR),
        tableName.getNamespaceAsString()), tableName.getQualifierAsString());
  }
{code}
[~sreenivasulureddy] , are you working on this? Shall I prepare and attach the 
patch?


was (Author: pankaj2461):
This is happening due to  FSUtils.getWALTableDir(), 
{code}
  public static Path getWALTableDir(final Configuration conf, final TableName 
tableName)
      throws IOException {
    return new Path(new Path(getWALRootDir(conf), 
tableName.getNamespaceAsString()),
        tableName.getQualifierAsString());
  }
{code}

Here it returns the table dir path without including "data" path, so it is 
creating namespace dir under the root dir when "hbase.wal.dir" not configured.

Simple fix will be,
{code}
  public static Path getWALTableDir(final Configuration conf, final TableName 
tableName)
      throws IOException {
    return new Path(new Path(new Path(getWALRootDir(conf), 
HConstants.BASE_NAMESPACE_DIR),
        tableName.getNamespaceAsString()), tableName.getQualifierAsString());
  }
{code}

[~sreenivasulureddy] , are you working on this? Shall I prepare and attach the 
patch?

> HBASE_WAL_DIR if not configured, recovered.edits directory's are sidelined 
> from the table dir path.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-21598
>                 URL: https://issues.apache.org/jira/browse/HBASE-21598
>             Project: HBase
>          Issue Type: Bug
>          Components: Recovery, wal
>    Affects Versions: 2.1.1
>            Reporter: Y. SREENIVASULU REDDY
>            Priority: Major
>
> If HBASE_WAL_DIR if not configured, then 
> recovered.edits dir path should be old method only.
> If user is creating x no. of tables, in different namespaces, then all are 
> creating in the "hbase.rootdir" path only.
> {code}
> /<hbase.rootdir>/data/<namespace>/<table>/<regionDir>/recovered.edits
> eg:
> /hbase/data/default/testTable/eaf343d35d3e66e6e5fd38106ba61c62/recovered.edits
> {code}
> But the format is currently. 
> {code}
> /<hbase.rootdir>/<namespace>/<table>/<regionDir>/recovered.edits
> eg:
> /hbase/default/testTable/eaf343d35d3e66e6e5fd38106ba61c62/recovered.edits
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to