ahmedabu98 commented on code in PR #39600:
URL: https://github.com/apache/beam/pull/39600#discussion_r3723666149


##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/cdc/WatchForSnapshotsSdf.java:
##########
@@ -231,35 +236,45 @@ public ProcessContinuation process(
       if (!tracker.tryClaim(snap.getSequenceNumber())) {
         return ProcessContinuation.stop();
       }
-      Instant ts = Instant.ofEpochMilli(snap.getTimestampMillis());
+      Instant commitTs = Instant.ofEpochMilli(snap.getTimestampMillis());
+      Instant ts = commitTs;
+      if (ts.isBefore(watermark.currentWatermark())) {
+        // The watermark already moved past this snapshot's commit time (e.g. 
the idle bump ran
+        // ahead of a slow discovery). Use the current watermark so the 
snapshot is not dropped
+        ts = watermark.currentWatermark();

Review Comment:
   I don't think so, IIUC the watermark only advances when the bundle commits, 
along with the emmitted elements. and those same in-flight elements hold back 
the watermark until they arrive downstream, so a downstream window can't fire 
until they all arrive



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