[Drbd-dev] [PATCH 0/3] Implement {begin|after}-resync-source handlers

Iustin Pop iustin at google.com
Tue May 18 10:52:07 CEST 2010

On Mon, May 17, 2010 at 11:44:40PM +0200, Philipp Reisner wrote:
> Am Montag 17 Mai 2010 14:37:57 schrieb Iustin Pop:
> > These small patches duplicate the resync-target handlers for the other
> > end of the connection.
> >
> Hi Iustin,
> The patches look okay so far, I am considering to apply them
> to our tree.
> * Have you ever considered to use the "drbdsetup events" 
>   interface instead?

Yep, I thought about it, and might use it if the handler method is not
good enough (for whatever reason). But I'd rather like to use the
handlers, since they allow reaction before the actual sync starts, and
thus they eliminate a window of "uncontrolled" syncs (see below why we
want to control them).

> * Are you going to use them in your organisation? 

That too, but better said we're going to use them in Ganeti (opensource,
cluster-based virtualization manager). Background: Ganeti uses only the
low-level drbdsetup interface, and not the drbdadm one, since we manage
the minor numbers assignments dynamically. This dynamic part hits us,
because we cannot make easy 'resync-after' rules (especially as on
bigger Ganeti clusters, like 20-40 nodes, you could get easily into
circular dependencies if you're not careful.

So the plan is to write a custom usermode_helper (right now Ganeti
documentations says to use /bin/true :), so we're not losing any
functionality by moving to a custom helper), that will simply restrict
DRBD to a single sync (either incoming or outgoing) per machine, in
order to not overload any machine's I/O resources. When a begin-sync
request comes in, either source or target, the helper will look if any
other minors are undergoing syncs, and if so will drbdsetup pause-sync
the minor - I hope that this is safe to do from the callback, my few
tests show it so. And when a after-resync-* requests comes, we look if
there are any paused syncs (on our end), and if so then we'll unpause

Now, if drbd (the kernel driver) would have a setting like 'max_syncs',
then we wouldn't have to implement anything in Ganeti, but that is
probably more work in the kernel - which is harder, compared with a
simple userspace shell script.

Hope my explanation makes sense…

More information about the drbd-dev mailing list