This is an automated email from the ASF dual-hosted git repository.

kadir pushed a commit to branch 4.x
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x by this push:
     new 432474e  PHOENIX-6058 When maxLookback is not enabled, IndexTool 
should not do deep verification (#901)
432474e is described below

commit 432474ecd039ce16c2e859f18dd2ba22c149f766
Author: kadirozde <[email protected]>
AuthorDate: Wed Dec 9 13:19:15 2020 -0800

    PHOENIX-6058 When maxLookback is not enabled, IndexTool should not do deep 
verification (#901)
---
 .../src/it/java/org/apache/phoenix/end2end/IndexExtendedIT.java     | 2 ++
 .../org/apache/phoenix/end2end/IndexVerificationOldDesignIT.java    | 2 ++
 .../org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java    | 6 +++++-
 3 files changed, 9 insertions(+), 1 deletion(-)

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 10095f6..254dc39 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.Map;
 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 class IndexExtendedIT extends BaseTest {
     public static synchronized void doSetup() throws Exception {
         Map<String, String> 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<String, String> 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 a045161..d823920 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 class IndexVerificationOldDesignIT extends  
BaseUniqueNamesOwnClusterIT {
         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<String, String> 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 5005339..9b18a2f 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
@@ -306,7 +306,11 @@ public abstract class GlobalIndexRegionScanner extends 
BaseRegionScanner {
     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);
     }

Reply via email to