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


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

Review Comment:
   Can we also have a user config to override the behavior to rebuildIndex even 
when it qualifies for incremental index, may be for testing or handle any 
unknown index corruption scenarios.



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