From 90741da019bba15b97952b3952ca5326aa2914e2 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 8 Mar 2021 21:46:44 +0200 Subject: [PATCH] tune badger gc to repeated gc the value log until there is no rewrite --- blockstore/badger/blockstore.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blockstore/badger/blockstore.go b/blockstore/badger/blockstore.go index 16f9331f2..2c00f4240 100644 --- a/blockstore/badger/blockstore.go +++ b/blockstore/badger/blockstore.go @@ -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