You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Nicolas Spiegelberg (JIRA)" <ji...@apache.org> on 2011/07/22 22:48:57 UTC

[jira] [Created] (HBASE-4127) HBaseAdmin : Don't modify table's name away

HBaseAdmin : Don't modify table's name away
-------------------------------------------

                 Key: HBASE-4127
                 URL: https://issues.apache.org/jira/browse/HBASE-4127
             Project: HBase
          Issue Type: Bug
          Components: client, master
    Affects Versions: 0.92.0
            Reporter: Nicolas Spiegelberg
            Assignee: Nicolas Spiegelberg
            Priority: Minor


One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (HBASE-4127) HBaseAdmin : Don't modify table's name away

Posted by Stack <st...@duboce.net>.
Try your proposal.  I don't think it will work.  It'll fail over in
RPC where expectation is that there is a null/default constructor on
every Writable.
St.Ack

On Fri, Jul 22, 2011 at 9:24 PM, Ted Yu <yu...@gmail.com> wrote:
> My proposal below would make default HTableDescriptor ctor package private.
>
> If there is no object, I will log a new JIRA.
>
> On Fri, Jul 22, 2011 at 4:27 PM, Ted Yu (JIRA) <ji...@apache.org> wrote:
>
>>
>>    [
>> https://issues.apache.org/jira/browse/HBASE-4127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069840#comment-13069840]
>>
>> Ted Yu commented on HBASE-4127:
>> -------------------------------
>>
>> +1 on the patch.
>>
>> Long term, we should hide this ctor, HTableDescriptor().
>> Its existence is to support the following pattern:
>> {code}
>>      hTableDescriptor = new HTableDescriptor();
>>      hTableDescriptor.readFields(fsDataInputStream);
>> {code}
>> I think we should replace this ctor with the following:
>> {code}
>> public HTableDescriptor getTableDescriptor(DataInputStream dataInputStream)
>> {code}
>>
>> > HBaseAdmin : Don't modify table's name away
>> > -------------------------------------------
>> >
>> >                 Key: HBASE-4127
>> >                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>> >             Project: HBase
>> >          Issue Type: Bug
>> >          Components: client, master
>> >    Affects Versions: 0.92.0
>> >            Reporter: Nicolas Spiegelberg
>> >            Assignee: Nicolas Spiegelberg
>> >            Priority: Blocker
>> >         Attachments: HBASE-4127.patch
>> >
>> >
>> > One of the developers was using the default constructor for
>> HTableDescriptor, which is sadly a bad constructor that should never be
>> used. It made the tablename empty in META & caused an ERROR cycle as region
>> onlining kept failing. We should have never let this happen. Don't do table
>> modifications if the HTableDescriptor name doesn't match the table name
>> passed in.
>>
>> --
>> This message is automatically generated by JIRA.
>> For more information on JIRA, see: http://www.atlassian.com/software/jira
>>
>>
>>
>

Re: [jira] [Commented] (HBASE-4127) HBaseAdmin : Don't modify table's name away

Posted by Ted Yu <yu...@gmail.com>.
My proposal below would make default HTableDescriptor ctor package private.

If there is no object, I will log a new JIRA.

On Fri, Jul 22, 2011 at 4:27 PM, Ted Yu (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/HBASE-4127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069840#comment-13069840]
>
> Ted Yu commented on HBASE-4127:
> -------------------------------
>
> +1 on the patch.
>
> Long term, we should hide this ctor, HTableDescriptor().
> Its existence is to support the following pattern:
> {code}
>      hTableDescriptor = new HTableDescriptor();
>      hTableDescriptor.readFields(fsDataInputStream);
> {code}
> I think we should replace this ctor with the following:
> {code}
> public HTableDescriptor getTableDescriptor(DataInputStream dataInputStream)
> {code}
>
> > HBaseAdmin : Don't modify table's name away
> > -------------------------------------------
> >
> >                 Key: HBASE-4127
> >                 URL: https://issues.apache.org/jira/browse/HBASE-4127
> >             Project: HBase
> >          Issue Type: Bug
> >          Components: client, master
> >    Affects Versions: 0.92.0
> >            Reporter: Nicolas Spiegelberg
> >            Assignee: Nicolas Spiegelberg
> >            Priority: Blocker
> >         Attachments: HBASE-4127.patch
> >
> >
> > One of the developers was using the default constructor for
> HTableDescriptor, which is sadly a bad constructor that should never be
> used. It made the tablename empty in META & caused an ERROR cycle as region
> onlining kept failing. We should have never let this happen. Don't do table
> modifications if the HTableDescriptor name doesn't match the table name
> passed in.
>
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>

[jira] [Work started] (HBASE-4127) HBaseAdmin : Don't modify table's name away

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

Work on HBASE-4127 started by Nicolas Spiegelberg.

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4127.patch
>
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4127) HBaseAdmin : Don't modify table's name away

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

stack updated HBASE-4127:
-------------------------

    Priority: Blocker  (was: Minor)

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4127) HBaseAdmin : Don't modify table's name away

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

