[DRBD-user] disk-barriers - technical Background?

Lars Ellenberg lars.ellenberg at linbit.com
Fri Apr 20 14:06:23 CEST 2012

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


On Fri, Apr 20, 2012 at 01:38:25PM +0200, Lukas Gradl wrote:
> Hi!
> 
> Could someone explain what disk-barriers are and how they work? Or
> is there any document on that topic that I did'nt find so far?
>
> I could find something about turning them on and off and played
> around with them - but nothing on what they really are...


If you don't have volatile write caches in your IO stack ("safe"),
all write caches are either non-existant, disabled,
or battery backed or equivalent,
then barriers may potentially cause performance degradation
(due to unnecessarily triggering cache flushes),
but most of the time not even that.
In any case, on such "safe" setups, barriers can safely be disabled.


If you DO have volatile write caches in your IO stack ("unsafe"),
like RAID controller cache and no batteries,
or the on-disk write caches are enabled,
barriers are essential to be able to do crash recovery
of file system or database journals, or other data
that needs to be stored in a crash safe way.

Barriers (or, FLUSH/FUA requests) are supposed to ensure
that the actual data is written to *stable* storage
before the corresponding commit block is written,
enforcing write-ordering where it matters.

If barriers are disabled on an "unsafe" setup,
hard crashes during IO load will cause data corruption.

DRBD internally uses barriers to ensure
its meta data transactions are on stable storage.


	Lars


> courious,
> 
> Lukas
> 
> 
> -- 
> 
> --------------------------
> software security networks
> Lukas Gradl <proxmox#ssn.at>
> Eduard-Bodem-Gasse 6
> A - 6020 Innsbruck
> Tel: +43-512-214040-0
> Fax: +43-512-214040-21
> --------------------------
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user

-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

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



More information about the drbd-user mailing list