Release collection if all partition released (#25706)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/25764/head
yihao.dai 2023-07-19 16:54:58 +08:00 committed by GitHub
parent 6534396b3d
commit 172db82b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -165,9 +165,8 @@ func (job *ReleasePartitionJob) Execute() error {
}
releasePartitions(job.ctx, job.meta, job.cluster, req.GetCollectionID(), toRelease...)
// If all partitions are released and LoadType is LoadPartition, clear all
if len(toRelease) == len(loadedPartitions) &&
job.meta.GetLoadType(req.GetCollectionID()) == querypb.LoadType_LoadPartition {
// If all partitions are released, clear all
if len(toRelease) == len(loadedPartitions) {
log.Info("release partitions covers all partitions, will remove the whole collection")
err := job.meta.CollectionManager.RemoveCollection(req.GetCollectionID())
if err != nil {

View File

@ -1042,7 +1042,7 @@ func (suite *JobSuite) TestDynamicRelease() {
err = job.Wait()
suite.NoError(err)
suite.assertPartitionReleased(col0, p0, p1, p2)
suite.True(suite.meta.Exist(col0))
suite.False(suite.meta.Exist(col0))
// loaded: p0, p1, p2
// action: release col