From 88f3ff0cc6d4d773304ef2b429eb2329b3352509 Mon Sep 17 00:00:00 2001 From: alingse Date: Sun, 26 May 2024 18:38:17 +0800 Subject: [PATCH] fix: fix miss makezero bug Signed-off-by: alingse --- cmd/tools/migration/meta/210_to_220.go | 2 +- internal/rootcoord/broker.go | 2 +- tests/integration/minicluster_v2.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/tools/migration/meta/210_to_220.go b/cmd/tools/migration/meta/210_to_220.go index 1fceb29d0e083..9b76324dd8ebf 100644 --- a/cmd/tools/migration/meta/210_to_220.go +++ b/cmd/tools/migration/meta/210_to_220.go @@ -59,7 +59,7 @@ func getLatestFieldIndexes(colls map[Timestamp]*pb.CollectionInfo) *FieldIndexes coll *pb.CollectionInfo } l := len(colls) - pairs := make([]pair, l) + pairs := make([]pair, 0, l) for ts, coll := range colls { pairs = append(pairs, pair{ts: ts, coll: coll}) } diff --git a/internal/rootcoord/broker.go b/internal/rootcoord/broker.go index 8701a5c6f2068..612eb58940491 100644 --- a/internal/rootcoord/broker.go +++ b/internal/rootcoord/broker.go @@ -237,7 +237,7 @@ func (b *ServerBroker) BroadcastAlteredCollection(ctx context.Context, req *milv return err } - partitionIDs := make([]int64, len(colMeta.Partitions)) + partitionIDs := make([]int64, 0, len(colMeta.Partitions)) for _, p := range colMeta.Partitions { partitionIDs = append(partitionIDs, p.PartitionID) } diff --git a/tests/integration/minicluster_v2.go b/tests/integration/minicluster_v2.go index 626cbbdafa81b..cf298582324d4 100644 --- a/tests/integration/minicluster_v2.go +++ b/tests/integration/minicluster_v2.go @@ -252,7 +252,7 @@ func StartMiniClusterV2(ctx context.Context, opts ...OptionV2) (*MiniClusterV2, } func (cluster *MiniClusterV2) AddQueryNodes(k int) []*grpcquerynode.Server { - servers := make([]*grpcquerynode.Server, k) + servers := make([]*grpcquerynode.Server, 0, k) for i := 0; i < k; i++ { servers = append(servers, cluster.AddQueryNode()) }