[#584] Disable compression in badger writecache #588

Merged
fyrchik merged 1 commit from ale64bit/frostfs-node:fix/584-wc-badger-no-compression into master 2023-08-10 08:04:22 +00:00

View file

@ -5,6 +5,7 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
"github.com/dgraph-io/badger/v4"
badgeroptions "github.com/dgraph-io/badger/v4/options"
)
// OpenDB opens a badger instance for write-cache. Opens in read-only mode if ro is true.
@ -12,6 +13,7 @@ func OpenDB(p string, ro bool, l *logger.Logger) (*badger.DB, error) {
return badger.Open(badger.DefaultOptions(p).
WithReadOnly(ro).
WithSyncWrites(true).
WithCompression(badgeroptions.None).
WithLoggingLevel(badger.ERROR).
WithLogger(badgerLoggerWrapper{l}))
}