From owner-freebsd-fs@FreeBSD.ORG Thu Sep 3 12:44:12 2009 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0625F1065692 for ; Thu, 3 Sep 2009 12:44:12 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id 544898FC0C for ; Thu, 3 Sep 2009 12:44:10 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 8C1CA45CAC; Thu, 3 Sep 2009 14:44:08 +0200 (CEST) Received: from localhost (pdawidek.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 849B045C89; Thu, 3 Sep 2009 14:44:03 +0200 (CEST) Date: Thu, 3 Sep 2009 14:44:07 +0200 From: Pawel Jakub Dawidek To: Mel Flynn Message-ID: <20090903124407.GJ1821@garage.freebsd.pl> References: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CxDuMX1Cv2n9FQfo" Content-Disposition: inline In-Reply-To: <200909030000.11961.mel.flynn+fbsd.fs@mailing.thruhere.net> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-fs@FreeBSD.org, freeebsd-geom@FreeBSD.org Subject: Re: Patch to allow gmirror to set priority of a disk 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: Thu, 03 Sep 2009 12:44:12 -0000 --CxDuMX1Cv2n9FQfo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 03, 2009 at 12:00:11AM +0200, Mel Flynn wrote: > Hi, >=20 > I've created a patch that allows gmirror to set the priority of a disk. I= 've=20 > needed this feature so I can signal which disk is the "master" on the nex= t=20 > reboot and also because insertion of a 3rd disk comes with the same prior= ity=20 > as the master disk. >=20 > Some background about the first issue: I've got one system that gets READ= _DMA=20 > errors and then dumps the disk out of the mirror. I believe it is NOT rel= ated=20 > to disk errors, but rather to IDE/Motherboard bandwidth (SMART doesn't sh= ow=20 > any errors and the READ_DMA errors are scattered amongst LBA blocks, no= =20 > WRITE_DMA errors ever, never got SATA disks to work on this mobo and last= but=20 > not least it only happens when IO is high, like daily backup with dump -C= =20 > 20M). > Which disk gets thrown out, is random and the last time that happened I= =20 > rebooted since I needed a new kernel anyway and the wrong disk was consid= er=20 > master. This is a side-effect of me having to do several: > gmirror forget gm0 > gmirror insert gm0 adX >=20 > during an uptime sequence. As a result, both disks have the same priority. >=20 > Unfortunately, due to geographic relocation, I no longer have physical ac= cess=20 > to the machine, so I have only compile tested this patch, but I wanted to= get=20 > some feedback about it: > - Have I made some mistakes that would trash my mirror? ;) > - Is there any desire to have this feature other then my own? > - Any style issues? Thank you for working on this, this is a long missing bit, although I've some comments. You assume that you can write to the mirror component, so you also assume that your mirror if offline, because if it would be online you won't be able to write to one of its components. If your mirror is offline, you can just 'gmirror label' the components again. It won't touch your data and this way you will have your priorities set properly. So what we need more is to be able to change priority of a mirror component which is part of an online mirror, so we need to comunicate with the kernel. Would you like to implement this functionality this way? I'd suggest doing this not as separate gmirror(8) subcommand, but as an extension to 'configure' subcommand, where one can provide priority by giving '-p' argument. PS. In case of 'gmirror insert' you already can change the priority with the '-p' option. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --CxDuMX1Cv2n9FQfo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKn7oXForvXbEpPzQRAl79AJ4lnFGlRTEtrSdtvxTaGzI1TfTztQCeLXHw 5IXMMt6npggy1hh2wmxdrk4= =7oeb -----END PGP SIGNATURE----- --CxDuMX1Cv2n9FQfo--