Skip to content

Commit 4fab6ba

Browse files
committed
Addressing review comments
1 parent 7fcbf77 commit 4fab6ba

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

index/scorch/scorch.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,9 +955,7 @@ func (s *Scorch) UpdateFields(fieldInfo map[string]*index.UpdateFieldInfo, mappi
955955
return err
956956
}
957957
// Pass the update field info to all snapshots and segment bases
958-
s.root.m.Lock()
959958
s.root.UpdateFieldsInfo(fieldInfo)
960-
s.root.m.Unlock()
961959
return nil
962960
}
963961

index/scorch/snapshot_index.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,9 @@ func (is *IndexSnapshot) UpdateSynonymSearchCount(delta uint64) {
12071207

12081208
// Update current snapshot updated field data as well as pass it on to all segments and segment bases
12091209
func (is *IndexSnapshot) UpdateFieldsInfo(updatedFields map[string]*index.UpdateFieldInfo) {
1210+
is.m.Lock()
1211+
defer is.m.Unlock()
1212+
12101213
is.MergeUpdateFieldsInfo(updatedFields)
12111214

12121215
for _, segmentSnapshot := range is.segment {

0 commit comments

Comments
 (0)