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

Matteo Bertozzi commented on HBASE-7896:
----------------------------------------

Looking at the code and trying it out... a couple of notes, aside from the 
discussion above.

The concept, of scanning META and for each region recreate the folder with the 
new name
and move the files in is ok, and it's also used by the clone snapshot.

This script doesn't consider ACL. This means that if you rename the table, 
the ACL from the old table name are not moved to the new table, 
and they are not even removed.

The .regioninfo file doesn't seems to be created in the proper way...
by comparing the HRegion code with the rename_table script
{code}
// HRegion.java code HRegion.checkRegioninfoOnFilesystem()
this.regionInfo.write(out);
out.write('\n');
out.write('\n');
out.write(Bytes.toBytes(this.regionInfo.toString()));

# rename_table.rb
out = fs.create(regioninfofile)
newR.getRegionInfo().write(out)
newHtd.write(out)
out.close()
{code}

At the end of the script you create the zknode for the new table but you don't 
delete the old one...
also the node is created in the enabled state. This means that if I do, 
is_enabled it returns true but the scan or other operations doesn't work since 
the table is not really enabled (regions assgned), and if you don't call enable 
you're in a weird state that can break monitoring tools or similar.
                
> make rename_table working in 92/94
> ----------------------------------
>
>                 Key: HBASE-7896
>                 URL: https://issues.apache.org/jira/browse/HBASE-7896
>             Project: HBase
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 0.92.2, 0.94.5
>            Reporter: Tianying Chang
>            Assignee: Tianying Chang
>             Fix For: 0.92.2, 0.94.6
>
>         Attachments: rename_table.rb
>
>
> The rename_table function is very useful for our customers. However, 
> rename_table.rb does not work for 92/94. It has several bugs. It will be 
> useful to fix them so that users can solve their problems. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to