mvcc: Optimize compaction for short commit pauses
@@ -30,7 +30,7 @@ func (s *store) scheduleCompaction(compactMainRev int64, keep map[revision]struc
end := make([]byte, 8)
binary.BigEndian.PutUint64(end, uint64(compactMainRev+1))
- batchsize := int64(10000)
+ batchsize := int64(1000)
last := make([]byte, 8+1+8)
for {
var rev revision
@@ -68,10 +68,11 @@ func (s *store) scheduleCompaction(compactMainRev int64, keep map[revision]struc
// update last
revToBytes(revision{main: rev.main, sub: rev.sub + 1}, last)
tx.Unlock()
+ s.b.ForceCommit()
dbCompactionPauseMs.Observe(float64(time.Since(start) / time.Millisecond))
select {
- case <-time.After(100 * time.Millisecond):
+ case <-time.After(10 * time.Millisecond):
case <-s.stopc:
return false
}
