mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
fix load collection with rg (#22083)
Signed-off-by: Wei Liu <wei.liu@zilliz.com>
This commit is contained in:
parent
b1f31da77a
commit
d085abbd56
@ -1364,12 +1364,13 @@ func (lct *loadCollectionTask) Execute(ctx context.Context) (err error) {
|
||||
lct.Base,
|
||||
commonpbutil.WithMsgType(commonpb.MsgType_LoadCollection),
|
||||
),
|
||||
DbID: 0,
|
||||
CollectionID: collID,
|
||||
Schema: collSchema,
|
||||
ReplicaNumber: lct.ReplicaNumber,
|
||||
FieldIndexID: fieldIndexIDs,
|
||||
Refresh: lct.Refresh,
|
||||
DbID: 0,
|
||||
CollectionID: collID,
|
||||
Schema: collSchema,
|
||||
ReplicaNumber: lct.ReplicaNumber,
|
||||
FieldIndexID: fieldIndexIDs,
|
||||
Refresh: lct.Refresh,
|
||||
ResourceGroups: lct.ResourceGroups,
|
||||
}
|
||||
log.Debug("send LoadCollectionRequest to query coordinator",
|
||||
zap.Any("schema", request.Schema))
|
||||
@ -1590,13 +1591,14 @@ func (lpt *loadPartitionsTask) Execute(ctx context.Context) error {
|
||||
lpt.Base,
|
||||
commonpbutil.WithMsgType(commonpb.MsgType_LoadPartitions),
|
||||
),
|
||||
DbID: 0,
|
||||
CollectionID: collID,
|
||||
PartitionIDs: partitionIDs,
|
||||
Schema: collSchema,
|
||||
ReplicaNumber: lpt.ReplicaNumber,
|
||||
FieldIndexID: fieldIndexIDs,
|
||||
Refresh: lpt.Refresh,
|
||||
DbID: 0,
|
||||
CollectionID: collID,
|
||||
PartitionIDs: partitionIDs,
|
||||
Schema: collSchema,
|
||||
ReplicaNumber: lpt.ReplicaNumber,
|
||||
FieldIndexID: fieldIndexIDs,
|
||||
Refresh: lpt.Refresh,
|
||||
ResourceGroups: lpt.ResourceGroups,
|
||||
}
|
||||
lpt.result, err = lpt.queryCoord.LoadPartitions(ctx, request)
|
||||
return err
|
||||
|
||||
@ -207,13 +207,14 @@ func (s *Server) ShowPartitions(ctx context.Context, req *querypb.ShowPartitions
|
||||
func (s *Server) LoadCollection(ctx context.Context, req *querypb.LoadCollectionRequest) (*commonpb.Status, error) {
|
||||
log := log.Ctx(ctx).With(
|
||||
zap.Int64("collectionID", req.GetCollectionID()),
|
||||
zap.Int32("replicaNumber", req.GetReplicaNumber()),
|
||||
zap.Strings("resourceGroups", req.GetResourceGroups()),
|
||||
zap.Bool("refreshMode", req.GetRefresh()),
|
||||
)
|
||||
|
||||
log.Info("load collection request received",
|
||||
zap.Any("schema", req.Schema),
|
||||
zap.Int32("replicaNumber", req.ReplicaNumber),
|
||||
zap.Int64s("fieldIndexes", lo.Values(req.GetFieldIndexID())),
|
||||
zap.Bool("refreshMode", req.GetRefresh()),
|
||||
)
|
||||
metrics.QueryCoordLoadCount.WithLabelValues(metrics.TotalLabel).Inc()
|
||||
|
||||
@ -307,7 +308,6 @@ func (s *Server) LoadPartitions(ctx context.Context, req *querypb.LoadPartitions
|
||||
|
||||
log.Info("received load partitions request",
|
||||
zap.Any("schema", req.Schema),
|
||||
zap.Int32("replicaNumber", req.ReplicaNumber),
|
||||
zap.Int64s("partitions", req.GetPartitionIDs()))
|
||||
metrics.QueryCoordLoadCount.WithLabelValues(metrics.TotalLabel).Inc()
|
||||
|
||||
@ -356,7 +356,7 @@ func (s *Server) checkResourceGroup(collectionID int64, resourceGroups []string)
|
||||
if len(resourceGroups) != 0 {
|
||||
collectionUsedRG := s.meta.ReplicaManager.GetResourceGroupByCollection(collectionID)
|
||||
for _, rgName := range resourceGroups {
|
||||
if !collectionUsedRG.Contain(rgName) {
|
||||
if len(collectionUsedRG) > 0 && !collectionUsedRG.Contain(rgName) {
|
||||
return ErrLoadUseWrongRG
|
||||
}
|
||||
}
|
||||
|
||||
@ -1062,7 +1062,7 @@ func (p *queryCoordConfig) init(base *BaseTable) {
|
||||
p.CheckResourceGroupInterval = ParamItem{
|
||||
Key: "queryCoord.checkResourceGroupInterval",
|
||||
Version: "2.2.3",
|
||||
DefaultValue: "30",
|
||||
DefaultValue: "10",
|
||||
PanicIfEmpty: true,
|
||||
}
|
||||
p.CheckResourceGroupInterval.Init(base.mgr)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user