Skip to content

Commit

Permalink
Clear vector index cache before unmapping
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavdangeti committed Apr 11, 2024
1 parent bb4bf59 commit 1ca866b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ func (s *Segment) Close() (err error) {
}

func (s *Segment) closeActual() (err error) {
// clear contents from the vector index cache before un-mmapping
s.vecIndexCache.Clear()

if s.mm != nil {
err = s.mm.Unmap()
}
Expand All @@ -643,7 +646,7 @@ func (s *Segment) closeActual() (err error) {
err = err2
}
}
s.vecIndexCache.Clear()

return
}

Expand Down

0 comments on commit 1ca866b

Please sign in to comment.