ZFS So many snapshots, a destroy command leads to an OOM crash

Hi,

I don't post often as I can usually search for my answers.

As the title states, snapshots have gone out of control and now, trying to destroy -r a ZFS, the system eventually runs out of memory (16GB) and crashes.

I added a 30GB swap ZVOL, but it is never touched and the system runs out of memory and crashes.

I can plug 1 more disk into this system. Would adding a 320GB spinning disk and making it all swap help?
I might try a "zfs list" next so I can destroy individual or ranges of snapshots, but I recall listing having the same system crash results.

Thanks for any advice.

11.3-RELEASE-p5
 
interesting problem. Have you turned off all other services when trying to delete snaps? Also: is your ARC limited? For the future: I can recommend to have snapshots in a certain format and run some cleaning services like zrepl (the pruning job) or zfsnap

... or: maybe you can delete the snapshots one by one: for i in `zfs list -t snap -o name | egrep "^pool/dataset\@"`; do zfs destroy "$i"; done

just play around with the regex and with "echo $i" instead of "zfs destroy $i" in that command until it does what it should - maybe it helps
 
Back
Top