Skip to content

Commit

Permalink
enhance: Remove the logic to set replica_number=1 by default
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
weiliu1031 committed Jul 2, 2024
1 parent e151f03 commit 4c6c92a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion client/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,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 {
Expand Down
5 changes: 1 addition & 4 deletions client/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -158,7 +156,6 @@ func (s *CollectionSuite) TestCreateCollection() {
})

s.Run("invalid_schemas", func() {

type testCase struct {
name string
schema *entity.Schema
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 4c6c92a

Please sign in to comment.