mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Use read lock when only read the var (#12711)
Signed-off-by: Cai.Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
6c1a471570
commit
dd88083db7
@ -471,8 +471,8 @@ func (s *Segment) getIndexName(fieldID int64) string {
|
||||
}
|
||||
|
||||
func (s *Segment) getIndexID(fieldID int64) UniqueID {
|
||||
s.paramMutex.Lock()
|
||||
defer s.paramMutex.Unlock()
|
||||
s.paramMutex.RLock()
|
||||
defer s.paramMutex.RUnlock()
|
||||
if _, ok := s.indexInfos[fieldID]; !ok {
|
||||
return -1
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user