diff --git a/internal/masterservice/meta_table.go b/internal/masterservice/meta_table.go index a06d5dafc6ff8194a77868bcb6b4eaaf3a64f842..73ce36f39923ecdde2ce086ef97bc6d3ae2c4256 100644 --- a/internal/masterservice/meta_table.go +++ b/internal/masterservice/meta_table.go @@ -695,7 +695,7 @@ func (mt *metaTable) GetNotIndexedSegments(collName string, fieldName string, in func (mt *metaTable) GetIndexByName(collName string, fieldName string, indexName string) ([]pb.IndexInfo, error) { mt.ddLock.RLock() - mt.ddLock.RUnlock() + defer mt.ddLock.RUnlock() collID, ok := mt.collName2ID[collName] if !ok { @@ -746,7 +746,7 @@ func (mt *metaTable) GetIndexByName(collName string, fieldName string, indexName func (mt *metaTable) GetIndexByID(indexID typeutil.UniqueID) (*pb.IndexInfo, error) { mt.ddLock.RLock() - mt.ddLock.RUnlock() + defer mt.ddLock.RUnlock() indexInfo, ok := mt.indexID2Meta[indexID] if !ok {