From owner-freebsd-stable@FreeBSD.ORG Fri May 20 07:34:03 2011 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B66C106566B for ; Fri, 20 May 2011 07:34:03 +0000 (UTC) (envelope-from luke@digital-crocus.com) Received: from mail.digital-crocus.com (node2.digital-crocus.com [91.209.244.128]) by mx1.freebsd.org (Postfix) with ESMTP id D8C0E8FC15 for ; Fri, 20 May 2011 07:34:02 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=dkselector; d=hybrid-logic.co.uk; h=Received:Received:Subject:From:Reply-To:To:Cc:In-Reply-To:References:Content-Type:Organization:Date:Message-ID:Mime-Version:X-Mailer:Content-Transfer-Encoding:X-Spam-Score:X-Digital-Crocus-Maillimit:X-Authenticated-Sender:X-Complaints:X-Admin:X-Abuse; b=d0mcOa1u2QgXRjvyWz6+eno2A1/wjZ3bTimGKn2noZcz9PHFAyDLkM85fSBsGf9peULL2JsyWVKaIjpWvn5yl53buIjQI/UQyor8ECCTGFpcydXi7qVZOY3iL+9qmNzk; Received: from luke by mail.digital-crocus.com with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QNKD0-00033y-04 for stable@freebsd.org; Fri, 20 May 2011 08:33:18 +0100 Received: from [109.107.35.48] (helo=[IPv6:::1]) by mail.digital-crocus.com with esmtpa (Exim 4.69 (FreeBSD)) (envelope-from ) id 1QNKCz-00033R-KX; Fri, 20 May 2011 08:33:17 +0100 From: Luke Marsden To: Borja Marcos In-Reply-To: References: <20110517073029.GA44359@icarus.home.lan> <4DD25264.8040305@FreeBSD.org> <20110517112952.GA48610@icarus.home.lan> Content-Type: text/plain; charset="UTF-8" Organization: Hybrid Web Cluster Date: Fri, 20 May 2011 08:33:59 +0100 Message-ID: <1305876839.13971.5.camel@pow> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.0 X-Digital-Crocus-Maillimit: done X-Authenticated-Sender: luke X-Complaints: abuse@digital-crocus.com X-Admin: admin@digital-crocus.com X-Abuse: abuse@digital-crocus.com (Please include full headers in abuse reports) Cc: Charles Sprickman , stable@FreeBSD.org, Andriy Gapon , Jeremy Chadwick Subject: Re: 8.1R possible zfs snapshot livelock? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: luke@hybrid-logic.co.uk List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2011 07:34:03 -0000 On Wed, 2011-05-18 at 14:05 +0200, Borja Marcos wrote:=20 > On May 17, 2011, at 1:29 PM, Jeremy Chadwick wrote: >=20 > > * ZFS send | ssh zfs recv results in ZFS subsystem hanging; > 8.1-RELEASE; > > February 2011: > > > http://lists.freebsd.org/pipermail/freebsd-fs/2011-February/010602.html >=20 > I found a reproducible deadlock condition actually. If you keep some > I/O activity on a dataset on which you are receiving a ZFS incremental > snapshot at the same time, it can deadlock. >=20 > Imagine this situation: Two servers, A and B. A dataset on server A is > replicated at regular intervals to B, so that you keep a reasonably up > to date copy. >=20 > Something like: >=20 > (Runnning on server A): >=20 > zfs snapshot thepool/thedataset@thistime > zfs send -Ri thepooll/thedataser@previoustime > hepool/thedataset@thistime | ssh serverB zfs receive -d thepool >=20 > It works, but I suffered a deadlock when one of the periodic "daily" > scripts was running. Doing some tests, I saw that ZFS can deadlock if > you do a zfs receive onto a dataset which has some read activity. > Disabling atime didn't help either. >=20 > But if you make sure *not* to access the replicated dataset it works, > I haven=C2=B4t seen it failing otherwise.=20 >=20 > If you wish to reproduce it, try creating a dataset for /usr/obj, > running make buildworld on it, replicating at, say, 30 or 60 second > intervals, and keep several scripts (or rsync) reading the target > dataset files and just copying them to another place in the usual, > "classic" way. (example: tar cf - . | ( cd /destination && tar xf -) >=20 Is there a PR for this? I'd like to see it addressed, since read-only I/O on a dataset which is being updated by `zfs recv` is an important part of what we plan to do with ZFS on FreeBSD. --=20 Best Regards, Luke Marsden CTO, Hybrid Logic Ltd. Web: http://www.hybrid-cluster.com/ Hybrid Web Cluster - cloud web hosting Phone: +447791750420