Re: SMP: logging

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Thu, 25 Feb 2010 22:07:18 +0100

ons 2010-02-24 klockan 22:45 +0800 skrev Adrian Chadd:
> On 24 February 2010 18:06, Adrian Chadd <adrian_at_squid-cache.org> wrote:
>
> > Uhm, is O_APPEND defined as an atomic write? I didn't think so. It may
> > be under Linux and it may be under certain FreeBSD versions, but it's
> > likely a side-effect of VFS locking than the actual specification.

To my best knowledge it is.

The wording in SUSv3 (2004) is:

        If the O_APPEND flag of the file status flags is set, the file
        offset shall be set to the end of the file prior to each write
        and no intervening file modification operation shall occur
        between changing the file offset and the write operation.

But I would not be surprised if there is implementations where this
fails..

> .. and it certainly won't be supported for logging-to-NFS.

It will, but not for multiple NFS clients concurrently writing to the
same file as the NFS protocol as such do not support O_APPEND. The
client cache does however so for processes all running on the sane NFS
client it's ok.

> I'd honestly just investigate a logging layer that implements some
> kind of IPC mechanism (sockets, sysvshm, etc) that can handle logs
> from multiple processes.

Such as the daemon layer we already have, or any of the alternate
non-file transports...

Regards
Henrik
Received on Thu Feb 25 2010 - 21:07:26 MST

This archive was generated by hypermail 2.2.0 : Fri Feb 26 2010 - 12:00:16 MST