pgsql: Don't use O_DIRECT when writing WAL files if archiving or

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Don't use O_DIRECT when writing WAL files if archiving or
Date: 2010-02-19 10:51:04
Message-ID: 20100219105104.4095B7541C5@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2010-02-19 10:51:14 Re: Re: [COMMITTERS] pgsql: Introduce WAL records to log reuse of btree pages, allowing
Previous Message David Fetter 2010-02-19 07:02:04 Re: pgsql: First pass over client applications documentation proofreading.