JeonDaehong commented on code in PR #3697:
URL: https://github.com/apache/iceberg-rust/pull/3697#discussion_r4578861815


##########
crates/iceberg/src/arrow/delete_filter.rs:
##########
@@ -339,20 +339,14 @@ impl DeleteFilter {
         *entry.lock().unwrap() |= delete_vector;
     }
 
+    /// Stores the equality delete predicate that `eq_del` delivers, and wakes 
the tasks

Review Comment:
   Since this no longer writes the `Loading` state itself, it now relies on 
`try_start_eq_del_load` having stored `notify` for this path. A caller that 
skips that step would leave no entry, and 
`get_equality_delete_predicate_for_delete_file_path` returns `None` for a 
missing entry, so the delete would be silently skipped rather than hang. Maybe 
say this in the doc comment, or add a `debug_assert!` that the entry is 
`Loading(notify)`?



##########
crates/iceberg/src/arrow/delete_filter.rs:
##########
@@ -492,6 +486,29 @@ pub(crate) mod tests {
         ));
     }
 
+    // A task that finds the load started before the loader calls 
`insert_equality_delete`
+    // must be woken when the predicate arrives.
+    #[tokio::test]
+    async fn test_eq_del_waiter_registered_before_insert_is_woken() {
+        let filter = DeleteFilter::new(Runtime::current());
+        let path = "s3://bucket/eq-delete.parquet";
+        let notify = filter.try_start_eq_del_load(path).unwrap();
+
+        let mut waiter = 
Box::pin(filter.get_equality_delete_predicate_for_delete_file_path(path));
+        // Registers the waiter on the notifier that `try_start_eq_del_load` 
stored.
+        assert!(futures::poll!(&mut waiter).is_pending());

Review Comment:
   Polling once here makes the window deterministic without a multi-thread 
runtime or a sleep. My repro on #3275 needed both, so this is a much better 
test.



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