Nicolas Spiegelberg updated HBASE-4127:
---------------------------------------

    Attachment: HBASE-4127.patch

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>         Attachments: HBASE-4127.patch
>
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4127) HBaseAdmin : Don't modify table's name away

Posted by "Ted Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069840#comment-13069840 ] 

Ted Yu commented on HBASE-4127:
-------------------------------

+1 on the patch.

Long term, we should hide this ctor, HTableDescriptor().
Its existence is to support the following pattern:
{code}
      hTableDescriptor = new HTableDescriptor();
      hTableDescriptor.readFields(fsDataInputStream);
{code}
I think we should replace this ctor with the following:
{code}
public HTableDescriptor getTableDescriptor(DataInputStream dataInputStream)
{code}

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>         Attachments: HBASE-4127.patch
>
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (HBASE-4127) HBaseAdmin : Don't modify table's name away

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

Nicolas Spiegelberg resolved HBASE-4127.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.92.0

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4127.patch
>
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4127) HBaseAdmin : Don't modify table's name away

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069881#comment-13069881 ] 

Hudson commented on HBASE-4127:
-------------------------------

Integrated in HBase-TRUNK #2046 (See [https://builds.apache.org/job/HBase-TRUNK/2046/])
    HBASE-4127 Don't modify table's name away in HBaseAdmin

nspiegelberg : 
Files : 
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/master/handler/ModifyTableHandler.java
* /hbase/trunk/CHANGES.txt


> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4127.patch
>
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4127) HBaseAdmin : Don't modify table's name away

Posted by "Nicolas Spiegelberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13069739#comment-13069739 ] 

Nicolas Spiegelberg commented on HBASE-4127:
--------------------------------------------

More clarification, the developer ran:
{code}
byte[] table = Bytes.toBytes("test_table");
HBaseConfiguration conf = openHBaseConfiguration(HBASE_TIER_NAME);
HBaseAdmin admin = new HBaseAdmin(conf);
HTableDescriptor desc = new HTableDescriptor();
HColumnDescriptor col_desc = new HColumnDescriptor(Bytes.toBytes("test"));
desc.addFamily(col_desc);
admin.disableTable(table);
admin.modifyTable(table, desc);
admin.enableTable(table);
{code}

This is horrible, miserable sadness.  The problem is the line that does 'new HTableDescriptor()' which will create an HTD with an empty tablename.  Instead, the below code is the hotness that should be used:

{code}
byte[] table = Bytes.toBytes("test_table");
HBaseConfiguration conf = openHBaseConfiguration(HBA​SE_TIER_NAME);
HBaseAdmin admin = new HBaseAdmin(conf);
HTableDescriptor desc = admin.getTableDescriptor(t​able);
desc.getFamily(Bytes.toByt​es("test")).setMaxVersions​(1);
admin.disableTable(table);
admin.disableTable(table);
admin.modifyTable(table, desc);
admin.enableTable(table);
{code}

Calling getTableDescriptor() will give us the original contents of the HTD so we can make the 1 necessary alteration to the table (maxversions : 3 => 1)

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Minor
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (HBASE-4127) HBaseAdmin : Don't modify table's name away

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

stack commented on HBASE-4127:
------------------------------

+1

> HBaseAdmin : Don't modify table's name away
> -------------------------------------------
>
>                 Key: HBASE-4127
>                 URL: https://issues.apache.org/jira/browse/HBASE-4127
>             Project: HBase
>          Issue Type: Bug
>          Components: client, master
>    Affects Versions: 0.92.0
>            Reporter: Nicolas Spiegelberg
>            Assignee: Nicolas Spiegelberg
>            Priority: Blocker
>         Attachments: HBASE-4127.patch
>
>
> One of the developers was using the default constructor for HTableDescriptor, which is sadly a bad constructor that should never be used. It made the tablename empty in META & caused an ERROR cycle as region onlining kept failing. We should have never let this happen. Don't do table modifications if the HTableDescriptor name doesn't match the table name passed in.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira