convoy
convoy copied to clipboard
sync() and fsfreeze() when creating a snapshot
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.
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!
I have something working ... I'll generate a PR request momentarily.
thanks! @peebles
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?
That's very reasonable. I thought it was only for EBS, but it's nice to have sync()
for VFS as well.