Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 f480b29f8 -> b4e13730a
PHOENIX-4226 Server crashes on local index write failure with mix of local and non local indexes Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/b4e13730 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/b4e13730 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/b4e13730 Branch: refs/heads/4.x-HBase-1.1 Commit: b4e13730adcdc5b72f4f7d646c73c53f4e38fd20 Parents: f480b29 Author: James Taylor <[email protected]> Authored: Fri Sep 22 23:14:24 2017 -0700 Committer: James Taylor <[email protected]> Committed: Fri Sep 22 23:19:07 2017 -0700 ---------------------------------------------------------------------- .../org/apache/phoenix/index/PhoenixIndexFailurePolicy.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/b4e13730/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 5666da9..ee3b380 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 @@ -51,6 +51,7 @@ import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.schema.PIndexState; import org.apache.phoenix.schema.PTable; +import org.apache.phoenix.schema.PTable.IndexType; import org.apache.phoenix.util.IndexUtil; import org.apache.phoenix.util.MetaDataUtil; import org.apache.phoenix.util.PhoenixRuntime; @@ -265,9 +266,11 @@ public class PhoenixIndexFailurePolicy extends DelegateIndexFailurePolicy { Map<ImmutableBytesWritable, String> localIndexNames = new HashMap<ImmutableBytesWritable, String>(); for (PTable index : indexes) { - if (localIndex == null) localIndex = index; - localIndexNames.put(new ImmutableBytesWritable(MetaDataUtil.getViewIndexIdDataType().toBytes( - index.getViewIndexId())), index.getName().getString()); + if (index.getIndexType() == IndexType.LOCAL) { + localIndex = index; + localIndexNames.put(new ImmutableBytesWritable(MetaDataUtil.getViewIndexIdDataType().toBytes( + index.getViewIndexId())), index.getName().getString()); + } } if (localIndex == null) { return Collections.emptySet();
