Fix/WC init race condition #261
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue
Why not
defer
?wanted it to unlock as fast as possible, without logging and other (possible in future) things. changed to be deferred