On 15/06/11 8:30 AM, Simon Walter wrote:
> On 06/15/2011 09:01 PM, Toby Thain wrote:
>>>> I know I've certainly had many situations where people wanted to
>>>> snapshot or
>>>> rev individual files everytime they're modified.  As I said - perfect
>>>> example is Google Docs.  Yes it is useful.  But no, it's not what ZFS
>>>> does.
>>> Exactly versions of a whole file, but that is different to a snapshot on
>>> every write.
>>>
>>> How you interpret "on every write" depends on where in the stack you are
>>> coming from.  If you think about an application a "write" is whey you
>>> save the document but at the ZPL layer that is multiple write(2) calls
>>> and maybe even some rename(2)/unlink(2)/close(2) calls as well.
>> That's one big problem with the naive plan of using snapshots.
>>
>> Another one is that snapshots are per-filesystem, while the intention
>> here is to capture a document in one user session. Taking a snapshot
>> will of course say nothing about the state of other user sessions. Any
>> document in the process of being saved by another user, for example,
>> will be corrupt.
> 
> Would it be? I think that's pretty lame for ZFS to corrupt data. 

ZFS isn't corrupting anything (Michael is correct, "inconsistent" would
have been a better word). The inevitable inconsistency *from the
application's perspective* results from the error of thinking a snapshot
is automagically correct for document sessions (which are not aware of
what happens at levels underneath).

Likewise, you can backup your RDBMS with tar, if you like, but the
result may not have integrity from the database's point of view. (Same
applies to filesystem backups with dd, etc, etc).


> If I
> were to manually create a snapshot and two users were writing to the FS,
> how would ZFS handle that? Are you saying it would corrupt the data? I
> thought snapshots could be taken regardless of if there is activity.

Of course they can, but (as Jim explains) this cannot guarantee
consistency on higher levels without *interacting* with higher levels
(for example, quiescing a database, or fully flushing a document).

> 
> If I monitor (via Dtrace?) for what equates to a "save", would that be
> sufficient? 

Darren explained some reasons why this may not be trivial.

> If It's particular sequence, then should it not be able to
> be monitored for? Since it is a NAS, only one or two daemons will be
> writing to the particular FS. I can get expected behaviour from these
> daemons.
> 
> If it really is a retarded idea, at least with the current FSs
> available, 

It's not a fault of the filesystem. It's just an architectural problem
to solve, most likely on a different layer.

--Toby

> then I'll just use SVN and manage the repos somehow. I just
> thought I'd see if it's an option.
> 
> Anyone know how Google Docs does it?
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
> 

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to