diff --git a/badger/cmd/backup.go b/badger/cmd/backup.go index a2df7644e..7d8b38e64 100644 --- a/badger/cmd/backup.go +++ b/badger/cmd/backup.go @@ -55,7 +55,7 @@ func doBackup(cmd *cobra.Command, args []string) error { opt := badger.DefaultOptions(sstDir). WithValueDir(vlogDir). WithTruncate(truncate). - WithNumVersionsToKeep(math.MaxUint32) + WithNumVersionsToKeep(math.MaxInt32) if numVersions > 0 { opt.NumVersionsToKeep = numVersions diff --git a/badger/cmd/restore.go b/badger/cmd/restore.go index ad7f133a8..0c32f9dfd 100644 --- a/badger/cmd/restore.go +++ b/badger/cmd/restore.go @@ -68,7 +68,7 @@ func doRestore(cmd *cobra.Command, args []string) error { // Open DB db, err := badger.Open(badger.DefaultOptions(sstDir). WithValueDir(vlogDir). - WithNumVersionsToKeep(math.MaxUint32)) + WithNumVersionsToKeep(math.MaxInt32)) if err != nil { return err } diff --git a/value.go b/value.go index 9a3547fb5..1bc03d705 100644 --- a/value.go +++ b/value.go @@ -48,7 +48,7 @@ import ( // maxVlogFileSize is the maximum size of the vlog file which can be created. Vlog Offset is of // uint32, so limiting at max uint32. -var maxVlogFileSize = math.MaxUint32 +var maxVlogFileSize uint32 = math.MaxUint32 // Values have their first byte being byteData or byteDelete. This helps us distinguish between // a key that has never been seen and a key that has been explicitly deleted.