Skip to content

Commit

Permalink
Dont reopen idx with refs (#12346)
Browse files Browse the repository at this point in the history
It looks like the closeIdx function here will close indexes while they
are referenced by transactions.

This adds a check to stop that.
  • Loading branch information
mh0lt authored Oct 16, 2024
1 parent 315f638 commit 67edaa8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turbo/snapshotsync/freezeblocks/block_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,10 @@ func (s *DirtySegment) reopenIdxIfNeed(dir string, optimistic bool) (err error)
}

func (s *DirtySegment) reopenIdx(dir string) (err error) {
if s.refcount.Load() > 0 {
return nil
}

s.closeIdx()
if s.Decompressor == nil {
return nil
Expand Down

0 comments on commit 67edaa8

Please sign in to comment.