[ https://issues.apache.org/jira/browse/HBASE-20253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sean Busbey updated HBASE-20253: -------------------------------- Status: In Progress (was: Patch Available) I believe we still need to re-throw the exception even with the improved message. Otherwise, the shell will claim that the operation succeeded because the {{puts}} succeeds and is the last operation. example prior to this patch: {code} $ hbase shell --noninteractive <<EOF > create 'test:some_table', 'family' > snapshot 'test:some_table', 'example_snapshot' > restore_snapshot 'example_snapshot' > EOF Created table test:some_table Took 1.1634 seconds Hbase::Table - test:some_table Took 0.5606 seconds Took 0.1246 seconds java exception ERROR Java::OrgApacheHadoopHbase::TableNotDisabledException: test:some_table [root@hbase19158-1 ~]# echo $? 1 {code} example with this patch: {code} $ hbase shell --noninteractive <<EOF > create 'test:some_table', 'family' > snapshot 'test:some_table', 'example_snapshot' > restore_snapshot 'example_snapshot' > EOF Created table test:some_table Took 1.1208 seconds Hbase::Table - test:some_table Took 0.4879 seconds Table 'test:some_table' should be disabled to restore snapshot. Took 0.1080 seconds [root@hbase19158-1 ~]# echo $? 0 {code} It'd be good to add a test that checks this negative example while we're here. > Error message is missing for restore_snapshot > --------------------------------------------- > > Key: HBASE-20253 > URL: https://issues.apache.org/jira/browse/HBASE-20253 > Project: HBase > Issue Type: Sub-task > Components: shell > Affects Versions: 2.0.0 > Reporter: Peter Somogyi > Assignee: Gabor Bota > Priority: Minor > Attachments: HBASE-20253.master.001.patch, > HBASE-20253.master.002.patch > > > When the table is not disabled and restore_snapshot executed the error > message is useless, only displays the table name. > hbase(main):007:0> restore_snapshot 'tsnap' > ERROR: t > Restore a specified snapshot. > The restore will replace the content of the original table, > bringing back the content to the snapshot state. > The table must be disabled. > Examples: > hbase> restore_snapshot 'snapshotName' > Following command will restore all acl from snapshot table into the table. > hbase> restore_snapshot 'snapshotName', \{RESTORE_ACL=>true} > Took 0.1044 seconds -- This message was sent by Atlassian JIRA (v7.6.3#76005)