Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EC87F17AA4 for ; Sun, 4 Jan 2015 06:52:33 +0000 (UTC) Received: (qmail 25424 invoked by uid 500); 4 Jan 2015 06:52:34 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 25366 invoked by uid 500); 4 Jan 2015 06:52:34 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 25353 invoked by uid 99); 4 Jan 2015 06:52:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jan 2015 06:52:34 +0000 Date: Sun, 4 Jan 2015 06:52:34 +0000 (UTC) From: "Liu Shaohui (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-12801) Failed to truncate a table while maintaing binary region boundaries MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-12801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Liu Shaohui updated HBASE-12801: -------------------------------- Fix Version/s: 0.94.28 2.0.0 Status: Patch Available (was: Open) > Failed to truncate a table while maintaing binary region boundaries > ------------------------------------------------------------------- > > Key: HBASE-12801 > URL: https://issues.apache.org/jira/browse/HBASE-12801 > Project: HBase > Issue Type: Bug > Components: shell > Affects Versions: 0.94.11 > Reporter: Liu Shaohui > Assignee: Liu Shaohui > Priority: Minor > Fix For: 2.0.0, 0.94.28 > > Attachments: HBASE-12801-0.94-v1.diff, HBASE-12801-trunk-v1.diff > > > Binary region boundaries become wrong during > converting byte array to normal string, and back to byte array in truncate_preserve of admin.rb, which makes the truncation of table failed. > See: truncate_preserve method in admin.rb > {code} > splits = h_table.getRegionLocations().keys().map{|i| Bytes.toString(i.getStartKey)}.delete_if{|k| k == ""}.to_java :String > splits = org.apache.hadoop.hbase.util.Bytes.toByteArrays(splits) > {code} > eg: > {code} > \xFA\x00\x00\x00\x00\x00\x00\x00 -> \xEF\xBF\xBD\x00\x00\x00\x00\x00\x00\x00 > \xFC\x00\x00\x00\x00\x00\x00\x00 -> \xEF\xBF\xBD\x00\x00\x00\x00\x00\x00\x00 > {code} > Simple patch is using binary string instead of normal string. -- This message was sent by Atlassian JIRA (v6.3.4#6332)