diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java index 10095f69935..254dc391461 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java @@ -35,6 +35,7 @@ import java.util.Properties; import org.apache.hadoop.hbase.client.Table; +import org.apache.hadoop.hbase.regionserver.ScanInfoUtil; import org.apache.hadoop.hbase.util.Bytes; import org.apache.phoenix.coprocessor.IndexRebuildRegionScanner; import org.apache.phoenix.hbase.index.IndexRegionObserver; @@ -87,6 +88,7 @@ public IndexExtendedIT( boolean mutable, boolean localIndex, boolean useViewInde public static synchronized void doSetup() throws Exception { Map serverProps = Maps.newHashMapWithExpectedSize(2); serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); + serverProps.put(ScanInfoUtil.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY, Integer.toString(60*60)); // An hour Map clientProps = Maps.newHashMapWithExpectedSize(2); clientProps.put(QueryServices.TRANSACTIONS_ENABLED, Boolean.TRUE.toString()); clientProps.put(QueryServices.FORCE_ROW_KEY_ORDER_ATTRIB, Boolean.TRUE.toString()); diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexVerificationOldDesignIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexVerificationOldDesignIT.java index a045161aca5..d823920992c 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexVerificationOldDesignIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexVerificationOldDesignIT.java @@ -18,6 +18,7 @@ package org.apache.phoenix.end2end; import com.google.common.collect.Maps; +import org.apache.hadoop.hbase.regionserver.ScanInfoUtil; import org.apache.phoenix.mapreduce.index.IndexTool; import org.apache.phoenix.query.QueryServices; import org.apache.phoenix.query.QueryServicesOptions; @@ -55,6 +56,7 @@ public static synchronized void setup() throws Exception { serverProps.put(QueryServices.EXTRA_JDBC_ARGUMENTS_ATTRIB, QueryServicesOptions.DEFAULT_EXTRA_JDBC_ARGUMENTS); serverProps.put(QueryServices.INDEX_REBUILD_PAGE_SIZE_IN_ROWS, Long.toString(8)); + serverProps.put(ScanInfoUtil.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY, Integer.toString(60*60)); // An hour Map clientProps = Maps.newHashMapWithExpectedSize(2); clientProps.put(QueryServices.USE_STATS_FOR_PARALLELIZATION, Boolean.toString(true)); clientProps.put(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, Long.toString(5)); diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java index 8e1cad6ea5b..2d74349dcae 100644 --- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java +++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java @@ -209,7 +209,11 @@ protected static boolean isTimestampBeforeTTL(long tableTTL, long currentTime, l protected static boolean isTimestampBeyondMaxLookBack(long maxLookBackInMills, long currentTime, long tsToCheck) { if (!ScanInfoUtil.isMaxLookbackTimeEnabled(maxLookBackInMills)) { - return false; + // By definition, if the max lookback feature is not enabled, then delete markers and rows + // version can be removed by compaction any time, and thus there is no window in which these mutations are + // preserved, i.e., the max lookback window size is zero. This means all the mutations are effectively + // beyond the zero size max lookback window. + return true; } return tsToCheck < (currentTime - maxLookBackInMills); }