You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2016/02/14 02:05:41 UTC

phoenix git commit: PHOENIX-2667 Race condition between IndexBuilder and Split for region lock

Repository: phoenix
Updated Branches:
  refs/heads/master 04c3819f0 -> cdaca287c


PHOENIX-2667 Race condition between IndexBuilder and Split for region lock


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/cdaca287
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/cdaca287
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/cdaca287

Branch: refs/heads/master
Commit: cdaca287cd50fbdd25a9b11d8af6fb0a3b3956cc
Parents: 04c3819
Author: James Taylor <jt...@salesforce.com>
Authored: Sat Feb 13 15:49:31 2016 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Sat Feb 13 15:53:29 2016 -0800

----------------------------------------------------------------------
 .../phoenix/hbase/index/builder/IndexBuildManager.java    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/cdaca287/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/builder/IndexBuildManager.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/builder/IndexBuildManager.java b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/builder/IndexBuildManager.java
index ae2125e..f411b8e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/builder/IndexBuildManager.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/hbase/index/builder/IndexBuildManager.java
@@ -39,7 +39,8 @@ import org.apache.phoenix.hbase.index.parallel.QuickFailingTaskRunner;
 import org.apache.phoenix.hbase.index.parallel.Task;
 import org.apache.phoenix.hbase.index.parallel.TaskBatch;
 import org.apache.phoenix.hbase.index.parallel.ThreadPoolBuilder;
-import org.apache.phoenix.hbase.index.parallel.ThreadPoolManager;
+
+import com.google.common.util.concurrent.MoreExecutors;
 
 /**
  * Manage the building of index updates from primary table updates.
@@ -77,10 +78,11 @@ public class IndexBuildManager implements Stoppable {
    * @throws IOException if an {@link IndexBuilder} cannot be correctly steup
    */
   public IndexBuildManager(RegionCoprocessorEnvironment env) throws IOException {
-    this(getIndexBuilder(env), new QuickFailingTaskRunner(ThreadPoolManager.getExecutor(
-      getPoolBuilder(env), env)));
+    // Prevent deadlock by using single thread for all reads so that we know
+    // we can get the ReentrantRWLock. See PHOENIX-2671 for more details.
+    this(getIndexBuilder(env), new QuickFailingTaskRunner(MoreExecutors.sameThreadExecutor()));
   }
-
+  
   private static IndexBuilder getIndexBuilder(RegionCoprocessorEnvironment e) throws IOException {
     Configuration conf = e.getConfiguration();
     Class<? extends IndexBuilder> builderClass =