Set inMemoryPercentage to 0 when releasing partition (#7310)

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
pull/7336/head
bigsheeper 2021-08-27 16:51:11 +08:00 committed by GitHub
parent 0281bd8d22
commit 1e60cccaf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -466,6 +466,14 @@ func (m *MetaReplica) releasePartition(collectionID UniqueID, partitionID Unique
}
releasedPartitionIDs = append(releasedPartitionIDs, partitionID)
info.ReleasedPartitionIDs = releasedPartitionIDs
// If user loaded a collectionA, and release a partitionB which belongs to collectionA,
// and then load collectionA again, if we don't set the inMemoryPercentage to 0 when releasing
// partitionB, the second loading of collectionA would directly return because
// the inMemoryPercentage in ShowCollection response is still the old value -- 100.
// So if releasing partition, inMemoryPercentage should be set to 0.
info.InMemoryPercentage = 0
err := saveGlobalCollectionInfo(collectionID, info, m.client)
if err != nil {
log.Error("save collectionInfo error", zap.Any("error", err.Error()), zap.Int64("collectionID", collectionID))

View File

@ -304,8 +304,8 @@ func (q *queryCollection) receiveQueryMsg(msg queryMsg) error {
// zap.Int64("target collectionID", collectionID),
// zap.Int64("msgID", msg.ID()),
//)
err := fmt.Errorf("not target collection query request, collectionID = %d, targetCollectionID = %d, msgID = %d", q.collectionID, collectionID, msg.ID())
return err
//err := fmt.Errorf("not target collection query request, collectionID = %d, targetCollectionID = %d, msgID = %d", q.collectionID, collectionID, msg.ID())
return nil
}
sp, ctx := trace.StartSpanFromContext(msg.TraceCtx())