junneyang / zumastor

Automatically exported from code.google.com/p/zumastor
0 stars 1 forks source link

"ddsnap create" freezes an unclean FS #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
"ddsnap create" doesn't freeze the FS before taking the snapshot.

That results in the FS being unclean. For instance, with ext3, that means
that upon mounting the snapshot has to be written to for the FS to be
fixed. And if the snapshot is read-only, that means that you won't be able
to mount the snapshot.

Example dmesg:

With a dmsetup create -r

ddsnap_create: Created snapshot device snapstore=253:2 origin=253:0
socket=/dev/ddsnap/control snapshot=1
incoming: Client thread started, pid=10056 for snapshot 1
worker: Worker thread started, pid=10057 for snapshot 1
worker: worker recovering for snapshot 1
control: Control thread started, pid=10058 for snapshot 1
requeue_queries:
worker: worker resuming for snapshot 1
incoming: identify succeeded. chunksize 12
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access unavailable, cannot proceed.

Without the -r, mounting the FS read-only:

EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: dm-21: orphan cleanup on readonly fs
ext3_orphan_cleanup: deleting unreferenced inode 224436
ext3_orphan_cleanup: deleting unreferenced inode 224428
ext3_orphan_cleanup: deleting unreferenced inode 224422
ext3_orphan_cleanup: deleting unreferenced inode 224414
[...]

That kind of problem doesn't occur when one uses LVM snapshots
instead of ddsnap snapshots.

This is because I beleive lvm does suspend (and request the
overlying FS to sync) the original device before taking the
snashot.

I guess I could do that using dmsetup with ddsnap, but that
means I would have to put dmsetup, a shell, ddsnap onto a tmpfs
to avoid deadlocks since I'm ddsnapping the rootfs.

Couldn't ddsnap be modified so that it does something similar to
what lvm does (suspend, snap, resume) under mlock?

Original issue reported on code.google.com by s.chaze...@gmail.com on 12 May 2008 at 6:29

GoogleCodeExporter commented 9 years ago
We talked about this, and the consensus was that we could
put direct calls to dm's api in ddsnap to do this.
(Calling dm setup from zumastor script makes us nervous,
might require too much I/O.)

Original comment by daniel.r...@gmail.com on 14 May 2008 at 6:50

GoogleCodeExporter commented 9 years ago
This is a dup of issue 33.

Original comment by daniel.r...@gmail.com on 14 May 2008 at 6:55