Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.2 c4fdb1a4d -> fdfdb41dd
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/fdfdb41d Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/fdfdb41d Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/fdfdb41d Branch: refs/heads/4.x-HBase-1.2 Commit: fdfdb41dd6742f9b11f3915d911c79c74183bace Parents: c4fdb1a Author: James Taylor <[email protected]> Authored: Fri Sep 22 23:14:24 2017 -0700 Committer: James Taylor <[email protected]> Committed: Fri Sep 22 23:23:11 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/fdfdb41d/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();
