[DRBD-user] Automatically reconnect secondary as primary when primary is lost during sync

Robert Altnoeder robert.altnoeder at linbit.com
Wed Dec 13 10:11:28 CET 2017

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

On 12/12/2017 05:37 PM, Sam Gardner wrote:
> Suppose I have two DRBD devices separately provisioned as Primary.
> When the second node connects, it syncs the data from the first
> (primary/master) node.
> During this sync, the Primary/SyncSource node loses power.
At this point, the data on the SyncTarget is in an inconsistent state,
so DRBD cannot use it as a SyncSource.
> Is there an automatic split brain recovery method that will allow us
> to recover from this scenario? Everything I have tried results in the
> second node becoming primary (good)
which is kind of interesting, because if you did not force it into the
Primary role, it should be showing a disk state of Inconsistent and
would normally refuse to change to the Primary role
> It's easy enough to manually recover from this but I'm looking for an
> automatic recovery
The other node being in the Primary role again implies that you had
previously forced its disk state to become UpToDate, and then, whenever
the other node reconnects in the Secondary role, the "after-sb-1pri
discard-secondary" rule should do what you want
> I /don't/ care about the original data (it's just used as a sort of
> shared cache that we can live with being empty), so something that
> lets the original node reconnect as Secondary with an empty dataset is
> fine.
That's a prerequisite for doing something like that, because the data
will be a total chaos after that procedure. Also, there should not be
any normal filesystem on the replicated device, as such a filesystem
would possibly be left in an unrecoverable state. You really need to
have some kind of specialized application that can deal with whatever
inconsistent data it finds on the device, and if that is the case, the
procedure outlined above should work.

best regards,
Robert Altnoeder
+43 1 817 82 92 0
robert.altnoeder at linbit.com

LINBIT | Keeping The Digital World Running
DRBD - Corosync - Pacemaker
f /  t /  in /  g+

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.

More information about the drbd-user mailing list