flush implicit writes at the right time before starting compaction to avoid races

This commit is contained in:
vyzo 2021-07-02 11:18:51 +03:00
parent 7f473f56eb
commit d0bfe421b5

View File

@ -879,7 +879,6 @@ func (s *SplitStore) compact(curTs *types.TipSet) {
log.Infow("current mark set size estimate", "size", s.markSetSize) log.Infow("current mark set size estimate", "size", s.markSetSize)
} }
s.flushImplicitWrites(false)
start := time.Now() start := time.Now()
err = s.doCompact(curTs) err = s.doCompact(curTs)
took := time.Since(start).Milliseconds() took := time.Since(start).Milliseconds()
@ -939,6 +938,8 @@ func (s *SplitStore) doCompact(curTs *types.TipSet) error {
defer s.debug.Flush() defer s.debug.Flush()
s.flushImplicitWrites(false)
// 1. mark reachable objects by walking the chain from the current epoch to the boundary epoch // 1. mark reachable objects by walking the chain from the current epoch to the boundary epoch
log.Infow("marking reachable blocks", "currentEpoch", currentEpoch, "boundaryEpoch", boundaryEpoch) log.Infow("marking reachable blocks", "currentEpoch", currentEpoch, "boundaryEpoch", boundaryEpoch)
startMark := time.Now() startMark := time.Now()