You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "James Kennedy (JIRA)" <ji...@apache.org> on 2007/07/10 01:58:04 UTC

[jira] Created: (HADOOP-1581) HBASE: Un-openable tablename bug

HBASE: Un-openable tablename bug
--------------------------------

                 Key: HADOOP-1581
                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
             Project: Hadoop
          Issue Type: Bug
          Components: contrib/hbase
    Affects Versions: 0.14.0
            Reporter: James Kennedy
            Priority: Critical


If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.

Try:
1) Create table TESTOne
2) Create table TEST
3) Open table TEST

The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than "_" in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne... and not Test_... like it should.  

The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HADOOP-1581:
--------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Committed.

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HADOOP-1581:
--------------------------

    Status: Patch Available  (was: Open)

Builds and passes all tests locally.  Trying on hudson.

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman resolved HADOOP-1581.
-----------------------------------

    Resolution: Fixed

Ok, now that I see the context in which it is being used (comparing a row key to a table name), I understand why you can't do what I suggested in the previous comment.

Closing issue.

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "James Kennedy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Kennedy updated HADOOP-1581:
----------------------------------

    Description: 
If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.

Try:
1) Create table TESTOne
2) Create table TEST
3) Open table TEST

The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  

The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

  was:
If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.

Try:
1) Create table TESTOne
2) Create table TEST
3) Open table TEST

The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than "_" in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne... and not Test_... like it should.  

The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.


> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512763 ] 

stack commented on HADOOP-1581:
-------------------------------

I only have the name (Its used parsing meta table rows).

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512742 ] 

Hadoop QA commented on HADOOP-1581:
-----------------------------------

+1

http://issues.apache.org/jira/secure/attachment/12361839/hadoop-1581-v3.patch applied and successfully tested against trunk revision r556335.

Test results:   http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/414/testReport/
Console output: http://lucene.zones.apache.org:8080/hudson/job/Hadoop-Patch/414/console

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HADOOP-1581:
--------------------------

    Attachment: hadoop-1581.patch

Suggested fix for this issue.

HADOOP-1581 HBASE: Un-openable tablename bug
Change format of region names from TABLENAME_STARTROW_ENDROW-RANDOMID
to TABLENAME,STARTROW,ENDROW-RANDOMID. Makes it so lone table name will
sort before any region of said table.
M src/contrib/hbase/src/test/hbase-site.xml
    (hbase.client.retries.number): Removed. Wasdefault value for this property.
    (hbase.master.meta.thread.rescanfrequency,
    hbase.server.thread.wakefrequency,
    hbase.regionserver.handler.count): Add values that are less than
    default so unit tests are even more responsive (and finished
    quicker).
M src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java
    Change test so it expects region info name that has ',' delimiters
    rather than '_' delimiters.
* src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java
    Rename testTable as testCreateTable.
    (testTableNameClash): Test for this issue.
* src/contrib/hbase/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
    Comment on table name sorting.
* src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java
    Change format of region names so delimiter is ',' rather than '_'.

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "Jim Kellerman (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jim Kellerman reopened HADOOP-1581:
-----------------------------------


Rather than extracting the table name from the region name, why not get it from the HRegionInfo since it contains the HTableDescriptor which has the name of the table in it?

static Text getRegionName(HRegionInfo info) {
  return info.getTableDesc().getName();
}

or is it the case that all you have is the region name and not the HRegionInfo?



> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HADOOP-1581:
--------------------------

    Attachment: hadoop-1581-2.patch

Version 2 adds fix for "Incidentally that IF statement will report "table found" even when that is not the case."

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HADOOP-1581) HBASE: Un-openable tablename bug

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack updated HADOOP-1581:
--------------------------

    Attachment: hadoop-1581-v3.patch

Version that will apply after hadoop-1574 commit

> HBASE: Un-openable tablename bug
> --------------------------------
>
>                 Key: HADOOP-1581
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1581
>             Project: Hadoop
>          Issue Type: Bug
>          Components: contrib/hbase
>    Affects Versions: 0.14.0
>            Reporter: James Kennedy
>            Priority: Critical
>         Attachments: hadoop-1581-2.patch, hadoop-1581-v3.patch, hadoop-1581.patch
>
>
> If you create a table whose name is the beginning of an already existing table name, you will not be able to open the table.
> Try:
> 1) Create table TESTOne
> 2) Create table TEST
> 3) Open table TEST
> The reason is that the the META keys augment the table name with _[regionID].  So when looking up table TEST, a scanner is opened on the HMemCache Meta region with a start key of "TEST".  But the HMemcacheScanner backingMaps (TreeMaps) are keyed with the augmented table names where TESTOne_[regionid1] comes before TEST_[regionid2] because 'O' is lower than _ in the ASCII table.  The backingMaps[i].tailMap(firstKey).keySet().iterator() line in HMemCache returns an iterator starting from TestOne_... and not Test_... like it should.  
> The "if(!regionInfo.tableDesc.getName().equals(tableName)) {"  line in HClient will cause the method to stop searching for more regions of that table and the number of found tables for tableName will be 0.  Incidentally that IF statement will report "table found" even when that is not the case.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.