hanahmily commented on code in PR #686: URL: https://github.com/apache/skywalking-banyandb/pull/686#discussion_r2165312145
########## 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: If all nodes are the same, no repair is required. The repairReq should not be constructed. -- 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