mxm commented on code in PR #18717:
URL: https://github.com/apache/iceberg/pull/18717#discussion_r4481252667


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/EqualityConvertPlanner.java:
##########
@@ -350,14 +351,17 @@ private void ensureIndexCurrent(Snapshot mainSnapshot) {
       return;
     }
 
-    if (!indexReflects(mainSnapshot)) {
+    List<Snapshot> externalCommits = externalCommitsSinceIndex(mainSnapshot);
+    if (externalCommits == null || deltaReadsMoreThanRebuild(mainSnapshot, 
externalCommits)) {
       boolean bootstrap = indexSnapshotId == null;
       LOG.info(
           "{} worker index from main snapshot {} for field IDs {}.",
           bootstrap ? "Bootstrapping" : "Reindexing",
           mainSnapshot.snapshotId(),
           eqFieldIds);
       rebuildIndex(mainSnapshot, !bootstrap);
+    } else {
+      emitIncrementalReindex(mainSnapshot, externalCommits);

Review Comment:
   This is already the case. We clear `indexSnapshotId` in 
`emitIncrementalReindex` before we build the delta. So if something fails we 
will automatically fall back to a full reindex.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to