From owner-freebsd-bugs@FreeBSD.ORG Tue May 13 14:50:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C0501065689 for ; Tue, 13 May 2008 14:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE398FC34 for ; Tue, 13 May 2008 14:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m4DEo2AZ009954 for ; Tue, 13 May 2008 14:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m4DEo2N9009953; Tue, 13 May 2008 14:50:02 GMT (envelope-from gnats) Resent-Date: Tue, 13 May 2008 14:50:02 GMT Resent-Message-Id: <200805131450.m4DEo2N9009953@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Pete French Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5B9E106566C for ; Tue, 13 May 2008 14:48:32 +0000 (UTC) (envelope-from petefrench@ticketswitch.com) Received: from angel.ticketswitch.com (angel.ticketswitch.com [IPv6:2002:57e0:1d4e::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6F6DC8FC14 for ; Tue, 13 May 2008 14:48:32 +0000 (UTC) (envelope-from petefrench@ticketswitch.com) Received: from [10.50.50.2] (helo=smaug.rattatosk) by angel.ticketswitch.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Jvvnr-0003UA-JC for FreeBSD-gnats-submit@freebsd.org; Tue, 13 May 2008 15:48:31 +0100 Received: from dilbert.rattatosk ([10.50.50.6] helo=dilbert.ticketswitch.com) by smaug.rattatosk with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Jvvnr-0004Wi-Gc for FreeBSD-gnats-submit@freebsd.org; Tue, 13 May 2008 15:48:31 +0100 Received: from petefrench by dilbert.ticketswitch.com with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Jvvnr-0008y4-Fo for FreeBSD-gnats-submit@freebsd.org; Tue, 13 May 2008 15:48:31 +0100 Message-Id: Date: Tue, 13 May 2008 15:48:31 +0100 From: Pete French To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/123630: gmirror doesnt allow the original drive to be preferred (patch included) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pete French List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2008 14:50:02 -0000 >Number: 123630 >Category: kern >Synopsis: gmirror doesnt allow the original drive to be preferred (patch included) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 13 14:50:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Pete French >Release: FreeBSD 7.0-STABLE amd64 >Organization: TicketSwitch Ltd >Environment: System: FreeBSD dilbert.rattatosk 7.0-STABLE FreeBSD 7.0-STABLE #1: Thu May 8 12:21:45 BST 2008 petefrench@dilbert.rattatosk:/usr/obj/usr/src/sys/GENERIC amd64 >Description: When creating a gmirror the discs are always given priorities starting at zero and increasing. This means that any additional drives added to a mirror must always have a higher priority than the original, as a priority less than zero is not allowed. The 'prefer' load balancing algorithm will use the highest priority drive for reads, and hence it is not possible to add additional drives to a mirror whilst keeping reads to the original drive. This is a problem when a remote drive is added to a mirror, as for performance reasons reads should be restricted to the local drive. Mirroring a local and remote pair of drives is a setup useful for redundancy purposes. >How-To-Repeat: >Fix: The following patch addresses this problem in two ways. Firstly it changes the default priority to 128 (and upward). This allows new drives to be added to the array at a lower priority than the existing drive. This is a very simple change. Secondly the patch implements a new load balancing algorithm called 'prefer-low'. This acts exactly as 'prefer ' except that it uses the lowest priority drive. As the load balancing algorithm may be changed on an existing array, it thus allows the preferred drive to be changed at runtime. This is a slightly more complex patch as it converts the list of drives to a tailq so that it can be traversed backwards. Path is included uuencoded belo. This is relative to 7.0 and works on 7-stable as of today (May 13th). I have tested this on my local system very thoroughly. begin 644 gmirror.patch.gz M'XL("",/(T@"`V=M:7)R;W(N<&%T8V@`W3O[4]M(TC_+?\6$JRQV;($D/P!S MX5L6G,1U8/:,DTV^U%0DW'?+?N@4A%H>GJF M>_H]+"P`_X&YU^/S(1>B?` MBBS+^Z&6-$4YD96VK+:9IG:U=E?M'"GQ#ZLKJJ)4ZO7ZSEM`A*>(4#EE:@NP M=9O-%83??\_DUDGCA-7Y_]]_7V$5%D9&Y)C,G!D!ICPS4\T_[\?^PU M.P@7KA,=-)CI>Q-GN@SL_+#G>_;!>8+%\:*Y\4V/!*;0=4P;P%K*62>+(GXO MJ^<5N3C5\4([B/1%X``[HT<`4\XK]>U0JG9ZGB'HB^]8C-BCSPW'JX91L#0C M-C4C5P_LG]DK^*_!EE[H3#W;8A/7F(:U\]+YAADY7XS(+L4!A4$Y M'LRE&]8N!=M/^&!H5M2.KFJRI3#WM-I6N MEE=490?-SR)+M+[=5=2NTBK5>E5MH]K3`T7SJ!^QJSFI:85=!39(-S.$O(/H MC&8V\P,+1,N?@.+.%Z#G7A0R!_[!'T%D>%&#C6W30%$T4I##C"0"\-@(0;=\ MCSDP>>&'3N3X7D6&(S2"R/&F;!+X)QRG@QMPZ*U MH_)%7?\KKNGZAG64L#!>9.OLXI:!Y!P*&=!7ZEO1A'/#=?-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