[DRBD-user] Data consistency question

Lars Ellenberg lars.ellenberg at linbit.com
Wed Mar 14 14:03:17 CET 2018


On Tue, Mar 13, 2018 at 10:23:25AM +0000, Ondrej Valousek wrote:
> Hi list,
> 
> I have a question regarding filesystem consistency - say I choose
> async protocol (A) and the master peer node crashes fatally in the
> middle of write operation.
>
> The slave peer node will then be outdated, but what happens to the
> filesystem on the top of the replicated block device - will I be able
> to restore data from the outdated peer?
> 
> My understanding is that DRBD completely ignores the filesystem, so
> unless I choose synchronous replication protocol C, filesystem
> corruption can occur on the peer node.
> 
> Am I right?

No.

If you "fatally" lose your primary while the secondary is "sync target,
inconsistent", then yes, you have lost your data.
That's why we have the "before-resync-target" handler, where you could
snapshot the last consistent version of your data, before becoming sync target.

If you "fatally" lose your primary during normal operation
(which is: live replication, no resync),
depending on protocol in use, the disk on the secondary will
possibly not have seen those writes that where still in flight.

Which in "synchronous" mode (protocol C) will be only requests that have
not been completed to upper layers (the file system, the data base, the
VM) yet, so it would look just like a "single system crash".

In "asynchronous" mode (protocol A), that will be a few more requests,
some of which may have already been completed to upper layers.

Clients that have committed a transaction, and already got an
acknowledgement for that, may be confused by the fact that the most
recent few such transactions may have been lost.

That's the nature of "asynchronous" replication here.

Going online with the Secondary now will look just like a "single system
crash", but like that crash would have happened a few requests earlier.

It may miss the latest few updates.
But it will still be consistent.

-- 
: Lars Ellenberg
: LINBIT | Keeping the Digital World Running
: DRBD -- Heartbeat -- Corosync -- Pacemaker

DRBD® and LINBIT® are registered trademarks of LINBIT
__
please don't Cc me, but send to list -- I'm subscribed


More information about the drbd-user mailing list