From owner-freebsd-fs@FreeBSD.ORG Tue Nov 20 00:22:14 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AF7ACBE; Tue, 20 Nov 2012 00:22:14 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id EBC5E8FC08; Tue, 20 Nov 2012 00:22:13 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id ABCAD7E820; Tue, 20 Nov 2012 11:14:39 +1100 (EST) Message-ID: <50AACB63.6090608@freebsd.org> Date: Tue, 20 Nov 2012 11:14:27 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121031 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alexander Motin Subject: Re: graid often resyncs raid1 array after clean reboot/shutdown References: <508E0C3F.8080602@freebsd.org> <508E3E81.9010209@FreeBSD.org> <508E49AD.4090501@FreeBSD.org> <508E91CF.5070003@FreeBSD.org> <508F1045.60002@freebsd.org> In-Reply-To: <508F1045.60002@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2012 00:22:14 -0000 On 10/30/12 10:24, Lawrence Stewart wrote: > Hi Alexander, > > On 10/30/12 01:25, Alexander Motin wrote: >> On 29.10.2012 11:17, Alexander Motin wrote: >>> On 29.10.2012 10:29, Alexander Motin wrote: >>>> Hi. >>>> >>>> On 29.10.2012 06:55, Lawrence Stewart wrote: >>>>> I have a fairly new HP Compaq 8200 Elite desktop PC with 2 x 1TB >>>>> Seagate >>>>> ST1000DM003 HDDs in raid1 using the on-board Intel Matrix RAID >>>>> controller. The system is configured to boot from ZFS off the raid1 >>>>> array, and I use it as a KDE GUI (with on-cpu GPU + KMS) desktop. >>>>> >>>>> Everything works great, except that after a "shutdown -r now" of the >>>>> system, graid almost always (I believe I've noted a few times where >>>>> everything comes up fine) detects one of the disks in the array as >>>>> stale >>>>> and does a full resync of the array over the course of a few hours. >>>>> Here's an example of what I see when starting up: >>>> >>>> From log messages it indeed looks like result of unclean shutdown. I've >>>> never seen such problem with UFS, but I never tested graid with ZFS. I >>>> guess there may be some difference in shutdown process that makes RAID >>>> metadata to have dirty flag on reboot. I'll try to reproduce it now. >>> >>> I confirm the problem. Seems it happens only when using ZFS as root file >>> system. Probably ZFS issues some last moment write that makes volume >>> dirty. I will trace it more. >> >> I've found problem in the fact that ZFS seems doesn't close devices on >> shutdown. That doesn't allow graid to shutdown gracefully. r242314 in >> HEAD fixes that by more aggressively marking volumes clean on shutdown. > > Thanks for the quick detective work and fix. I'll merge r242314 back to > my local stable/9 tree and test it. I've rebooted the machine a few times now and the array has been started in optimal state without requiring a rebuild each time. Thanks again for the fix. Cheers, Lawrence