From 48707f3aac9d6263ea7482a44b29ddda7c43c1fe Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Mon, 12 Feb 2024 08:30:55 +0800 Subject: [PATCH] fix: should return collectionName in response of ListAliases (#30533) issue : https://github.com/milvus-io/milvus/issues/30369 pr: https://github.com/milvus-io/milvus/pull/30532 Signed-off-by: zhenshan.cao --- internal/proxy/task_alias.go | 10 ++++++++++ internal/querycoordv2/services.go | 2 +- internal/rootcoord/root_coord.go | 7 ++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/internal/proxy/task_alias.go b/internal/proxy/task_alias.go index 6fd1bfa4e5..863f91e4d2 100644 --- a/internal/proxy/task_alias.go +++ b/internal/proxy/task_alias.go @@ -311,6 +311,10 @@ func (a *DescribeAliasTask) OnEnqueue() error { func (a *DescribeAliasTask) PreExecute(ctx context.Context) error { a.Base.MsgType = commonpb.MsgType_DescribeAlias 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 } @@ -374,6 +378,12 @@ func (a *ListAliasesTask) OnEnqueue() error { func (a *ListAliasesTask) PreExecute(ctx context.Context) error { a.Base.MsgType = commonpb.MsgType_ListAliases a.Base.SourceID = a.nodeID + + if len(a.GetCollectionName()) > 0 { + if err := validateCollectionName(a.GetCollectionName()); err != nil { + return err + } + } return nil } diff --git a/internal/querycoordv2/services.go b/internal/querycoordv2/services.go index e87c2e83fe..326f4db106 100644 --- a/internal/querycoordv2/services.go +++ b/internal/querycoordv2/services.go @@ -379,7 +379,7 @@ func (s *Server) ReleasePartitions(ctx context.Context, req *querypb.ReleasePart } 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)) metrics.QueryCoordReleaseCount.WithLabelValues(metrics.FailLabel).Inc() return merr.Status(err), nil diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index b0c0c58b5e..045164e941 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -1916,9 +1916,10 @@ func (c *Core) ListAliases(ctx context.Context, in *milvuspb.ListAliasesRequest) log.Info("done to list aliases") return &milvuspb.ListAliasesResponse{ - Status: merr.Status(nil), - DbName: in.GetDbName(), - Aliases: aliases, + Status: merr.Status(nil), + DbName: in.GetDbName(), + CollectionName: in.GetCollectionName(), + Aliases: aliases, }, nil }