mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 18:18:30 +08:00
Change default shard number to 1 (#23586)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
parent
66cd15f72b
commit
03ec804e68
@ -1050,7 +1050,7 @@ func (m *RootCoordFactory) DescribeCollectionInternal(ctx context.Context, in *m
|
|||||||
|
|
||||||
resp.CollectionID = m.collectionID
|
resp.CollectionID = m.collectionID
|
||||||
resp.Schema = meta.Schema
|
resp.Schema = meta.Schema
|
||||||
resp.ShardsNum = 2
|
resp.ShardsNum = common.DefaultShardsNum
|
||||||
resp.Status.ErrorCode = commonpb.ErrorCode_Success
|
resp.Status.ErrorCode = commonpb.ErrorCode_Success
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -240,7 +240,7 @@ func TestCollection_Get(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Ts: ts,
|
Ts: ts,
|
||||||
@ -266,7 +266,7 @@ func TestCollection_Get_Error(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Ts: ts,
|
Ts: ts,
|
||||||
@ -290,7 +290,7 @@ func TestCollection_Get_ErrRecordNotFound(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Ts: ts,
|
Ts: ts,
|
||||||
@ -358,7 +358,7 @@ func TestCollection_Insert(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Properties: propertiesStr,
|
Properties: propertiesStr,
|
||||||
@ -387,7 +387,7 @@ func TestCollection_Insert_Error(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Ts: ts,
|
Ts: ts,
|
||||||
@ -444,7 +444,7 @@ func Test_collectionDb_Update(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Ts: ts,
|
Ts: ts,
|
||||||
@ -472,7 +472,7 @@ func Test_collectionDb_Update(t *testing.T) {
|
|||||||
CollectionName: "test_collection_name_1",
|
CollectionName: "test_collection_name_1",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(2),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Ts: ts,
|
Ts: ts,
|
||||||
|
|||||||
@ -42,7 +42,7 @@ func TestUnmarshalCollectionModel(t *testing.T) {
|
|||||||
CollectionName: "cn",
|
CollectionName: "cn",
|
||||||
Description: "",
|
Description: "",
|
||||||
AutoID: false,
|
AutoID: false,
|
||||||
ShardsNum: int32(1),
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPosition: "",
|
StartPosition: "",
|
||||||
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
ConsistencyLevel: int32(commonpb.ConsistencyLevel_Eventually),
|
||||||
Properties: "",
|
Properties: "",
|
||||||
@ -61,7 +61,7 @@ func TestUnmarshalCollectionModel(t *testing.T) {
|
|||||||
assert.Equal(t, "cn", ret.Name)
|
assert.Equal(t, "cn", ret.Name)
|
||||||
assert.Equal(t, "", ret.Description)
|
assert.Equal(t, "", ret.Description)
|
||||||
assert.Equal(t, false, ret.AutoID)
|
assert.Equal(t, false, ret.AutoID)
|
||||||
assert.Equal(t, int32(1), ret.ShardsNum)
|
assert.Equal(t, common.DefaultShardsNum, ret.ShardsNum)
|
||||||
assert.Equal(t, 0, len(ret.StartPositions))
|
assert.Equal(t, 0, len(ret.StartPositions))
|
||||||
assert.Equal(t, commonpb.ConsistencyLevel(3), ret.ConsistencyLevel)
|
assert.Equal(t, commonpb.ConsistencyLevel(3), ret.ConsistencyLevel)
|
||||||
assert.Nil(t, ret.Properties)
|
assert.Nil(t, ret.Properties)
|
||||||
|
|||||||
@ -3,11 +3,11 @@ package model
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
|
|
||||||
"github.com/milvus-io/milvus-proto/go-api/commonpb"
|
"github.com/milvus-io/milvus-proto/go-api/commonpb"
|
||||||
"github.com/milvus-io/milvus-proto/go-api/schemapb"
|
"github.com/milvus-io/milvus-proto/go-api/schemapb"
|
||||||
pb "github.com/milvus-io/milvus/internal/proto/etcdpb"
|
pb "github.com/milvus-io/milvus/internal/proto/etcdpb"
|
||||||
|
"github.com/milvus-io/milvus/pkg/common"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -40,7 +40,7 @@ var (
|
|||||||
Fields: []*Field{fieldModel},
|
Fields: []*Field{fieldModel},
|
||||||
VirtualChannelNames: []string{"vch"},
|
VirtualChannelNames: []string{"vch"},
|
||||||
PhysicalChannelNames: []string{"pch"},
|
PhysicalChannelNames: []string{"pch"},
|
||||||
ShardsNum: 1,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
CreateTime: 1,
|
CreateTime: 1,
|
||||||
StartPositions: startPositions,
|
StartPositions: startPositions,
|
||||||
ConsistencyLevel: commonpb.ConsistencyLevel_Strong,
|
ConsistencyLevel: commonpb.ConsistencyLevel_Strong,
|
||||||
@ -79,7 +79,7 @@ var (
|
|||||||
},
|
},
|
||||||
VirtualChannelNames: []string{"vch"},
|
VirtualChannelNames: []string{"vch"},
|
||||||
PhysicalChannelNames: []string{"pch"},
|
PhysicalChannelNames: []string{"pch"},
|
||||||
ShardsNum: 1,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
StartPositions: startPositions,
|
StartPositions: startPositions,
|
||||||
ConsistencyLevel: commonpb.ConsistencyLevel_Strong,
|
ConsistencyLevel: commonpb.ConsistencyLevel_Strong,
|
||||||
Properties: []*commonpb.KeyValuePair{
|
Properties: []*commonpb.KeyValuePair{
|
||||||
|
|||||||
@ -517,7 +517,7 @@ func TestProxy(t *testing.T) {
|
|||||||
otherCollectionName := collectionName + "_other_" + funcutil.GenRandomStr()
|
otherCollectionName := collectionName + "_other_" + funcutil.GenRandomStr()
|
||||||
partitionName := partitionPrefix + funcutil.GenRandomStr()
|
partitionName := partitionPrefix + funcutil.GenRandomStr()
|
||||||
otherPartitionName := partitionPrefix + "_other_" + funcutil.GenRandomStr()
|
otherPartitionName := partitionPrefix + "_other_" + funcutil.GenRandomStr()
|
||||||
shardsNum := int32(2)
|
shardsNum := common.DefaultShardsNum
|
||||||
int64Field := "int64"
|
int64Field := "int64"
|
||||||
floatVecField := "fVec"
|
floatVecField := "fVec"
|
||||||
dim := 128
|
dim := 128
|
||||||
|
|||||||
@ -36,7 +36,7 @@ func TestQueryTask_all(t *testing.T) {
|
|||||||
qc = types.NewMockQueryCoord(t)
|
qc = types.NewMockQueryCoord(t)
|
||||||
qn = &QueryNodeMock{}
|
qn = &QueryNodeMock{}
|
||||||
|
|
||||||
shardsNum = int32(2)
|
shardsNum = common.DefaultShardsNum
|
||||||
collectionName = t.Name() + funcutil.GenRandomStr()
|
collectionName = t.Name() + funcutil.GenRandomStr()
|
||||||
|
|
||||||
expr = fmt.Sprintf("%s > 0", testInt64Field)
|
expr = fmt.Sprintf("%s > 0", testInt64Field)
|
||||||
|
|||||||
@ -28,10 +28,6 @@ import (
|
|||||||
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
testShardsNum = int32(2)
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestSearchTask_PostExecute(t *testing.T) {
|
func TestSearchTask_PostExecute(t *testing.T) {
|
||||||
t.Run("Test empty result", func(t *testing.T) {
|
t.Run("Test empty result", func(t *testing.T) {
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
@ -73,7 +69,7 @@ func createColl(t *testing.T, name string, rc types.RootCoord) {
|
|||||||
CreateCollectionRequest: &milvuspb.CreateCollectionRequest{
|
CreateCollectionRequest: &milvuspb.CreateCollectionRequest{
|
||||||
CollectionName: name,
|
CollectionName: name,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: testShardsNum,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
},
|
},
|
||||||
ctx: ctx,
|
ctx: ctx,
|
||||||
rootCoord: rc,
|
rootCoord: rc,
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import (
|
|||||||
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
"github.com/milvus-io/milvus/internal/proto/internalpb"
|
||||||
"github.com/milvus-io/milvus/internal/proto/querypb"
|
"github.com/milvus-io/milvus/internal/proto/querypb"
|
||||||
"github.com/milvus-io/milvus/internal/types"
|
"github.com/milvus-io/milvus/internal/types"
|
||||||
|
"github.com/milvus-io/milvus/pkg/common"
|
||||||
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
||||||
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
"github.com/milvus-io/milvus/pkg/util/paramtable"
|
||||||
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
"github.com/milvus-io/milvus/pkg/util/typeutil"
|
||||||
@ -32,7 +33,7 @@ func TestStatisticTask_all(t *testing.T) {
|
|||||||
qc = types.NewMockQueryCoord(t)
|
qc = types.NewMockQueryCoord(t)
|
||||||
qn = types.NewMockQueryNode(t)
|
qn = types.NewMockQueryNode(t)
|
||||||
|
|
||||||
shardsNum = int32(2)
|
shardsNum = common.DefaultShardsNum
|
||||||
collectionName = t.Name() + funcutil.GenRandomStr()
|
collectionName = t.Name() + funcutil.GenRandomStr()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -476,7 +476,7 @@ func TestCreateCollectionTask(t *testing.T) {
|
|||||||
rc.Start()
|
rc.Start()
|
||||||
defer rc.Stop()
|
defer rc.Stop()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
shardsNum := int32(2)
|
shardsNum := common.DefaultShardsNum
|
||||||
prefix := "TestCreateCollectionTask"
|
prefix := "TestCreateCollectionTask"
|
||||||
dbName := ""
|
dbName := ""
|
||||||
collectionName := prefix + funcutil.GenRandomStr()
|
collectionName := prefix + funcutil.GenRandomStr()
|
||||||
@ -911,7 +911,7 @@ func TestDescribeCollectionTask_ShardsNum1(t *testing.T) {
|
|||||||
dbName := ""
|
dbName := ""
|
||||||
collectionName := prefix + funcutil.GenRandomStr()
|
collectionName := prefix + funcutil.GenRandomStr()
|
||||||
|
|
||||||
shardsNum := int32(2)
|
shardsNum := common.DefaultShardsNum
|
||||||
int64Field := "int64"
|
int64Field := "int64"
|
||||||
floatVecField := "fvec"
|
floatVecField := "fvec"
|
||||||
dim := 128
|
dim := 128
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import (
|
|||||||
"github.com/milvus-io/milvus-proto/go-api/schemapb"
|
"github.com/milvus-io/milvus-proto/go-api/schemapb"
|
||||||
"github.com/milvus-io/milvus/internal/metastore/model"
|
"github.com/milvus-io/milvus/internal/metastore/model"
|
||||||
pb "github.com/milvus-io/milvus/internal/proto/etcdpb"
|
pb "github.com/milvus-io/milvus/internal/proto/etcdpb"
|
||||||
|
"github.com/milvus-io/milvus/pkg/common"
|
||||||
"github.com/milvus-io/milvus/pkg/log"
|
"github.com/milvus-io/milvus/pkg/log"
|
||||||
ms "github.com/milvus-io/milvus/pkg/mq/msgstream"
|
ms "github.com/milvus-io/milvus/pkg/mq/msgstream"
|
||||||
"github.com/milvus-io/milvus/pkg/util/commonpbutil"
|
"github.com/milvus-io/milvus/pkg/util/commonpbutil"
|
||||||
@ -133,7 +134,7 @@ func (t *createCollectionTask) prepareSchema() error {
|
|||||||
|
|
||||||
func (t *createCollectionTask) assignShardsNum() {
|
func (t *createCollectionTask) assignShardsNum() {
|
||||||
if t.Req.GetShardsNum() <= 0 {
|
if t.Req.GetShardsNum() <= 0 {
|
||||||
t.Req.ShardsNum = 2
|
t.Req.ShardsNum = common.DefaultShardsNum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@ import (
|
|||||||
"github.com/milvus-io/milvus/internal/proto/datapb"
|
"github.com/milvus-io/milvus/internal/proto/datapb"
|
||||||
"github.com/milvus-io/milvus/internal/proto/etcdpb"
|
"github.com/milvus-io/milvus/internal/proto/etcdpb"
|
||||||
mockrootcoord "github.com/milvus-io/milvus/internal/rootcoord/mocks"
|
mockrootcoord "github.com/milvus-io/milvus/internal/rootcoord/mocks"
|
||||||
|
"github.com/milvus-io/milvus/pkg/common"
|
||||||
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
"github.com/milvus-io/milvus/pkg/util/funcutil"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/mock"
|
"github.com/stretchr/testify/mock"
|
||||||
@ -289,7 +290,7 @@ func Test_createCollectionTask_Prepare(t *testing.T) {
|
|||||||
task.Req.ShardsNum = int32(Params.RootCoordCfg.DmlChannelNum.GetAsInt() + 1) // no enough channels.
|
task.Req.ShardsNum = int32(Params.RootCoordCfg.DmlChannelNum.GetAsInt() + 1) // no enough channels.
|
||||||
err = task.Prepare(context.Background())
|
err = task.Prepare(context.Background())
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
task.Req.ShardsNum = 1
|
task.Req.ShardsNum = common.DefaultShardsNum
|
||||||
err = task.Prepare(context.Background())
|
err = task.Prepare(context.Background())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import (
|
|||||||
"github.com/milvus-io/milvus/internal/metastore/model"
|
"github.com/milvus-io/milvus/internal/metastore/model"
|
||||||
mockrootcoord "github.com/milvus-io/milvus/internal/rootcoord/mocks"
|
mockrootcoord "github.com/milvus-io/milvus/internal/rootcoord/mocks"
|
||||||
mocktso "github.com/milvus-io/milvus/internal/tso/mocks"
|
mocktso "github.com/milvus-io/milvus/internal/tso/mocks"
|
||||||
|
"github.com/milvus-io/milvus/pkg/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGarbageCollectorCtx_ReDropCollection(t *testing.T) {
|
func TestGarbageCollectorCtx_ReDropCollection(t *testing.T) {
|
||||||
@ -113,8 +114,8 @@ func TestGarbageCollectorCtx_ReDropCollection(t *testing.T) {
|
|||||||
core.ddlTsLockManager = newDdlTsLockManager(core.tsoAllocator)
|
core.ddlTsLockManager = newDdlTsLockManager(core.tsoAllocator)
|
||||||
gc := newBgGarbageCollector(core)
|
gc := newBgGarbageCollector(core)
|
||||||
core.garbageCollector = gc
|
core.garbageCollector = gc
|
||||||
shardsNum := 2
|
shardsNum := common.DefaultShardsNum
|
||||||
pchans := ticker.getDmlChannelNames(shardsNum)
|
pchans := ticker.getDmlChannelNames(int(shardsNum))
|
||||||
gc.ReDropCollection(&model.Collection{PhysicalChannelNames: pchans}, 1000)
|
gc.ReDropCollection(&model.Collection{PhysicalChannelNames: pchans}, 1000)
|
||||||
<-releaseCollectionChan
|
<-releaseCollectionChan
|
||||||
assert.True(t, releaseCollectionCalled)
|
assert.True(t, releaseCollectionCalled)
|
||||||
@ -333,7 +334,7 @@ func TestGarbageCollectorCtx_RemoveCreatingCollection(t *testing.T) {
|
|||||||
func TestGarbageCollectorCtx_ReDropPartition(t *testing.T) {
|
func TestGarbageCollectorCtx_ReDropPartition(t *testing.T) {
|
||||||
t.Run("failed to GcPartitionData", func(t *testing.T) {
|
t.Run("failed to GcPartitionData", func(t *testing.T) {
|
||||||
ticker := newTickerWithMockFailStream() // failed to broadcast drop msg.
|
ticker := newTickerWithMockFailStream() // failed to broadcast drop msg.
|
||||||
shardsNum := 2
|
shardsNum := int(common.DefaultShardsNum)
|
||||||
pchans := ticker.getDmlChannelNames(shardsNum)
|
pchans := ticker.getDmlChannelNames(shardsNum)
|
||||||
tsoAllocator := newMockTsoAllocator()
|
tsoAllocator := newMockTsoAllocator()
|
||||||
tsoAllocator.GenerateTSOF = func(count uint32) (uint64, error) {
|
tsoAllocator.GenerateTSOF = func(count uint32) (uint64, error) {
|
||||||
@ -348,7 +349,7 @@ func TestGarbageCollectorCtx_ReDropPartition(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("failed to RemovePartition", func(t *testing.T) {
|
t.Run("failed to RemovePartition", func(t *testing.T) {
|
||||||
ticker := newTickerWithMockNormalStream()
|
ticker := newTickerWithMockNormalStream()
|
||||||
shardsNum := 2
|
shardsNum := int(common.DefaultShardsNum)
|
||||||
pchans := ticker.getDmlChannelNames(shardsNum)
|
pchans := ticker.getDmlChannelNames(shardsNum)
|
||||||
meta := newMockMetaTable()
|
meta := newMockMetaTable()
|
||||||
meta.RemovePartitionFunc = func(ctx context.Context, collectionID UniqueID, partitionID UniqueID, ts Timestamp) error {
|
meta.RemovePartitionFunc = func(ctx context.Context, collectionID UniqueID, partitionID UniqueID, ts Timestamp) error {
|
||||||
@ -367,7 +368,7 @@ func TestGarbageCollectorCtx_ReDropPartition(t *testing.T) {
|
|||||||
|
|
||||||
t.Run("normal case", func(t *testing.T) {
|
t.Run("normal case", func(t *testing.T) {
|
||||||
ticker := newTickerWithMockNormalStream()
|
ticker := newTickerWithMockNormalStream()
|
||||||
shardsNum := 2
|
shardsNum := int(common.DefaultShardsNum)
|
||||||
pchans := ticker.getDmlChannelNames(shardsNum)
|
pchans := ticker.getDmlChannelNames(shardsNum)
|
||||||
meta := newMockMetaTable()
|
meta := newMockMetaTable()
|
||||||
removePartitionCalled := false
|
removePartitionCalled := false
|
||||||
|
|||||||
@ -42,7 +42,7 @@ const (
|
|||||||
TimeStampFieldName = "Timestamp"
|
TimeStampFieldName = "Timestamp"
|
||||||
|
|
||||||
// DefaultShardsNum defines the default number of shards when creating a collection
|
// DefaultShardsNum defines the default number of shards when creating a collection
|
||||||
DefaultShardsNum = int32(2)
|
DefaultShardsNum = int32(1)
|
||||||
|
|
||||||
// InvalidPartitionID indicates that the partition is not specified. It will be set when the partitionName is empty
|
// InvalidPartitionID indicates that the partition is not specified. It will be set when the partitionName is empty
|
||||||
InvalidPartitionID = int64(-1)
|
InvalidPartitionID = int64(-1)
|
||||||
|
|||||||
@ -64,14 +64,14 @@ done
|
|||||||
|
|
||||||
function test_proxy()
|
function test_proxy()
|
||||||
{
|
{
|
||||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/proxy/..." -failfast -count=1
|
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/proxy/..." -failfast -count=1 -v
|
||||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/proxy/..." -failfast -count=1
|
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/proxy/..." -failfast -count=1 -v
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_querynode()
|
function test_querynode()
|
||||||
{
|
{
|
||||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/querynode/..." -failfast -count=1
|
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/querynodev2/..." -failfast -count=1
|
||||||
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querynodev2/..." -failfast -count=1
|
go test -race -cover ${APPLE_SILICON_FLAG} "${MILVUS_DIR}/distributed/querynode/..." -failfast -count=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -124,7 +124,7 @@ func TestBulkInsert(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
if createCollectionStatus.GetErrorCode() != commonpb.ErrorCode_Success {
|
if createCollectionStatus.GetErrorCode() != commonpb.ErrorCode_Success {
|
||||||
|
|||||||
@ -102,7 +102,7 @@ func TestHelloMilvus(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
if createCollectionStatus.GetErrorCode() != commonpb.ErrorCode_Success {
|
if createCollectionStatus.GetErrorCode() != commonpb.ErrorCode_Success {
|
||||||
|
|||||||
@ -115,7 +115,7 @@ func TestShowSegments(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, createCollectionStatus.GetErrorCode(), commonpb.ErrorCode_Success)
|
assert.Equal(t, createCollectionStatus.GetErrorCode(), commonpb.ErrorCode_Success)
|
||||||
@ -207,7 +207,7 @@ func TestShowReplicas(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
if createCollectionStatus.GetErrorCode() != commonpb.ErrorCode_Success {
|
if createCollectionStatus.GetErrorCode() != commonpb.ErrorCode_Success {
|
||||||
|
|||||||
@ -99,7 +99,7 @@ func TestRangeSearchIP(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ func TestRangeSearchL2(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
@ -98,7 +98,7 @@ func TestUpsert(t *testing.T) {
|
|||||||
DbName: dbName,
|
DbName: dbName,
|
||||||
CollectionName: collectionName,
|
CollectionName: collectionName,
|
||||||
Schema: marshaledSchema,
|
Schema: marshaledSchema,
|
||||||
ShardsNum: 2,
|
ShardsNum: common.DefaultShardsNum,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user