Fix/WC init race condition #261

Merged
fyrchik merged 1 commit from fix/races-in-WC into master 2023-04-19 09:29:08 +00:00

View file

@ -86,13 +86,21 @@ func (c *cache) fsTreeFlushMarkUpdate(ctx context.Context) {
} }
return nil return nil
} }
c.modeMtx.RLock()
defer c.modeMtx.RUnlock()
_, _ = c.fsTree.Iterate(prm) _, _ = c.fsTree.Iterate(prm)
c.log.Info(logs.WritecacheFinishedUpdatingFSTreeFlushMarks) c.log.Info(logs.WritecacheFinishedUpdatingFSTreeFlushMarks)
} }
func (c *cache) dbFlushMarkUpdate(ctx context.Context) { func (c *cache) dbFlushMarkUpdate(ctx context.Context) {
c.log.Info(logs.WritecacheFillingFlushMarksForObjectsInDatabase) c.log.Info(logs.WritecacheFillingFlushMarksForObjectsInDatabase)
c.modeMtx.RLock()
defer c.modeMtx.RUnlock()
var m []string var m []string
var indices []int var indices []int
var lastKey []byte var lastKey []byte