From 6067806e69e463bc058865e856d355526cfc97f5 Mon Sep 17 00:00:00 2001 From: wei liu Date: Thu, 4 Jul 2024 14:14:01 +0800 Subject: [PATCH] enhance: Remove the logic to set replica_number=1 by default (#780) issue: milvus-io/milvus#34355 Signed-off-by: Wei Liu --- client/collection.go | 1 - client/collection_test.go | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/client/collection.go b/client/collection.go index bf5fdec7..cbf6b58f 100644 --- a/client/collection.go +++ b/client/collection.go @@ -431,7 +431,6 @@ func (c *GrpcClient) LoadCollection(ctx context.Context, collName string, async req := &milvuspb.LoadCollectionRequest{ CollectionName: collName, - ReplicaNumber: 1, // default replica number } for _, opt := range opts { diff --git a/client/collection_test.go b/client/collection_test.go index 6fb3dd1e..d0021e9b 100644 --- a/client/collection_test.go +++ b/client/collection_test.go @@ -50,7 +50,6 @@ func (s *CollectionSuite) TestListCollections() { tc.names = append(tc.names, fmt.Sprintf("coll_%d", base)) inMem := rand.Intn(100) if inMem%2 == 0 { - tc.inMem = append(tc.inMem, 100) } else { tc.inMem = append(tc.inMem, 0) @@ -148,7 +147,6 @@ func (s *CollectionSuite) TestCreateCollection() { } s.Equal(shardsNum, req.GetShardsNum()) s.Equal(commonpb.ConsistencyLevel_Eventually, req.GetConsistencyLevel()) - }). Return(&commonpb.Status{ErrorCode: commonpb.ErrorCode_Success}, nil) s.mock.EXPECT().HasCollection(mock.Anything, &milvuspb.HasCollectionRequest{CollectionName: testCollectionName}).Return(&milvuspb.BoolResponse{Status: &commonpb.Status{}, Value: false}, nil) @@ -158,7 +156,6 @@ func (s *CollectionSuite) TestCreateCollection() { }) s.Run("invalid_schemas", func() { - type testCase struct { name string schema *entity.Schema @@ -533,7 +530,7 @@ func (s *CollectionSuite) TestLoadCollection() { Return(&milvuspb.BoolResponse{Status: &commonpb.Status{}, Value: true}, nil) s.mock.EXPECT().LoadCollection(mock.Anything, mock.Anything).Run(func(_ context.Context, req *milvuspb.LoadCollectionRequest) { - s.Equal(testDefaultReplicaNumber, req.GetReplicaNumber()) + s.Equal(int32(0), req.GetReplicaNumber()) s.Equal(testCollectionName, req.GetCollectionName()) }).Return(&commonpb.Status{ErrorCode: commonpb.ErrorCode_Success}, nil)