[DRBD-user] Semantics of oos value, verification abortion

Christoph Lechleitner christoph.lechleitner at iteg.at
Fri Dec 29 00:43:45 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 2017-12-29 00:16, Veit Wahlich wrote:
> Hi again,
> well, O_DIRECT is a Linux specific and only used in very special cases, thus mostly not used by default or at least deactivatable. To be fair, this is not a DRBD problem, but Linux', as it allows user space processes to bypass parts of the kernel for tuning -- you may call it fast path, but actually it is a bypass including side effects. In the past there have even been several discussions in the Linux kernel community on dropping O_DIRECT support (or replacing it by something more sane), but it was kept for what I believe don't-break-the-userland compatibility reasons.

Thanks for the detailed explanation!

> I am quite confident this will only apply to few of your containers. So the actual task is to identify them, which might already been done due to the issues you encountered.

MySQL seems to be an obious suspect.
As are syslog daemons, other loggers, and rsync.
I found O_DIRECT features or discussion about all of those.

> Also I suppose that LXC allows to run a process in some kind of super context, just like Linux VServers/Linux Secure Contexts and OpenVZ does,

Yes, a quick lsof -n 2>/dev/null shows that the host can see all
containers' open files.

LXC is a replacement for VServer (vanilla) or OpenVZ (proprietary) using
newer features like cgroups (and libvirt?).

We have been able to migrate from OpenVZ to LXC practically on the fly,
with only like 3 to 5 minutes downtime per guest system.

> so a process on the host can see all processes from all the contexts at once. So running lsof for diagnostics in this super context should give you a list of all files currently open. Use the +fG option to add a column to the listing that shows all the flags used to open the files -- O_DIRECT is 0x8 and is ORed bitwise to the other flags. You might want to use +fg instead, which decodes the flags, but the decoded flags are abbreviated and I do not know from memory what abbreviation is used for O_DIRECT. 

Very cool, Thanks, will do.

> O_DIRECT might also be safe in combination with O_SYNC, as I suppose O_SYNC to prevent in-flight changes of buffers by blocking writes until data is processed, but that question should be asked to and answered by someone with more Linux kernel (source code) expertise.

I got that impression too (quick look in mangpages), I'll keep that in mind.

Regards, Christoph

More information about the drbd-user mailing list