Merge pull request #13010 from ipixiu/imp/store-scheduleCompaction-lock

limit tx lock scope in store.scheduleCompaction
This commit is contained in:
Piotr Tabor
2021-05-26 08:51:44 +02:00
committed by GitHub

View File

@@ -65,9 +65,9 @@ func (s *store) scheduleCompaction(compactMainRev int64, keep map[revision]struc
return true
}
tx.Unlock()
// update last
revToBytes(revision{main: rev.main, sub: rev.sub + 1}, last)
tx.Unlock()
// Immediately commit the compaction deletes instead of letting them accumulate in the write buffer
s.b.ForceCommit()
dbCompactionPauseMs.Observe(float64(time.Since(start) / time.Millisecond))