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


##########
banyand/property/db.go:
##########
@@ -219,6 +221,77 @@ func (db *database) collect() {
        }
 }
 
+func (db *database) repairFromApplyProperty(ctx context.Context, id uint64, 
property *propertyv1.InternalApplyProperty) error {
+       s, err := db.loadShard(ctx, common.ShardID(id))
+       if err != nil {
+               return errors.WithMessagef(err, "failed to load shard %d", id)
+       }
+       olderProperties, err := db.query(ctx, &propertyv1.QueryRequest{
+               Groups: []string{property.Property.Metadata.Group},
+               Name:   property.Property.Metadata.Name,
+               Ids:    []string{property.Property.Id},
+       })
+       if err != nil {
+               return fmt.Errorf("query older properties failed: %w", err)
+       }
+       docIDList := make([][]byte, 0, len(olderProperties))
+       for _, p := range olderProperties {
+               if p.deleteTime > 0 {
+                       // If the property is already deleted, ignore it.
+                       continue
+               }
+               docIDList = append(docIDList, p.id)

Review Comment:
   Absolutely. We accept concurrent operations.



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