Use read lock when only read the var (#12626)

Signed-off-by: Cai.Zhang <cai.zhang@zilliz.com>
pull/12759/head
cai.zhang 2021-12-07 10:03:47 +08:00 committed by GitHub
parent 1f67ab4e09
commit b4be8acc1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -489,8 +489,8 @@ func (s *Segment) getBuildID(fieldID int64) UniqueID {
}
func (s *Segment) getIndexPaths(fieldID int64) []string {
s.paramMutex.Lock()
defer s.paramMutex.Unlock()
s.paramMutex.RLock()
defer s.paramMutex.RUnlock()
if _, ok := s.indexInfos[fieldID]; !ok {
return nil
}