From bc35923d5a15558b59e2d56b9cb96c21652e29e5 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Tue, 1 Dec 2020 12:50:24 +0530 Subject: [PATCH] Change default compression to zstd:3 (#7023) --- dgraph/cmd/bulk/run.go | 2 +- worker/restore.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dgraph/cmd/bulk/run.go b/dgraph/cmd/bulk/run.go index 0ece2dfa5e5..576ffe365c8 100644 --- a/dgraph/cmd/bulk/run.go +++ b/dgraph/cmd/bulk/run.go @@ -107,7 +107,7 @@ func init() { " The key size indicates the chosen AES encryption (AES-128/192/256 respectively). "+ " This key is used to encrypt the output data directories and to decrypt the input "+ " schema and data files (if encrytped). Enterprise feature.") - flag.Int("badger.compression_level", 1, + flag.Int("badger.compression_level", 3, "The compression level for Badger. A higher value uses more resources.") flag.Int64("badger.cache_mb", 0, "Total size of cache (in MB) per shard in reducer.") flag.String("badger.cache_percentage", "0,100", diff --git a/worker/restore.go b/worker/restore.go index 5a555fb236a..0fbdb8f6e5b 100644 --- a/worker/restore.go +++ b/worker/restore.go @@ -65,6 +65,8 @@ func RunRestore(pdir, location, backupId, keyfile string) LoadResult { // The badger DB should be opened only after creating the backup // file reader and verifying the encryption in the backup file. db, err := badger.OpenManaged(badger.DefaultOptions(dir). + WithCompression(options.ZSTD). + WithZSTDCompressionLevel(3). WithSyncWrites(false). WithTableLoadingMode(options.MemoryMap). WithValueThreshold(1 << 10).