lib/db: Prevent IndexID creation race (#7211)

This commit is contained in:
Simon Frei
2020-12-21 11:32:59 +01:00
committed by GitHub
parent 78a41828fc
commit 4a787986cd
3 changed files with 50 additions and 11 deletions
+2
View File
@@ -65,6 +65,7 @@ type Lowlevel struct {
gcKeyCount int
indirectGCInterval time.Duration
recheckInterval time.Duration
oneFileSetCreated chan struct{}
}
func NewLowlevel(backend backend.Backend, opts ...Option) *Lowlevel {
@@ -78,6 +79,7 @@ func NewLowlevel(backend backend.Backend, opts ...Option) *Lowlevel {
gcMut: sync.NewRWMutex(),
indirectGCInterval: indirectGCDefaultInterval,
recheckInterval: recheckDefaultInterval,
oneFileSetCreated: make(chan struct{}),
}
for _, opt := range opts {
opt(db)