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

[jira] [Created] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

HBase shell assign and unassign unusable if region name includes binary-encoded data
------------------------------------------------------------------------------------

                 Key: HBASE-4115
                 URL: https://issues.apache.org/jira/browse/HBASE-4115
             Project: HBase
          Issue Type: Bug
          Components: shell
    Affects Versions: 0.90.3, 0.90.2
            Reporter: Ryan Brush
            Priority: Minor


When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.

This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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

        

[jira] [Updated] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

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

Ryan Brush updated HBASE-4115:
------------------------------

    Attachment: admin.patch

Update original patch to use .to_java_bytes, consistently with other methods.

Apologies for the lack of a unit test...it looks like this entire flow of the shell could use more unit tests but I can't jump into that right away.

> HBase shell assign and unassign unusable if region name includes binary-encoded data
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-4115
>                 URL: https://issues.apache.org/jira/browse/HBASE-4115
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.2, 0.90.3
>            Reporter: Ryan Brush
>            Priority: Minor
>         Attachments: admin.patch, admin.patch
>
>
> When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.
> This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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

        

[jira] [Updated] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

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

Ryan Brush updated HBASE-4115:
------------------------------

    Attachment: admin.patch

Simple patch that fixes the issue

> HBase shell assign and unassign unusable if region name includes binary-encoded data
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-4115
>                 URL: https://issues.apache.org/jira/browse/HBASE-4115
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.2, 0.90.3
>            Reporter: Ryan Brush
>            Priority: Minor
>         Attachments: admin.patch
>
>
> When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.
> This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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

        

[jira] [Resolved] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

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

stack resolved HBASE-4115.
--------------------------

       Resolution: Fixed
    Fix Version/s: 0.90.4
     Hadoop Flags: [Reviewed]

Thank you for the patch Ryan.  Applied to branch an trunk.

> HBase shell assign and unassign unusable if region name includes binary-encoded data
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-4115
>                 URL: https://issues.apache.org/jira/browse/HBASE-4115
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.2, 0.90.3
>            Reporter: Ryan Brush
>            Priority: Minor
>             Fix For: 0.90.4
>
>         Attachments: admin.patch, admin.patch
>
>
> When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.
> This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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

        

[jira] [Commented] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

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

Ryan Brush commented on HBASE-4115:
-----------------------------------

The UI doesn't escape the names, but it looks like other methods (like get) do invoke .to_java_bytes on such input strings.  Assign and unassign were using Bytes.toBinary for some reason. So to be more consistent a better fix for this patch would be to use .to_java_bytes over Bytes.toBytesBinary. 

I'll make sure this fixes the problem I saw and adjust the patch appropriately.

> HBase shell assign and unassign unusable if region name includes binary-encoded data
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-4115
>                 URL: https://issues.apache.org/jira/browse/HBASE-4115
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.2, 0.90.3
>            Reporter: Ryan Brush
>            Priority: Minor
>         Attachments: admin.patch
>
>
> When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.
> This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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

        

[jira] [Commented] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

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

Hudson commented on HBASE-4115:
-------------------------------

Integrated in HBase-TRUNK #2042 (See [https://builds.apache.org/job/HBase-TRUNK/2042/])
    HBASE-4115 HBase shell assign and unassign unusable if region name includes binary-encoded data

stack : 
Files : 
* /hbase/trunk/CHANGES.txt
* /hbase/trunk/src/main/ruby/hbase/admin.rb


> HBase shell assign and unassign unusable if region name includes binary-encoded data
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-4115
>                 URL: https://issues.apache.org/jira/browse/HBASE-4115
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.2, 0.90.3
>            Reporter: Ryan Brush
>            Priority: Minor
>             Fix For: 0.90.4
>
>         Attachments: admin.patch, admin.patch
>
>
> When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.
> This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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

        

[jira] [Commented] (HBASE-4115) HBase shell assign and unassign unusable if region name includes binary-encoded data

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

stack commented on HBASE-4115:
------------------------------

Is this right Ryan? I thought the UI already escaped region names that comprised binary data?  It used to be the case -- perhaps since broken -- where you could copy what was into the UI and then as long as you double-quoted it, it'd work.  Here is snippet from shell help:

{code}
If you are using binary keys or values and need to enter them in the shell, use
double-quote'd hexadecimal representation. For example:

  hbase> get 't1', "key\x03\x3f\xcd"
  hbase> get 't1', "key\003\023\011"
  hbase> put 't1', "test\xef\xff", 'f1:', "\x01\x33\x40"
{code}

hbck should print out escaped binary but I would not be surprised if it did not... so here you should be able to copy it into shell and double-quote it and it'd work (If you single-quote it, the shell does not interpret the bytes IIRC).

So you are pasting actual binary data into the shell?

Thanks.



> HBase shell assign and unassign unusable if region name includes binary-encoded data
> ------------------------------------------------------------------------------------
>
>                 Key: HBASE-4115
>                 URL: https://issues.apache.org/jira/browse/HBASE-4115
>             Project: HBase
>          Issue Type: Bug
>          Components: shell
>    Affects Versions: 0.90.2, 0.90.3
>            Reporter: Ryan Brush
>            Priority: Minor
>         Attachments: admin.patch
>
>
> When using the hbase shell assign and unassign commands, we should be able to copy region names from the hbck utility or the web page hosted by the HMaster process.  But if these names have encoded binary data, they region name won't match and the command will fail.
> This is easily fixed by using Bytes.toBytesBinary on the region name in these commands rather than the raw Bytes.ToBytes.

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