phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-2667 Race condition between IndexBuilder and Split for region lock
Date Sun, 14 Feb 2016 01:09:57 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 d76e630ba -> 6a6b64b23


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/6a6b64b2
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/6a6b64b2
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/6a6b64b2

Branch: refs/heads/4.x-HBase-1.0
Commit: 6a6b64b23b661b7fd544c356f00c0f9ff692cd02
Parents: d76e630
Author: James Taylor <jtaylor@salesforce.com>
Authored: Sat Feb 13 15:49:31 2016 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Sat Feb 13 17:07:39 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/6a6b64b2/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 =


Mime
View raw message