mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +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
@ -1370,6 +1370,7 @@ func (lct *loadCollectionTask) Execute(ctx context.Context) (err error) {
|
|||||||
ReplicaNumber: lct.ReplicaNumber,
|
ReplicaNumber: lct.ReplicaNumber,
|
||||||
FieldIndexID: fieldIndexIDs,
|
FieldIndexID: fieldIndexIDs,
|
||||||
Refresh: lct.Refresh,
|
Refresh: lct.Refresh,
|
||||||
|
ResourceGroups: lct.ResourceGroups,
|
||||||
}
|
}
|
||||||
log.Debug("send LoadCollectionRequest to query coordinator",
|
log.Debug("send LoadCollectionRequest to query coordinator",
|
||||||
zap.Any("schema", request.Schema))
|
zap.Any("schema", request.Schema))
|
||||||
@ -1597,6 +1598,7 @@ func (lpt *loadPartitionsTask) Execute(ctx context.Context) error {
|
|||||||
ReplicaNumber: lpt.ReplicaNumber,
|
ReplicaNumber: lpt.ReplicaNumber,
|
||||||
FieldIndexID: fieldIndexIDs,
|
FieldIndexID: fieldIndexIDs,
|
||||||
Refresh: lpt.Refresh,
|
Refresh: lpt.Refresh,
|
||||||
|
ResourceGroups: lpt.ResourceGroups,
|
||||||
}
|
}
|
||||||
lpt.result, err = lpt.queryCoord.LoadPartitions(ctx, request)
|
lpt.result, err = lpt.queryCoord.LoadPartitions(ctx, request)
|
||||||
return err
|
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) {
|
func (s *Server) LoadCollection(ctx context.Context, req *querypb.LoadCollectionRequest) (*commonpb.Status, error) {
|
||||||
log := log.Ctx(ctx).With(
|
log := log.Ctx(ctx).With(
|
||||||
zap.Int64("collectionID", req.GetCollectionID()),
|
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",
|
log.Info("load collection request received",
|
||||||
zap.Any("schema", req.Schema),
|
zap.Any("schema", req.Schema),
|
||||||
zap.Int32("replicaNumber", req.ReplicaNumber),
|
|
||||||
zap.Int64s("fieldIndexes", lo.Values(req.GetFieldIndexID())),
|
zap.Int64s("fieldIndexes", lo.Values(req.GetFieldIndexID())),
|
||||||
zap.Bool("refreshMode", req.GetRefresh()),
|
|
||||||
)
|
)
|
||||||
metrics.QueryCoordLoadCount.WithLabelValues(metrics.TotalLabel).Inc()
|
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",
|
log.Info("received load partitions request",
|
||||||
zap.Any("schema", req.Schema),
|
zap.Any("schema", req.Schema),
|
||||||
zap.Int32("replicaNumber", req.ReplicaNumber),
|
|
||||||
zap.Int64s("partitions", req.GetPartitionIDs()))
|
zap.Int64s("partitions", req.GetPartitionIDs()))
|
||||||
metrics.QueryCoordLoadCount.WithLabelValues(metrics.TotalLabel).Inc()
|
metrics.QueryCoordLoadCount.WithLabelValues(metrics.TotalLabel).Inc()
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ func (s *Server) checkResourceGroup(collectionID int64, resourceGroups []string)
|
|||||||
if len(resourceGroups) != 0 {
|
if len(resourceGroups) != 0 {
|
||||||
collectionUsedRG := s.meta.ReplicaManager.GetResourceGroupByCollection(collectionID)
|
collectionUsedRG := s.meta.ReplicaManager.GetResourceGroupByCollection(collectionID)
|
||||||
for _, rgName := range resourceGroups {
|
for _, rgName := range resourceGroups {
|
||||||
if !collectionUsedRG.Contain(rgName) {
|
if len(collectionUsedRG) > 0 && !collectionUsedRG.Contain(rgName) {
|
||||||
return ErrLoadUseWrongRG
|
return ErrLoadUseWrongRG
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1062,7 +1062,7 @@ func (p *queryCoordConfig) init(base *BaseTable) {
|
|||||||
p.CheckResourceGroupInterval = ParamItem{
|
p.CheckResourceGroupInterval = ParamItem{
|
||||||
Key: "queryCoord.checkResourceGroupInterval",
|
Key: "queryCoord.checkResourceGroupInterval",
|
||||||
Version: "2.2.3",
|
Version: "2.2.3",
|
||||||
DefaultValue: "30",
|
DefaultValue: "10",
|
||||||
PanicIfEmpty: true,
|
PanicIfEmpty: true,
|
||||||
}
|
}
|
||||||
p.CheckResourceGroupInterval.Init(base.mgr)
|
p.CheckResourceGroupInterval.Init(base.mgr)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user