tune badger gc to repeated gc the value log until there is no rewrite

This commit is contained in:
vyzo 2021-03-08 21:46:44 +02:00
parent c52dae45c5
commit 90741da019

View File

@ -137,7 +137,11 @@ func (b *Blockstore) CollectGarbage() error {
return ErrBlockstoreClosed
}
err := b.DB.RunValueLogGC(0.125)
var err error
for err == nil {
err = b.DB.RunValueLogGC(0.125)
}
if err == badger.ErrNoRewrite {
// not really an error in this case
return nil