[ https://issues.apache.org/jira/browse/HBASE-15406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15340191#comment-15340191 ]
Stephen Yuan Jiang commented on HBASE-15406: -------------------------------------------- When working on HBASE-16008 to add an ephemeral znode to indicate that hbck is running and master maintenance threads should not running, I think there is a simpler idea (surprised that no one brought this up). The problem is that the state change of balancer, split/merge switch, catalog janitor would not be reset when HBCK is terminated by Control-C. I saw the following code in the HBCK code: {code} public void connect() throws IOException { ... // Add a shutdown hook to this thread, in case user tries to // kill the hbck with a ctrl-c, we want to cleanup the lock so that // it is available for further calls Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { IOUtils.closeQuietly(HBaseFsck.this); unlockHbck(); } }); ... {code} Why don't we just push re-set state code in this location and then no problem at all, [~enis]? (I agree that ephemeral znode would be more robust and extensible, but this simple re-set in {{Runtime.getRuntime().addShutdownHook}} is much simpler) > Split / merge switch left disabled after early termination of hbck > ------------------------------------------------------------------ > > Key: HBASE-15406 > URL: https://issues.apache.org/jira/browse/HBASE-15406 > Project: HBase > Issue Type: Bug > Reporter: Ted Yu > Assignee: Heng Chen > Labels: reviewed > Fix For: 2.0.0, 1.3.0, 1.4.0 > > Attachments: HBASE-15406.patch, HBASE-15406.v1.patch, > HBASE-15406_v1.patch, HBASE-15406_v2.patch, test.patch, wip.patch > > > This was what I did on cluster with 1.4.0-SNAPSHOT built Thursday: > Run 'hbase hbck -disableSplitAndMerge' on gateway node of the cluster > Terminate hbck early > Enter hbase shell where I observed: > {code} > hbase(main):001:0> splitormerge_enabled 'SPLIT' > false > 0 row(s) in 0.3280 seconds > hbase(main):002:0> splitormerge_enabled 'MERGE' > false > 0 row(s) in 0.0070 seconds > {code} > Expectation is that the split / merge switches should be restored to default > value after hbck exits. -- This message was sent by Atlassian JIRA (v6.3.4#6332)