PHOENIX-3001 Dropping local index and recreation it with following split may cause RS failure
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/a96cc550 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/a96cc550 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/a96cc550 Branch: refs/heads/4.x-HBase-1.1 Commit: a96cc550cb2ae0a519d400109a28e1d2c6866c92 Parents: 909dee7 Author: Sergey Soldatov <s...@apache.org> Authored: Thu Jun 16 17:36:19 2016 -0700 Committer: Sergey Soldatov <s...@apache.org> Committed: Mon Jun 20 18:15:11 2016 -0700 ---------------------------------------------------------------------- .../LocalIndexStoreFileScanner.java | 28 +++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/a96cc550/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java b/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java index a6e5005..64ad868 100644 --- a/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java +++ b/phoenix-core/src/main/java/org/apache/hadoop/hbase/regionserver/LocalIndexStoreFileScanner.java @@ -141,13 +141,6 @@ public class LocalIndexStoreFileScanner extends StoreFileScanner{ } private boolean isSatisfiedMidKeyCondition(Cell kv) { - if (CellUtil.isDelete(kv) && kv.getValueLength() == 0) { - // In case of a Delete type KV, let it be going to both the daughter regions. - // No problems in doing so. In the correct daughter region where it belongs to, this delete - // tomb will really delete a KV. In the other it will just hang around there with no actual - // kv coming for which this is a delete tomb. :) - return true; - } ImmutableBytesWritable rowKey = new ImmutableBytesWritable(kv.getRowArray(), kv.getRowOffset() + reader.getOffset(), kv.getRowLength() - reader.getOffset()); @@ -155,15 +148,18 @@ public class LocalIndexStoreFileScanner extends StoreFileScanner{ IndexMaintainer indexMaintainer = entry.getValue(); byte[] viewIndexId = indexMaintainer.getViewIndexIdFromIndexRowKey(rowKey); IndexMaintainer actualIndexMaintainer = reader.getIndexMaintainers().get(new ImmutableBytesWritable(viewIndexId)); - byte[] dataRowKey = actualIndexMaintainer.buildDataRowKey(rowKey, reader.getViewConstants()); - int compareResult = Bytes.compareTo(dataRowKey, reader.getSplitRow()); - if (reader.isTop()) { - if (compareResult >= 0) { - return true; - } - } else { - if (compareResult < 0) { - return true; + if(actualIndexMaintainer != null) { + byte[] dataRowKey = actualIndexMaintainer.buildDataRowKey(rowKey, reader.getViewConstants()); + + int compareResult = Bytes.compareTo(dataRowKey, reader.getSplitRow()); + if (reader.isTop()) { + if (compareResult >= 0) { + return true; + } + } else { + if (compareResult < 0) { + return true; + } } } return false;