kadirozde commented on code in PR #1964:
URL: https://github.com/apache/phoenix/pull/1964#discussion_r1771795786


##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/GlobalIndexRegionScanner.java:
##########
@@ -273,11 +278,31 @@ public GlobalIndexRegionScanner(final RegionScanner 
innerScanner,
             verificationResultRepository =
                     new 
IndexVerificationResultRepository(indexMaintainer.getIndexTableName(), 
hTableFactory);
             nextStartKey = null;
-            minTimestamp = scan.getTimeRange().getMin();
         }
+        computeMinTimestamp(config);
     }
 
-
+    /**
+     * For CDC indexes we do not need to consider rows outside max lookback 
window or before
+     * the index create time. minTimestamp needs to be computed and used for 
CDC indexes always
+     * even when it is not set on the scan
+     */
+    private void computeMinTimestamp(Configuration config) throws IOException {
+        minTimestamp = scan.getTimeRange().getMin();
+        if (indexMaintainer.isCDCIndex()) {
+            minTimestamp = EnvironmentEdgeManager.currentTimeMillis() - 
maxLookBackInMills;

Review Comment:
   The old index design on an index write failure, transitions indexes to the 
PENDING_DISABLE state on the server side and after the client retries, and 
after retries are exhausted, disables indexes. MetadataRegionObserver rebuilds 
these indexes incrementally. The new design does not change the state of 
indexes on index write failure as these failures are handled by read repair. 
After upgrading to new indexes, phoenix.index.failure.handling.rebuild can be 
set to false to skip running BuildIndexScheduleTask. This is what we do in 
production.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to