shunping commented on code in PR #40659:
URL: https://github.com/apache/beam/pull/40659#discussion_r4318054349


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/state/WindmillOrderedList.java:
##########
@@ -233,6 +233,20 @@ public Windmill.WorkItemCommitRequest 
persistDirectly(WindmillStateCache.ForKeyA
         cleared = false;
       }
 
+      if (!pendingDeletes.isEmpty()) {

Review Comment:
   I agree that we need to apply `pendingDeletes` before `pendingAdds`. When 
`clearRange()` is called, it already clears any existing pendingAdds that fall 
within the deleted range (see the logic in `clearRange()`). 
   
   Therefore, if there is a remaining `pendingAdd` that overlaps with a 
`pendingDelete` range, it means the add operation occurred after the clear 
operation. Applying the deletes first ensures that these subsequent additions 
are correctly preserved.



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