hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-9270) [0.94] FSTableDescriptors caching is racy
Date Tue, 04 Mar 2014 11:54:21 GMT

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

Hadoop QA commented on HBASE-9270:
----------------------------------

{color:red}-1 overall{color}.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12632491/HBASE-9270.1.patch
  against trunk revision .
  ATTACHMENT ID: 12632491

    {color:green}+1 @author{color}.  The patch does not contain any @author tags.

    {color:red}-1 tests included{color}.  The patch doesn't appear to include any new or modified
tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    {color:red}-1 patch{color}.  The patch command could not apply the patch.

Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/8878//console

This message is automatically generated.

> [0.94] FSTableDescriptors caching is racy
> -----------------------------------------
>
>                 Key: HBASE-9270
>                 URL: https://issues.apache.org/jira/browse/HBASE-9270
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.94.11
>            Reporter: Andrew Purtell
>            Priority: Minor
>         Attachments: HBASE-9270.1.patch
>
>
> An occasionally failing test in 0.92 branch that concurrently executes master operations
on a single table found this problem in FSTableDescriptors:
> {code}
> diff --git src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
> index e882621..b0042cd 100644
> --- src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
> +++ src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
> @@ -221,8 +221,15 @@ public class FSTableDescriptors implements TableDescriptors {
>      if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(htd.getNameAsString())) {
>        throw new NotImplementedException();
>      }
> -    if (!this.fsreadonly) updateHTableDescriptor(this.fs, this.rootdir, htd);
> -    long modtime = getTableInfoModtime(this.fs, this.rootdir, htd.getNameAsString());
> +    if (fsreadonly) {
> +      // Cannot cache here.
> +      // We can't know if a modtime from the most recent file found in a
> +      // directory listing at some arbitrary point in time still corresponds
> +      // to the latest, nor that our htd is the latest.
> +      return;
> +    }
> +    // Cache with the modtime of the descriptor we wrote
> +    long modtime = updateHTableDescriptor(this.fs, this.rootdir, htd).getModificationTime();
>      this.cache.put(htd.getNameAsString(), new TableDescriptorModtime(modtime, htd));
>    }
> {code}
> After HBASE-7305 master operations are serialized by a write lock on the table.
> However, 0.94 has code with the same issue:
> {code}
>   @Override
>   public void add(HTableDescriptor htd) throws IOException {
>     if (Bytes.equals(HConstants.ROOT_TABLE_NAME, htd.getName())) {
>       throw new NotImplementedException();
>     }
>     if (Bytes.equals(HConstants.META_TABLE_NAME, htd.getName())) {
>       throw new NotImplementedException();
>     }
>     if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(htd.getNameAsString())) {
>       throw new NotImplementedException();
>     }
>     if (!this.fsreadonly) updateHTableDescriptor(this.fs, this.rootdir, htd);
>     String tableName = htd.getNameAsString();
>     long modtime = getTableInfoModtime(this.fs, this.rootdir, tableName);
>     long dirmodtime = getTableDirModtime(this.fs, this.rootdir, tableName);
>     this.cache.put(tableName, new TableDescriptorModtime(modtime, dirmodtime, htd));
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message