Date: Sat, 14 Jan 2006 06:23:51 -0600 From: Eric Anderson <anderson@centtech.com> To: user <user@dhp.com> Cc: freebsd-fs@freebsd.org Subject: Re: preventing deadlocks in snapshot directories - unexplained Message-ID: <43C8ED57.4070605@centtech.com> In-Reply-To: <Pine.LNX.4.21.0601131751230.8684-100000@shell.dhp.com> References: <Pine.LNX.4.21.0601131751230.8684-100000@shell.dhp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
user wrote: > 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. > The second lag you are talking about is when writes are suspended to that particular filesystem, which is so brief, it's unlikely you noticed it. > 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... > I'm not certain why it hangs for you - seems like I've been through this, and I could do some testing also next week. Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43C8ED57.4070605>