mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
fix: should return collectionName in response of ListAliases (#30532)
issue : https://github.com/milvus-io/milvus/issues/30369 Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
parent
1b87bcd60e
commit
bb93b22c84
@ -311,6 +311,10 @@ func (a *DescribeAliasTask) OnEnqueue() error {
|
|||||||
func (a *DescribeAliasTask) PreExecute(ctx context.Context) error {
|
func (a *DescribeAliasTask) PreExecute(ctx context.Context) error {
|
||||||
a.Base.MsgType = commonpb.MsgType_DescribeAlias
|
a.Base.MsgType = commonpb.MsgType_DescribeAlias
|
||||||
a.Base.SourceID = a.nodeID
|
a.Base.SourceID = a.nodeID
|
||||||
|
// collection alias uses the same format as collection name
|
||||||
|
if err := ValidateCollectionAlias(a.GetAlias()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,6 +378,12 @@ func (a *ListAliasesTask) OnEnqueue() error {
|
|||||||
func (a *ListAliasesTask) PreExecute(ctx context.Context) error {
|
func (a *ListAliasesTask) PreExecute(ctx context.Context) error {
|
||||||
a.Base.MsgType = commonpb.MsgType_ListAliases
|
a.Base.MsgType = commonpb.MsgType_ListAliases
|
||||||
a.Base.SourceID = a.nodeID
|
a.Base.SourceID = a.nodeID
|
||||||
|
|
||||||
|
if len(a.GetCollectionName()) > 0 {
|
||||||
|
if err := validateCollectionName(a.GetCollectionName()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -380,7 +380,7 @@ func (s *Server) ReleasePartitions(ctx context.Context, req *querypb.ReleasePart
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(req.GetPartitionIDs()) == 0 {
|
if len(req.GetPartitionIDs()) == 0 {
|
||||||
err := merr.WrapErrParameterInvalid("any parttiion", "empty partition list")
|
err := merr.WrapErrParameterInvalid("any partition", "empty partition list")
|
||||||
log.Warn("no partition to release", zap.Error(err))
|
log.Warn("no partition to release", zap.Error(err))
|
||||||
metrics.QueryCoordReleaseCount.WithLabelValues(metrics.FailLabel).Inc()
|
metrics.QueryCoordReleaseCount.WithLabelValues(metrics.FailLabel).Inc()
|
||||||
return merr.Status(err), nil
|
return merr.Status(err), nil
|
||||||
|
|||||||
@ -1927,9 +1927,10 @@ func (c *Core) ListAliases(ctx context.Context, in *milvuspb.ListAliasesRequest)
|
|||||||
|
|
||||||
log.Info("done to list aliases")
|
log.Info("done to list aliases")
|
||||||
return &milvuspb.ListAliasesResponse{
|
return &milvuspb.ListAliasesResponse{
|
||||||
Status: merr.Status(nil),
|
Status: merr.Status(nil),
|
||||||
DbName: in.GetDbName(),
|
DbName: in.GetDbName(),
|
||||||
Aliases: aliases,
|
CollectionName: in.GetCollectionName(),
|
||||||
|
Aliases: aliases,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -533,7 +533,7 @@ class TestMilvusClientReleasePartitionInvalid(TestcaseBase):
|
|||||||
partition_names = []
|
partition_names = []
|
||||||
# 2. create partition
|
# 2. create partition
|
||||||
client_w.create_collection(client, collection_name, default_dim)
|
client_w.create_collection(client, collection_name, default_dim)
|
||||||
error = {ct.err_code: 1100, ct.err_msg: f"invalid parameter[expected=any parttiion][actual=empty partition list"}
|
error = {ct.err_code: 1100, ct.err_msg: f"invalid parameter[expected=any partition][actual=empty partition list"}
|
||||||
client_w.release_partitions(client, collection_name, partition_names,
|
client_w.release_partitions(client, collection_name, partition_names,
|
||||||
check_task=CheckTasks.err_res, check_items=error)
|
check_task=CheckTasks.err_res, check_items=error)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user