pgsql: Don't use O_DIRECT when writing WAL files if archiving or - Mailing list pgsql-committers

From heikki@postgresql.org (Heikki Linnakangas)
Subject pgsql: Don't use O_DIRECT when writing WAL files if archiving or
Date
Msg-id 20100219105104.4095B7541C5@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Don't use O_DIRECT when writing WAL files if archiving or streaming is
enabled. Bypassing the kernel cache is counter-productive in that case,
because the archiver/walsender process will read from the WAL file
soon after it's written, and if it's not cached the read will cause
a physical read, eating I/O bandwidth available on the WAL drive.

Also, walreceiver process does unaligned writes, so disable O_DIRECT
in walreceiver process for that reason too.

Modified Files:
--------------
    pgsql/src/backend/access/transam:
        xlog.c (r1.376 -> r1.377)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/transam/xlog.c?r1=1.376&r2=1.377)
    pgsql/src/backend/replication:
        walreceiver.c (r1.4 -> r1.5)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/replication/walreceiver.c?r1=1.4&r2=1.5)
    pgsql/src/include/access:
        xlogdefs.h (r1.25 -> r1.26)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/xlogdefs.h?r1=1.25&r2=1.26)
    pgsql/src/include/replication:
        walreceiver.h (r1.6 -> r1.7)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/replication/walreceiver.h?r1=1.6&r2=1.7)

pgsql-committers by date:

Previous
From: David Fetter
Date:
Subject: Re: pgsql: First pass over client applications documentation proofreading.
Next
From: Robert Haas
Date:
Subject: Re: pgsql: First pass over client applications documentation proofreading.