hanahmily commented on code in PR #684:
URL: 
https://github.com/apache/skywalking-banyandb/pull/684#discussion_r2156321839


##########
banyand/property/shard.go:
##########
@@ -225,3 +228,33 @@ func (s *shard) search(ctx context.Context, indexQuery 
index.Query, limit int,
        }
        return data, nil
 }
+
+func (s *shard) prepareForMerge(src []*roaring.Bitmap, segments 
[]segment.Segment, _ uint64) (dest []*roaring.Bitmap, err error) {
+       if len(segments) == 0 || len(src) == 0 || len(segments) != len(src) {
+               return src, nil
+       }
+       for segID, seg := range segments {
+               var docID uint64
+               for ; docID < seg.Count(); docID++ {
+                       hasDeleted := false
+                       _ = seg.VisitStoredFields(docID, func(field string, 
value []byte) bool {
+                               if field == deleteField {
+                                       hasDeleted = convert.BytesToBool(value)
+                                       return false
+                               }
+                               return true
+                       })
+
+                       if !hasDeleted {

Review Comment:
   You should set a flag to control whether the data is removed after a fixed 
duration, with a default duration of 7 days.



-- 
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: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to