Re:ZFS Is the Best Filesystem For Now
by orf on Wednesday July 12, 2017 @05:04PM
(#14756663)
File system snapshots of databases are not necessarily consistent, and can not always be restored like that.
[ Parent
| on HN ]
Atomic snapshots like ZFS's are always consistent for Postgres. I guess other databases with a similar write-ahead log can be snapshotted as well?
> Atomic snapshots like ZFS's are always consistent for Postgres.
As long as you make sure to only use one filesystem, i.e. you don't place pg_xlog or some tablespaces on a different filesystem. You can get very weird corruption in such cases :)
With ZFS you can also do atomic snapshots of multiple filesystems. https://serverfault.com/questions/608223/is-zfs-snapshot-r-o...
Interesting. I played with ZFS years ago on opensolaris, I don't remember there were atomic snapshots. I definitely need to dive into ZFS again.
But if we "stop" this database/schema, make ZFS snapshot (I suggest that the "partition" keeps only this database related files) it may work. It can be useful for testing purposes I guess.