From cdbaa022766865fcb53ed513f49bcb8c25205294 Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Thu, 17 May 2012 16:27:46 +0000 Subject: [PATCH] HBASE-6029 HBCK doesn't recover Balance switch if exception occurs in onlineHbck() (Maryann) git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1339689 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/hadoop/hbase/util/HBaseFsck.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java index 7b4f4a259be..87a7a06b5c8 100644 --- a/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java +++ b/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java @@ -383,10 +383,12 @@ public class HBaseFsck { // turn the balancer off boolean oldBalancer = admin.balanceSwitch(false); - - onlineConsistencyRepair(); - - admin.balanceSwitch(oldBalancer); + try { + onlineConsistencyRepair(); + } + finally { + admin.balanceSwitch(oldBalancer); + } // Print table summary printTableSummary(tablesInfo);