swaroopak commented on a change in pull request #751: PHOENIX-5735 Add the 
maxLookBack logic in the inline validation.
URL: https://github.com/apache/phoenix/pull/751#discussion_r403406843
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
 ##########
 @@ -859,39 +899,54 @@ public boolean verifySingleIndexRow(Result indexRow, 
IndexToolVerificationResult
                         (actual instanceof Delete && isDeleteFamily(actual))) {
                     expectedIndex++;
                     actualIndex++;
-                    matchingCount++;
                     continue;
                 }
             }
-            if (matchingCount > 0) {
-                break;
+            break;
+        }
+
+        if (expectedIndex == expectedSize ){
+            // every expected mutation has its matching one in the actual list.
+            verificationPhaseResult.validIndexRowCount++;
+            return true;
+        }
+
+        if (isTimestampBeyondMaxLookBack(currentTime, 
getTimestamp(expectedMutationList.get(expectedIndex)))){
+            if (expectedIndex > 0) {
+                // if current expected index mutation is beyond max look back 
window, we only need to make sure its latest
+                // mutation is a matching one, as an SCN query is required.
+                verificationPhaseResult.validIndexRowCount++;
+                return true;
             }
-            verificationPhaseResult.invalidIndexRowCount++;
+
+            // All expected mutations are beyond the maxLookBack window, none 
of them can find its matching one in actual list
+            // It may be caused by real bug or compaction on the data table.
+            // We report it as a failure, so "before" option can trigger the 
index rebuild for this row.
+            // This repair is required, when there is only on index row for a 
given data table row and the timestamp of that row
 
 Review comment:
   "there is only one index row"

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to