diff --git a/worker/backup_processor.go b/worker/backup_processor.go index f8a0369d522..8433159f2bf 100644 --- a/worker/backup_processor.go +++ b/worker/backup_processor.go @@ -122,9 +122,12 @@ func (pr *BackupProcessor) WriteBackup(ctx context.Context) (*pb.BackupResponse, newhandler, err := enc.GetWriter(x.WorkerConfig.EncryptionKey, handler) if err != nil { - return &response, err + return &response, errors.Wrap(err, "failed to get encWriter") + } + gzWriter, err := gzip.NewWriterLevel(newhandler, gzip.BestSpeed) + if err != nil { + return &response, errors.Wrap(err, "failed to create new gzip writer") } - gzWriter := gzip.NewWriter(newhandler) stream := pr.DB.NewStreamAt(pr.Request.ReadTs) stream.LogPrefix = "Dgraph.Backup" diff --git a/worker/export.go b/worker/export.go index 53213bcf3b0..82e10c1b70c 100644 --- a/worker/export.go +++ b/worker/export.go @@ -369,7 +369,7 @@ func (writer *fileWriter) open(fpath string) error { if err != nil { return err } - writer.gw, err = gzip.NewWriterLevel(w, gzip.BestCompression) + writer.gw, err = gzip.NewWriterLevel(w, gzip.BestSpeed) return err }