top | item 37231629

(no title)

Xaiph_Rahci | 2 years ago

> cost of writing after a snapshot is the same as before the snapshot

I didn't understand this, could you please clarify?

If there was no snapshot, there would be only one write operation, the actual write. However, with snapshot in place, in addition to actual write, there is a copy operation which copies the original data and writes to snapshot location. So, there should be two write operations (actual + copy).

discuss

order

rincebrain|2 years ago

ZFS is never overwriting in place in either case, you're just not freeing the old one if it's in a snapshot, and a snapshot is just a note that "nickname this point in time 'mysnapshot', and don't clean up anything referenced at this point in time", so it's very cheap to make, and you just check it later when you would be cleaning things up.

viraptor|2 years ago

Does it actually not update in place even for areas with a single reference? I haven't checked the source, but that sounds like fragmentation hell on spinning disks. That would absolutely kill the performance on zfs-hosted VM images / databases, which I didn't think actually happens... (Apart from the intent log, which sure, that's append only)

boomboomsubban|2 years ago

There's no copy operation, the previous data isn't overwritten and the new data is written to a new block. It's "copy-on-write."