From 3faee0a292ba34751a472320b1d281915b379332 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 10 Nov 2010 00:18:00 +0000 Subject: [PATCH] HBASE-3212 More testing of enable/disable uncovered base condition not in place; i.e. that only one enable/disable runs at a time git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1033303 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 ++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java | 5 ++++- .../hadoop/hbase/master/handler/ClosedRegionHandler.java | 2 +- .../hadoop/hbase/master/handler/OpenedRegionHandler.java | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 70b1bbe4061..6d62022527d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -665,6 +665,8 @@ Release 0.90.0 - Unreleased HBASE-3207 If we get IOException when closing a region, we should still remove it from online regions and complete the close in ZK HBASE-3199 large response handling: some fixups and cleanups + HBASE-3212 More testing of enable/disable uncovered base condition not in + place; i.e. that only one enable/disable runs at a time IMPROVEMENTS diff --git a/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index 6b04510fc63..850a23354ce 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -513,8 +513,11 @@ implements HMasterInterface, HMasterRegionInterface, MasterServices, Server { conf.getInt("hbase.master.executor.serverops.threads", 3)); this.executorService.startExecutorService(ExecutorType.MASTER_META_SERVER_OPERATIONS, conf.getInt("hbase.master.executor.serverops.threads", 2)); + // We depend on there being only one instance of this executor running + // at a time. To do concurrency, would need fencing of enable/disable of + // tables. this.executorService.startExecutorService(ExecutorType.MASTER_TABLE_OPERATIONS, - conf.getInt("hbase.master.executor.tableops.threads", 3)); + conf.getInt("hbase.master.executor.tableops.threads", 1)); // Put up info server. int port = this.conf.getInt("hbase.master.info.port", 60010); diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java index c2027548126..c98ed17742a 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/ClosedRegionHandler.java @@ -83,7 +83,7 @@ public class ClosedRegionHandler extends EventHandler implements TotesHRegionInf LOG.debug("Handling CLOSED event for " + regionInfo.getEncodedName()); // Check if this table is being disabled or not if (this.assignmentManager.getZKTable(). - isDisabledTable(this.regionInfo.getTableDesc().getNameAsString())) { + isDisablingOrDisabledTable(this.regionInfo.getTableDesc().getNameAsString())) { assignmentManager.offlineDisabledRegion(regionInfo); return; } diff --git a/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java b/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java index 54b0fc9a238..0f0ae657dae 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java +++ b/src/main/java/org/apache/hadoop/hbase/master/handler/OpenedRegionHandler.java @@ -92,7 +92,7 @@ public class OpenedRegionHandler extends EventHandler implements TotesHRegionInf regionInfo.getEncodedName() + ")", e); } this.assignmentManager.regionOnline(regionInfo, serverInfo); - if (this.assignmentManager.getZKTable().isDisabledTable( + if (this.assignmentManager.getZKTable().isDisablingOrDisabledTable( regionInfo.getTableDesc().getNameAsString())) { LOG.debug("Opened region " + regionInfo.getRegionNameAsString() + " but " + "this table is disabled, triggering close of region");