[DRBD-user] Clarification on barriers vs flushes

Gionatan Danti g.danti at assyoma.it
Tue Sep 26 23:01:33 CEST 2017

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


Hi list,
I would like to have a clarification how barriers and flushes work to 
preserve write ordering.

 From my understanding, two main methods exists to preserve write order 
and to force data to stable storage:
1) write barriers, which are expanded in buffer-draining cache flush -> 
write -> cache flush operations;
2) FUAs, which can *possibly* (depending on the underlying disk *and* 
kernel version/bootparams) be expanded in non-draining cache flush -> 
write w/FUA bit operations.

However, from drbd.conf man page I read the following:

barrier:
The first requires that the driver of the backing storage device support 
barriers (called 'tagged command queuing' in SCSI and 'native command 
queuing' in SATA speak). The use of this method can be enabled by 
setting the disk-barrier options to yes.

flush:
The second requires that the backing device support disk flushes (called 
'force unit access' in the drive vendors speak). The use of this method 
can be disabled setting disk-flushes to no.

This seems confusing: write barriers do not depend on TCQ/NCQ/FUAs, 
rather on the CACHE_FLUSH ATA/SCSI command. On the other hand, "flush" 
seems to really refer to FUAs which, in turn, depend on NCQ (which are 
only mentioned in the "barrier" paragraph).

So, is the man page outdated, or I am missing something? Which is the 
safest method? Morever, as many kernels disable FUAs on SATA disks 
(transforming FUAs in drain + cache flushes), does the two setting 
really made any difference?

Thanks.

-- 
Danti Gionatan
Supporto Tecnico
Assyoma S.r.l. - www.assyoma.it
email: g.danti at assyoma.it - info at assyoma.it
GPG public key ID: FF5F32A8



More information about the drbd-user mailing list