Dick Davies
2007-Oct-08 11:55 UTC
[zfs-discuss] safe zfs-level snapshots with a UFS-on-ZVOL filesystem?
I had some trouble installing a zone on ZFS with S10u4 (bug in the postgres packages) that went away when I used a ZVOL-backed UFS filesystem for the zonepath. I thought I''d push on with the experiment (in the hope Live Upgrade would be able to upgrade such a zone). It''s a bit unwieldy, but everything worked reasonably well - performance isn''t much worse than straight ZFS (it gets much faster with compression enabled, but that''s another story). The only fly in the ointment is that ZVOL level snapshots don''t capture unsynced data up at the FS level. There''s a workaround at: http://blogs.sun.com/pgdh/entry/taking_ufs_new_places_safely but I wondered if there was anything else that could be done to avoid having to take such measures? I don''t want to stop writes to get a snap, and I''d really like to avoid UFS snapshots if at all possible. I tried mounting forcedirectio in the (mistaken) belief that this would bypass the UFS buffer cache, but it didn''t help. -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
Enda O''Connor ( Sun Micro Systems Ireland)
2007-Oct-08 12:27 UTC
[zfs-discuss] safe zfs-level snapshots with a UFS-on-ZVOL filesystem?
Dick Davies wrote:> I had some trouble installing a zone on ZFS with S10u4 > (bug in the postgres packages) that went away when I used a > ZVOL-backed UFS filesystem > for the zonepath. >Hi Out of interest what was the bug. Enda> I thought I''d push on with the experiment (in the hope Live Upgrade > would be able to upgrade such a zone). > It''s a bit unwieldy, but everything worked reasonably well - > performance isn''t much worse than straight ZFS (it gets much faster > with compression enabled, but that''s another story). > > The only fly in the ointment is that ZVOL level snapshots don''t > capture unsynced data up at the FS level. There''s a workaround at: > > http://blogs.sun.com/pgdh/entry/taking_ufs_new_places_safely > > but I wondered if there was anything else that could be done to avoid > having to take such measures? > I don''t want to stop writes to get a snap, and I''d really like to avoid UFS > snapshots if at all possible. > > I tried mounting forcedirectio in the (mistaken) belief that this > would bypass the UFS > buffer cache, but it didn''t help. >
Frank Hofmann
2007-Oct-08 12:35 UTC
[zfs-discuss] safe zfs-level snapshots with a UFS-on-ZVOL filesystem?
On Mon, 8 Oct 2007, Dick Davies wrote:> I had some trouble installing a zone on ZFS with S10u4 > (bug in the postgres packages) that went away when I used a > ZVOL-backed UFS filesystem > for the zonepath. > > I thought I''d push on with the experiment (in the hope Live Upgrade > would be able to upgrade such a zone). > It''s a bit unwieldy, but everything worked reasonably well - > performance isn''t much worse than straight ZFS (it gets much faster > with compression enabled, but that''s another story). > > The only fly in the ointment is that ZVOL level snapshots don''t > capture unsynced data up at the FS level. There''s a workaround at: > > http://blogs.sun.com/pgdh/entry/taking_ufs_new_places_safely > > but I wondered if there was anything else that could be done to avoid > having to take such measures? > I don''t want to stop writes to get a snap, and I''d really like to avoid UFS > snapshots if at all possible.Hmm - "Difficult Problem" (TM :), that is. UFS, by design, isn''t atomic / self-consistent-at-all-times. Not even with UFS logging active, because the latter doesn''t actually log userdata. Which is why establishing a snapshot on UFS, whatever method (and that includes UFS'' fssnap), involves creating a write barrier temporarily. You need to flush all data on UFS, while at the same time blocking updates beyond that point, before UFS (or, if not using fssnap, the admin) can ''signal'' to the lower levels that a snapshot is safe to create now. One could conceive a (relatively small) codechange in UFS that would make this happen under the hood, e.g. in the form of an ioctl - "flush things and signal the ''driver level'' ioctl(SNAP_ENABLE_NOW_SAFE)". But that would, although you would then not issue the "lockfs -w/u" yourself, still involve the temporary write barrier. Just as with fssnap, where this also happens under the hood. Without userdata logging/journaling, it seems pretty difficult to get around that barrier constraint, though if you''d have suggestions as "how to do it in UFS", we should start talking about it. ufs-discuss at opensolaris.org is open :) As said - "Difficult problem".> > I tried mounting forcedirectio in the (mistaken) belief that this > would bypass the UFS > buffer cache, but it didn''t help.Nope, it''s a design issue in UFS; no userdata logging, no point-in-time consistency (for "everything"). FrankH.> > -- > Rasputin :: Jack of All Trades - Master of Nuns > http://number9.hellooperator.net/ > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >