Re:Five Years of Btrfs
by iracic on Monday January 27, 2020 @12:45PM
(#22161791)
It is possible to put database in state that is "ready" for snapshot, pushing changes to disk and sort of freezing I/O during snapshot.
[ Parent
| on HN ]
this is generally not a matter of concern for a copy on write filesystem like zfs, since it's not possible for the file to be in an "in between" state. If a write were in progress, the filesystem would still be pointing to the previous state. Only when the data is written to disk is the pointer moved to the new location.
It very much is a concern. ZFS has no knowledge about the internals of a database, which parts of a file are related to each other etc.
DBMSes always keep their database in the file system in a consistent state to be able to recover from system crashes. Taking a file system snapshot is equivalent to pulling the power on the database server in terms of data recovery, but databases are designed to support this.
As do filesystems. Yet I've seen anyone argue that cutting the power is the recommended way of doing backups.
In fact the opposite, make sure to use an UPS just so that you can shutdown cleanly in the unfortunate event.
For example: https://blogs.oracle.com/paulie/backing-up-mysql-using-zfs-s...
Some people came up with the idea of "crash-only software", arguing that it's better to maintain one code path (recovering from a crash) than two (clean start and recovery), but it hasn't caught on that much. https://www.usenix.org/legacy/events/hotos03/tech/full_paper...
Re:Five Years of Btrfs
by paulddraper on Monday January 27, 2020 @06:55PM
(#22165102)
Google follows this, I believe
It matters when various writes to files need to be ordered, and the DB processes is keeping some of the consistency part in memory.
Re:Five Years of Btrfs
by Teknoman117 on Monday January 27, 2020 @02:20PM
(#22162761)
It is a matter of concern if said database systems leaves its filesystem contents in an inconsistent state at any point. ZFS, BTRFS, and others can only keep consistent what they have control over.