convoy icon indicating copy to clipboard operation
convoy copied to clipboard

sync() and fsfreeze() when creating a snapshot

Open peebles opened this issue 8 years ago • 5 comments

Inspired by the ec2-consistent-snapshot project, I wonder if, when creating snapshots, it'd be nice to run sync() and fsfreeze() before creating the snapshot, and then unfreezing. I am tempted to create a pull request for this, if anyone thinks this is useful or even necessary in the context of docker volume plugins. Please advise.

peebles avatar Feb 21 '17 02:02 peebles

It's really interesting. I think it's useful. It makes EBS snapshots to be application consistency instead of crash consistency. A PR will definitely be welcome!

yasker avatar Mar 01 '17 00:03 yasker

I have something working ... I'll generate a PR request momentarily.

peebles avatar Mar 01 '17 01:03 peebles

thanks! @peebles

yasker avatar Mar 01 '17 01:03 yasker

By the way ... sync() and fsfreeze() for for EBS driver. For VFS, fsfreeze() does not work... I guess that isn't supposed to work with NFS mounted file systems. I haven't found any alternatives. So for VFS I'll just sync(). For device mapper it seems neither sync() or fsfreeze() are appropriate as device mapper natively supports snapshots with suspends.

So I think I'll hard code the sync() into VFS and EBS, and I'll make fsfreeze() a driver option for EBS, false by default. What do you think?

peebles avatar Mar 01 '17 01:03 peebles

That's very reasonable. I thought it was only for EBS, but it's nice to have sync() for VFS as well.

yasker avatar Mar 01 '17 01:03 yasker