jiacai2050 commented on code in PR #1566:
URL: https://github.com/apache/horaedb/pull/1566#discussion_r1749683028


##########
src/wal/src/local_storage_impl/segment.rs:
##########
@@ -454,6 +515,76 @@ impl SegmentManager {
         }
         Ok(())
     }
+
+    pub fn mark_delete_entries_up_to(
+        &self,
+        location: WalLocation,
+        sequence_num: SequenceNumber,
+    ) -> Result<()> {
+        let current_segment_id = 
self.current_segment.lock().unwrap().lock().unwrap().id;
+        let mut segments_to_remove: Vec<u64> = Vec::new();
+        let mut all_segments = self.all_segments.lock().unwrap();
+
+        for (_, segment) in all_segments.iter() {
+            let mut segment = segment.lock().unwrap();
+
+            segment.mark_deleted(location.table_id, sequence_num);

Review Comment:
   Since the seq in once segment is increasing among all tables, so we can just 
compare the `sequence_num` with its min/max segment of one segment?



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