Date: Tue, 13 May 2008 15:48:31 +0100 From: Pete French <petefrench@ticketswitch.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/123630: gmirror doesnt allow the original drive to be preferred (patch included) Message-ID: <E1Jvvnr-0008y4-Fo@dilbert.ticketswitch.com> Resent-Message-ID: <200805131450.m4DEo2N9009953@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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 13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