mirror of https://github.com/milvus-io/milvus.git
Use write lock when writing the var (#12528)
Signed-off-by: Cai.Zhang <cai.zhang@zilliz.com>pull/12577/head
parent
a7af1042db
commit
deaf4a642c
|
@ -532,8 +532,8 @@ func (s *Segment) matchIndexParam(fieldID int64, indexParams indexParam) bool {
|
|||
}
|
||||
|
||||
func (s *Segment) setIndexInfo(fieldID int64, info *indexInfo) error {
|
||||
s.paramMutex.RLock()
|
||||
defer s.paramMutex.RUnlock()
|
||||
s.paramMutex.Lock()
|
||||
defer s.paramMutex.Unlock()
|
||||
if s.indexInfos == nil {
|
||||
return errors.New("indexInfos hasn't been init")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue