diff --git a/internal/querycoordv2/job/job_load.go b/internal/querycoordv2/job/job_load.go index bdefa088ca796..234ab219e90ea 100644 --- a/internal/querycoordv2/job/job_load.go +++ b/internal/querycoordv2/job/job_load.go @@ -102,11 +102,6 @@ func (job *LoadCollectionJob) PreExecute() error { ) log.Warn(msg) return merr.WrapErrParameterInvalid(collection.GetReplicaNumber(), req.GetReplicaNumber(), "can't change the replica number for loaded collection") - } else if !typeutil.MapEqual(collection.GetFieldIndexID(), req.GetFieldIndexID()) { - msg := fmt.Sprintf("collection with different index %v existed, release this collection first before changing its index", - collection.GetFieldIndexID()) - log.Warn(msg) - return merr.WrapErrParameterInvalid(collection.GetFieldIndexID(), req.GetFieldIndexID(), "can't change the index for loaded collection") } return nil @@ -291,11 +286,6 @@ func (job *LoadPartitionJob) PreExecute() error { msg := "collection with different replica number existed, release this collection first before changing its replica number" log.Warn(msg) return merr.WrapErrParameterInvalid(collection.GetReplicaNumber(), req.GetReplicaNumber(), "can't change the replica number for loaded partitions") - } else if !typeutil.MapEqual(collection.GetFieldIndexID(), req.GetFieldIndexID()) { - msg := fmt.Sprintf("collection with different index %v existed, release this collection first before changing its index", - job.meta.GetFieldIndex(req.GetCollectionID())) - log.Warn(msg) - return merr.WrapErrParameterInvalid(collection.GetFieldIndexID(), req.GetFieldIndexID(), "can't change the index for loaded partitions") } return nil diff --git a/internal/querycoordv2/job/job_test.go b/internal/querycoordv2/job/job_test.go index e31e1e062f00e..ad07022f6fb5e 100644 --- a/internal/querycoordv2/job/job_test.go +++ b/internal/querycoordv2/job/job_test.go @@ -418,70 +418,6 @@ func (suite *JobSuite) TestLoadCollectionWithReplicas() { } } -func (suite *JobSuite) TestLoadCollectionWithDiffIndex() { - ctx := context.Background() - - // Test load collection - for _, collection := range suite.collections { - if suite.loadTypes[collection] != querypb.LoadType_LoadCollection { - continue - } - // Load with 1 replica - req := &querypb.LoadCollectionRequest{ - CollectionID: collection, - FieldIndexID: map[int64]int64{ - defaultVecFieldID: defaultIndexID, - }, - } - job := NewLoadCollectionJob( - ctx, - req, - suite.dist, - suite.meta, - suite.broker, - suite.cluster, - suite.targetMgr, - suite.targetObserver, - suite.collectionObserver, - suite.nodeMgr, - ) - suite.scheduler.Add(job) - err := job.Wait() - suite.NoError(err) - suite.EqualValues(1, suite.meta.GetReplicaNumber(collection)) - suite.targetMgr.UpdateCollectionCurrentTarget(collection) - suite.assertCollectionLoaded(collection) - } - - // Test load with different index - for _, collection := range suite.collections { - if suite.loadTypes[collection] != querypb.LoadType_LoadCollection { - continue - } - req := &querypb.LoadCollectionRequest{ - CollectionID: collection, - FieldIndexID: map[int64]int64{ - defaultVecFieldID: -defaultIndexID, - }, - } - job := NewLoadCollectionJob( - ctx, - req, - suite.dist, - suite.meta, - suite.broker, - suite.cluster, - suite.targetMgr, - suite.targetObserver, - suite.collectionObserver, - suite.nodeMgr, - ) - suite.scheduler.Add(job) - err := job.Wait() - suite.ErrorIs(err, merr.ErrParameterInvalid) - } -} - func (suite *JobSuite) TestLoadPartition() { ctx := context.Background() @@ -834,73 +770,6 @@ func (suite *JobSuite) TestLoadPartitionWithReplicas() { } } -func (suite *JobSuite) TestLoadPartitionWithDiffIndex() { - ctx := context.Background() - - // Test load partition - for _, collection := range suite.collections { - if suite.loadTypes[collection] != querypb.LoadType_LoadPartition { - continue - } - // Load with 1 replica - req := &querypb.LoadPartitionsRequest{ - CollectionID: collection, - PartitionIDs: suite.partitions[collection], - FieldIndexID: map[int64]int64{ - defaultVecFieldID: defaultIndexID, - }, - } - job := NewLoadPartitionJob( - ctx, - req, - suite.dist, - suite.meta, - suite.broker, - suite.cluster, - suite.targetMgr, - suite.targetObserver, - suite.collectionObserver, - suite.nodeMgr, - ) - suite.scheduler.Add(job) - err := job.Wait() - suite.NoError(err) - suite.EqualValues(1, suite.meta.GetReplicaNumber(collection)) - suite.targetMgr.UpdateCollectionCurrentTarget(collection) - suite.assertCollectionLoaded(collection) - } - - // Test load partition with different index - for _, collection := range suite.collections { - if suite.loadTypes[collection] != querypb.LoadType_LoadPartition { - continue - } - // Load with 1 replica - req := &querypb.LoadPartitionsRequest{ - CollectionID: collection, - PartitionIDs: suite.partitions[collection], - FieldIndexID: map[int64]int64{ - defaultVecFieldID: -defaultIndexID, - }, - } - job := NewLoadPartitionJob( - ctx, - req, - suite.dist, - suite.meta, - suite.broker, - suite.cluster, - suite.targetMgr, - suite.targetObserver, - suite.collectionObserver, - suite.nodeMgr, - ) - suite.scheduler.Add(job) - err := job.Wait() - suite.ErrorIs(err, merr.ErrParameterInvalid) - } -} - func (suite *JobSuite) TestReleaseCollection() { ctx := context.Background()