Hello there,
am new to restic and having trouble with my restic backups. It was running all fine these days suddenly i am getting OOM killed for the pods. Initially expanding the memory size worked then again when we tried to trigger backup it failed with error. And then we removed both request and limit but still it seems to be ending with error while trying to prune.
Restic version : 0.16.0
rclone:1.64.2
The place where i get error in my script is for below step in backup
restic forget --keep-within “${RESTIC_KEEP_WITHIN}”
restic prune --max-unused 0
loading indexes...
loading all snapshots...
finding data that is still in use for 2664 snapshots
runtime: out of memory: cannot allocate 79691776-byte block (4000055296 in use)
fatal error: out of memory
goroutine 153 [running]:
runtime.throw({0x8d7c43b, 0xd})
/usr/local/go/src/runtime/panic.go:1077 +0x4d fp=0x9f75a6c sp=0x9f75a58 pc=0x808467d
runtime.(*mcache).allocLarge(0xf7f94c40, 0x4b70000, 0x1)
/usr/local/go/src/runtime/mcache.go:236 +0x1c7 fp=0x9f75a98 sp=0x9f75a6c pc=0x805fef7
runtime.mallocgc(0x4b70000, 0x8c5ea00, 0x1)
/usr/local/go/src/runtime/malloc.go:1123 +0x5d7 fp=0x9f75aec sp=0x9f75a98 pc=0x8057997
runtime.newarray(0x8c5ea00, 0x44000)
/usr/local/go/src/runtime/malloc.go:1346 +0x44 fp=0x9f75b00 sp=0x9f75aec pc=0x8057ee4
runtime.makeBucketArray(0x8d00040, 0x12, 0x0)
/usr/local/go/src/runtime/map.go:364 +0x15b fp=0x9f75b18 sp=0x9f75b00 pc=0x8058c1b
runtime.hashGrow(0x8d00040, 0xa092400)
/usr/local/go/src/runtime/map.go:1068 +0x78 fp=0x9f75b3c sp=0x9f75b18 pc=0x805a408
runtime.mapassign(0x8d00040, 0xa092400, 0x9f75ba4)
/usr/local/go/src/runtime/map.go:659 +0xd6 fp=0x9f75b8c sp=0x9f75b3c pc=0x8059346
github.com/restic/restic/internal/restic.CountedBlobSet.Insert(0xa092400, {{0x93, 0x4d, 0xe5, 0x41, 0x76, 0x11, 0xfb, 0x27, 0xee, ...}, ...})
/restic/internal/restic/counted_blob_set.go:28 +0x33 fp=0x9f75ba0 sp=0x9f75b8c pc=0x840e643
github.com/restic/restic/internal/restic.FindUsedBlobs.func1({0x93, 0x4d, 0xe5, 0x41, 0x76, 0x11, 0xfb, 0x27, 0xee, 0xc8, ...})
/restic/internal/restic/find.go:35 +0xb6 fp=0x9f75c08 sp=0x9f75ba0 pc=0x840fad6
github.com/restic/restic/internal/restic.filterTrees({0x8f340c0, 0x1b5ca8d0}, {0xef0ad340, 0x9ca2d80}, {0x1c284000, 0xa68, 0xe00}, 0x1b5b5f40, 0x1c584000, 0x1b5b5f80, ...)
/restic/internal/restic/tree_stream.go:72 +0x2a8 fp=0x9f75f44 sp=0x9f75c08 pc=0x8421028
github.com/restic/restic/internal/restic.StreamTrees.func3()
/restic/internal/restic/tree_stream.go:192 +0x15a fp=0x9f75fc0 sp=0x9f75f44 pc=0x842208a
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/build/go/pkg/mod/golang.org/x/sync@v0.4.0/errgroup/errgroup.go:75 +0x60 fp=0x9f75ff0 sp=0x9f75fc0 pc=0x83dbe50
runtime.goexit()
/usr/local/go/src/runtime/asm_386.s:1363 +0x1 fp=0x9f75ff4 sp=0x9f75ff0 pc=0x80b8061
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 1
/home/build/go/pkg/mod/golang.org/x/sync@v0.4.0/errgroup/errgroup.go:72 +0x99
Can someone help me here how to resolve this issue. And also in addition we have already set GOGC=20 as well but no luck.
Usually i run this as shell script and it will work inside cronjob.
now to test the script I had tried to run the manual steps with below command
restic forget --keep-within 7d --prune -v
restic prune --max-repack-size 0
loading indexes...
[1:58] 100.00% 183 / 183 index files loaded
loading all snapshots...
finding data that is still in use for 278 snapshots
runtime: out of memory: cannot allocate 633339904-byte block (3320643584 in use)
fatal error: out of memory