Patch to allow gmirror to set priority of a disk

Pawel Jakub Dawidek pjd at FreeBSD.org
Thu Sep 3 12:44:12 UTC 2009


On Thu, Sep 03, 2009 at 12:00:11AM +0200, Mel Flynn wrote:
> Hi,
> 
> I've created a patch that allows gmirror to set the priority of a disk. I've 
> needed this feature so I can signal which disk is the "master" on the next 
> reboot and also because insertion of a 3rd disk comes with the same priority 
> as the master disk.
> 
> Some background about the first issue: I've got one system that gets READ_DMA 
> errors and then dumps the disk out of the mirror. I believe it is NOT related 
> to disk errors, but rather to IDE/Motherboard bandwidth (SMART doesn't show 
> any errors and the READ_DMA errors are scattered amongst LBA blocks, no 
> WRITE_DMA errors ever, never got SATA disks to work on this mobo and last but 
> not least it only happens when IO is high, like daily backup with dump -C 
> 20M).
> Which disk gets thrown out, is random and the last time that happened I 
> rebooted since I needed a new kernel anyway and the wrong disk was consider 
> master. This is a side-effect of me having to do several:
> gmirror forget gm0
> gmirror insert gm0 adX
> 
> during an uptime sequence. As a result, both disks have the same priority.
> 
> Unfortunately, due to geographic relocation, I no longer have physical access 
> to the machine, so I have only compile tested this patch, but I wanted to get 
> 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.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20090903/29f05668/attachment.pgp


More information about the freebsd-fs mailing list