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


##########
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:
   Thanks for investigating! For now I opted to rebuild fully when there are 
errors during building the delta, to make sure we can always make progress, 
even if it comes at the risk of rebuilding when we don't have to: 
f122cd1df6b1fc66c713c656d5343622e8dac7d4



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