atom feed54 messages in org.freebsd.freebsd-currentRFC: Project geom-events
FromSent OnAttachments
Lev SerebryakovOct 4, 2011 11:04 am 
Lev SerebryakovOct 4, 2011 11:08 am 
Freddie CashOct 4, 2011 11:12 am 
Alexander MotinOct 4, 2011 11:28 am 
Garrett CooperOct 4, 2011 12:14 pm 
Lev SerebryakovOct 4, 2011 1:11 pm 
Freddie CashOct 4, 2011 1:16 pm 
Miroslav LachmanOct 4, 2011 2:26 pm 
Alexander MotinOct 4, 2011 2:45 pm 
Andrey V. ElsukovOct 4, 2011 10:06 pm 
Lev SerebryakovOct 4, 2011 11:19 pm 
Lev SerebryakovOct 4, 2011 11:26 pm 
Lev SerebryakovOct 4, 2011 11:39 pm 
Lev SerebryakovOct 4, 2011 11:51 pm 
Andrey V. ElsukovOct 5, 2011 12:51 am 
Miroslav LachmanOct 5, 2011 1:23 am 
Lev SerebryakovOct 5, 2011 1:50 am 
Lev SerebryakovOct 5, 2011 1:58 am 
Alexander MotinOct 5, 2011 2:18 am 
Lev SerebryakovOct 5, 2011 2:29 am 
Miroslav LachmanOct 5, 2011 7:49 am 
Scot HetzelOct 5, 2011 8:11 am 
Alexander MotinOct 5, 2011 2:34 pm 
Miroslav LachmanOct 5, 2011 3:12 pm 
John-Mark GurneyOct 5, 2011 3:53 pm 
Lev SerebryakovOct 5, 2011 11:39 pm 
Lev SerebryakovOct 5, 2011 11:46 pm 
Ivan VorasOct 6, 2011 4:06 am 
Daniel KalchevOct 6, 2011 4:29 am 
Ivan VorasOct 6, 2011 5:36 am 
Daniel KalchevOct 6, 2011 5:42 am 
Miroslav LachmanOct 6, 2011 5:58 am 
Ivan VorasOct 6, 2011 6:43 am 
Lev SerebryakovOct 6, 2011 6:53 am 
Lev SerebryakovOct 6, 2011 6:55 am 
Daniel KalchevOct 6, 2011 6:58 am 
Pieter de GoejeOct 6, 2011 7:03 am 
Andrey V. ElsukovOct 6, 2011 7:40 am 
Lev SerebryakovOct 7, 2011 12:27 am 
per...@pluto.rain.comOct 7, 2011 7:06 am 
Lev SerebryakovOct 7, 2011 12:43 pm 
Daniel KalchevOct 7, 2011 1:13 pm 
Ivan VorasOct 7, 2011 1:22 pm 
Lev SerebryakovOct 8, 2011 1:55 am 
Lev SerebryakovOct 8, 2011 1:56 am 
Lev SerebryakovOct 8, 2011 2:04 am 
per...@pluto.rain.comOct 8, 2011 2:51 am 
Daniel KalchevOct 8, 2011 12:56 pm 
Lev SerebryakovOct 9, 2011 12:29 am 
Lev SerebryakovOct 9, 2011 12:31 am 
Miroslav LachmanOct 9, 2011 6:13 am 
per...@pluto.rain.comOct 9, 2011 6:59 am 
JohnOct 9, 2011 6:26 pm 
per...@pluto.rain.comOct 10, 2011 2:04 am 
Subject:RFC: Project geom-events
From:Lev Serebryakov (le@FreeBSD.org)
Date:Oct 4, 2011 11:04:44 am
List:org.freebsd.freebsd-current

Hello, Freebsd-geom.

I've just committed (a branch with) the project, I worked on for last month (and imagined for last two years).

It is GEOM Events subsystem.

What is it?

We now have pretty impressive set of GEOM modules, which covers many areas: infrastructure support (like geom_part), encryption (like geom_eli) and, what is interesting me most, RAID transformations like geom_stripe, geom_mirror and geom_raid.

One thing is missed from software RAIDs is spare drives and state monitoring (yes, I know, that geom_raid supports spare drivers for metadata formats which supports them, but it not universal solution).

My long-standing dream was to write special daemon for this, but, when I got some time for this project, and started to design, I understood, that we have such daemon: devd(8).

So, here it is. GEOM Events.

Project consists of several parts (all are ready and commited to project branch!):

(1) Simple kernel API, which wraps up devctl_notify() call to unify different GEOM events. Now 4 events are specified:

(a) DISCONNECT -- when GEOM loses (orphans or throw away due to errors) underlying provider.

(b) DESTROY -- when GEOM destorys it provider.

(c) SYNCSTART -- when GEOM starts to synchronizing volume (synchronizing new mirror component or recalculate RAID3/RAID5 checksum)

(d) SYNCSTOP -- wwen GEOM finishes synchronization.

Each event has arguments like class of GEOM, geom itself, provider in question and some others. For details, please, see geom-events(8) man page :)

(2) Simple change in devd(8) config to process events from GEOM system and forward them to geom-events(8) scirpt.

(3) geom-events(8) script which processes these events. It is fully-configurable and could perform these actions in reaction to events:

(a) Replace failed providers with spare ones in case of DISCONNECT events. (b) Log events to syslog(8) with logger(1) (c) Notify administrator (typically -- root) with mail(1).

(4) geom-events needs one small helper binary program: ggetmode(8). ggetmode(8) takes one argument -- provider name -- and prints its access mode, like r1w1e1 or r0w0e0. geom-events(8) script determines is spare provider avail or not, comparing it access mode with "r0w0e0" string.

(5) Changes in all geom classes to post these events.

I've covered all "actual" base classes with some exceptions:

(a) geom_mbr and other old-stlye partition classes is untouched, as they are obsolete now.

(b) geom_vinum is not covered. It is too complex for me, sorry :(

(c) geom_raid is covered, but changes are not trivial ones. It needs review from Alexander Motin. Commit message describes what and why was changed.

I've wrote extensive documentation for all new components -- especially for geom-events(8) script, which is main source of information about this project now.

I've tested all classes in virtual machine, with spare drives and all stuff. Everything work perfectly.

**I really appreciate your comments, and I want to see this project committed to CURRENT and MFCed to 9-STABLE in (near) future.**

Project sources are in "projects/geom-events" SVN branch. All but last commits are organized by component, so you could review only changes in your part of tree.

http://svnweb.freebsd.org/base/projects/geom-events/

This branch contains fix from kern/160562, to make raid3 spare drives work.

Patch against CURRENT is attached.

Thank you.