phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [2/3] phoenix git commit: PHOENIX-4190 Salted local index failure is causing region server to abort
Date Mon, 11 Sep 2017 21:53:09 GMT
PHOENIX-4190 Salted local index failure is causing region server to abort


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 78031ba4b5fe3585dd6c2dfc936a1917b757662f
Parents: d0f4904
Author: James Taylor <jtaylor@salesforce.com>
Authored: Mon Sep 11 12:21:50 2017 -0700
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Mon Sep 11 14:51:36 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/index/IndexMaintainer.java   | 2 +-
 .../org/apache/phoenix/index/PhoenixIndexFailurePolicy.java   | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/78031ba4/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
index 840d535..c5c3dda 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java
@@ -784,7 +784,7 @@ public class IndexMaintainer implements Writable, Iterable<ColumnReference>
{
         assert (isLocalIndex);
         ImmutableBytesPtr ptr =
                 new ImmutableBytesPtr(indexRowKeyPtr.get(),( indexRowKeyPtr.getOffset()
-                        + (nIndexSaltBuckets > 0 ? 1 : 0)), viewIndexId.length);
+                        + (!isLocalIndex && nIndexSaltBuckets > 0 ? 1 : 0)), viewIndexId.length);
         return ptr.copyBytesIfNecessary();
     }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/78031ba4/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
index c91e36e..671e3ef 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/index/PhoenixIndexFailurePolicy.java
@@ -39,6 +39,7 @@ import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
+import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.phoenix.coprocessor.MetaDataProtocol.MetaDataMutationResult;
 import org.apache.phoenix.coprocessor.MetaDataProtocol.MutationCode;
 import org.apache.phoenix.hbase.index.table.HTableInterfaceReference;
@@ -288,7 +289,11 @@ public class PhoenixIndexFailurePolicy extends DelegateIndexFailurePolicy
{
                                 new ImmutableBytesWritable(mutation.getRow(), offset,
                                         mutation.getRow().length - offset));
                 String indexTableName = localIndexNames.get(new ImmutableBytesWritable(viewId));
-                indexTableNames.add(indexTableName);
+                if (indexTableName == null) {
+                    LOG.error("Unable to find local index on " + ref.getTableName() + " with
viewID of " + Bytes.toStringBinary(viewId));
+                } else {
+                    indexTableNames.add(indexTableName);
+                }
             }
         } catch (ClassNotFoundException e) {
             throw new IOException(e);


Mime
View raw message