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


##########
banyand/liaison/grpc/property.go:
##########
@@ -405,11 +411,73 @@ func (ps *propertyServer) Query(ctx context.Context, req 
*propertyv1.QueryReques
        return &propertyv1.QueryResponse{Properties: properties, Trace: trace}, 
nil
 }
 
+func (ps *propertyServer) repairPropertyIfNeed(ctx context.Context, entity 
string, p *propertyWithCount, groups map[string]*commonv1.Group) error {
+       // make sure have the enough replicas
+       group := groups[p.Metadata.Group]
+       if group == nil {
+               return errors.Errorf("group %s not found", p.Metadata.Group)
+       }
+       copies, ok := ps.groupRepo.copies(p.Metadata.GetGroup())
+       if !ok {
+               return errors.New("failed to get group copies")
+       }
+       if copies == uint32(len(p.existNodes)) {
+               return nil
+       }
+       id, err := partition.ShardID(convert.StringToBytes(entity), 
group.ResourceOpts.ShardNum)
+       if err != nil {
+               return err
+       }
+       // building the repair data
+       repairReq := &propertyv1.InternalRepairRequest{ShardId: uint64(id)}

Review Comment:
   Yes, that's true. If the latest version property is already in all nodes, 
the repair request will not be constructed. 
   I have already checked in there: 
https://github.com/apache/skywalking-banyandb/pull/686/files#diff-ec9aafdd27b3b36de2fae1ed134371dd730232bbd344d77197eebd1b0927221eR424



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