Fix bug:wait for search finish when stop querynode (#14228)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
zhenshan.cao 2021-12-25 13:36:19 +08:00 committed by GitHub
parent f67f29a613
commit 684a63b698
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -665,8 +665,10 @@ func (colReplica *collectionReplica) getExcludedSegments(collectionID UniqueID)
// freeAll will free all meta info from collectionReplica
func (colReplica *collectionReplica) freeAll() {
colReplica.queryMu.Lock() // wait for current search/query finish
colReplica.mu.Lock()
defer colReplica.mu.Unlock()
defer colReplica.queryMu.Unlock()
for id := range colReplica.collections {
_ = colReplica.removeCollectionPrivate(id)