apurtell commented on code in PR #2658:
URL: https://github.com/apache/phoenix/pull/2658#discussion_r4507751638


##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexCDCConsumer.java:
##########
@@ -1263,24 +1308,44 @@ private void 
generateAndApplyIndexMutations(PhoenixConnection conn,
     refreshDataTableCache(conn);
     PTable dataTable = getDataTable(conn);
     byte[] encodedRegionNameBytes = 
env.getRegion().getRegionInfo().getEncodedNameAsBytes();
-    List<Pair<IndexMaintainer, HTableInterfaceReference>> indexTables = new 
ArrayList<>();
+    List<Pair<Pair<IndexMaintainer, HTableInterfaceReference>, Long>> targets 
= new ArrayList<>();
     for (PTable index : dataTable.getIndexes()) {
-      IndexConsistency consistency = index.getIndexConsistency();
-      if (consistency != null && consistency.isAsynchronous()) {
+      long cutoff = getApplyCutoff(dataTable, index);
+      if (cutoff != Long.MIN_VALUE) {
         IndexMaintainer maintainer = index.getIndexMaintainer(dataTable, conn);
         HTableInterfaceReference tableRef =
           new HTableInterfaceReference(new 
ImmutableBytesPtr(maintainer.getIndexTableName()));
-        indexTables.add(new Pair<>(maintainer, tableRef));
+        targets.add(new Pair<>(new Pair<>(maintainer, tableRef), cutoff));
       }
     }

Review Comment:
   I think this requires us to note when an index last transitioned E→S, so the 
replay window covers only converted indexes and not every change. This maybe 
will require a new SYSTEM.CATALOG column and therefore some upgrade code, so 
let's make this a follow up JIRA/PR. 



-- 
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