pgsql: Improve copydir() code for the case that fsync is off.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve copydir() code for the case that fsync is off.
Date: 2012-07-22 00:10:38
Message-ID: E1Ssjks-0001TV-72@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve copydir() code for the case that fsync is off.

We should avoid calling sync_file_range or posix_fadvise in this case,
since (a) we don't really care if the data gets synced, and might as
well save the kernel calls; (b) at least on Linux we know that the
kernel might block us until it's scheduled the write.

Also, avoid making a useless second traversal of the directory tree
if we're not actually going to call fsync(2) after all.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2d46a57ddcad394e514bbefb193a4a03e766f163

Modified Files
--------------
src/backend/storage/file/copydir.c | 8 ++++++--
src/backend/storage/file/fd.c | 14 +++++++++-----
2 files changed, 15 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-07-22 04:01:59 pgsql: Fix name collision between concurrent regression tests.
Previous Message Tom Lane 2012-07-21 23:56:34 pgsql: Use --nosync during make check's initdb call.