From owner-freebsd-fs@FreeBSD.ORG Sat Jan 14 12:23:54 2006 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 666F416A41F for ; Sat, 14 Jan 2006 12:23:54 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from mh2.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C019443D45 for ; Sat, 14 Jan 2006 12:23:53 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [192.168.42.25] ([192.168.42.25]) by mh2.centtech.com (8.13.1/8.13.1) with ESMTP id k0ECNpAd035802; Sat, 14 Jan 2006 06:23:51 -0600 (CST) (envelope-from anderson@centtech.com) Message-ID: <43C8ED57.4070605@centtech.com> Date: Sat, 14 Jan 2006 06:23:51 -0600 From: Eric Anderson User-Agent: Thunderbird 1.5 (X11/20060112) MIME-Version: 1.0 To: user References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1241/Sat Jan 14 04:00:03 2006 on mh2.centtech.com X-Virus-Status: Clean Cc: freebsd-fs@freebsd.org Subject: Re: preventing deadlocks in snapshot directories - unexplained X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2006 12:23:54 -0000 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. ------------------------------------------------------------------------