preventing deadlocks in snapshot directories - unexplained
user
user at dhp.com
Fri Jan 13 14:58:08 PST 2006
On Fri, 13 Jan 2006, Eric Anderson wrote:
> What happens if you do:
>
> rm -f snap_directory1/snapshot
> rmdir snap_directory1
>
> Does the same thing happen?
I will try that as I try to reproduce the problem.
I am aware that there are two "lags" when creating a snapshot - the lock
that occurs in the snapshot directory for the entire course of
creation/destruction, and also a short system-wide lag that occurs for a
small portion of the time of creation/destruction.
It is possible that on a heavily taxed system, the two could be confused
for one another, which is possibly what happened when I noticed the
one-deep directory "locking" when I deleted a two-deep directory snapshot.
I think the main, conceptual question I am asking is this - what is the
difference between these three strategies:
#1:
/.snap/snapshot1
/.snap/snapshot2
/.snap/snapshot3
#2
/.snap/snapdir1/snapshot1
/.snap/snapdir2/snapshot2
/.snap/snapdir3/snapshot3
#3
/.snap/snapshot1
/.snap2/snapshot2
/.snap3/snapshot3
Now, so far in this thread, some have claimed that #2 and #3 are
identical, which seems reasonable. My only problem is that I _think_ I am
seeing problems with #2. We'll see.
However, what about #1 above ? In that case, all of the snapshots are in
one directory, and I feel that this is dangerous, or at least poorly done
- isn't there a very real possibility of a deadlock there, because you
could be creating a snapshot in /.snap at the same time as you delete one
(or create a different one ?)
The man page says nothing about multiple snapshots, etc., and I want to
know if, one way or another, it is a good instinct on my part to make sure
multiple snapshots do not end up in the exact same directory...
thanks.
More information about the freebsd-fs
mailing list