postgresql/src/backend
Tom Lane b966dd6c42 Add fsync capability to initdb, and use sync_file_range() if available.
Historically we have not worried about fsync'ing anything during initdb
(in fact, initdb intentionally passes -F to each backend launch to prevent
it from fsync'ing).  But with filesystems getting more aggressive about
caching data, that's not such a good plan anymore.  Make initdb do a pass
over the finished data directory tree to fsync everything.  For testing
purposes, the -N/--nosync flag can be used to restore the old behavior.

Also, testing shows that on Linux, sync_file_range() is much faster than
posix_fadvise() for hinting to the kernel that an fsync is coming,
apparently because the latter blocks on a rather small request queue while
the former doesn't.  So use this function if available in initdb, and also
in the backend's pg_flush_data() (where it currently will affect only the
speed of CREATE DATABASE's cloning step).

We will later make pg_regress invoke initdb with the --nosync flag
to avoid slowing down cases such as "make check" in contrib.  But
let's not do so until we've shaken out any portability issues in this
patch.

Jeff Davis, reviewed by Andres Freund
2012-07-13 17:16:58 -04:00
..
access Cosmetic cleanup of ginInsertValue(). 2012-07-13 11:37:39 -04:00
bootstrap Remove misplaced sanity check from heap_create(). 2012-06-14 09:58:53 -04:00
catalog Run updated copyright.pl on HEAD and 9.2 trees, updating the psql 2012-07-06 12:28:18 -04:00
commands Skip text->binary conversion of unnecessary columns in contrib/file_fdw. 2012-07-12 16:26:59 -04:00
executor Fix memory leak in ARRAY(SELECT ...) subqueries. 2012-06-21 17:27:19 -04:00
foreign Add GetForeignColumnOptions() to foreign.c, and add some documentation. 2012-03-07 18:20:58 -05:00
lib Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
libpq Remove duplicate, unnecessary, variable declaration 2012-07-04 16:17:30 +02:00
main Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
nodes Suppress compiler warnings in readfuncs.c. 2012-06-30 22:27:49 -04:00
optimizer Refactor pattern_fixed_prefix() to avoid dealing in incomplete patterns. 2012-07-09 23:22:55 -04:00
parser Reduce messages about implicit indexes and sequences to DEBUG1. 2012-07-04 20:35:29 -04:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Remove misleading hints about reducing the System V request size. 2012-07-03 10:07:47 -04:00
postmaster Remove support for using wait3() in place of waitpid(). 2012-07-05 14:00:40 -04:00
regex Re-implement extraction of fixed prefixes from regular expressions. 2012-07-10 14:54:37 -04:00
replication Always treat a standby returning an an invalid flush location as async 2012-07-04 15:14:42 +02:00
rewrite Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:45:14 -04:00
snowball Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
storage Add fsync capability to initdb, and use sync_file_range() if available. 2012-07-13 17:16:58 -04:00
tcop Make UtilityContainsQuery recurse until it finds a non-utility Query. 2012-06-27 23:18:30 -04:00
tsearch Replace int2/int4 in C code with int16/int32 2012-06-25 01:51:46 +03:00
utils Avoid extra newlines in XML mapping in table forest mode 2012-07-12 23:52:50 +03:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile Fix incorrect make maintainer-clean rule. 2012-04-07 18:16:50 -04:00
nls.mk Sort file list when creating gettext-files 2011-12-27 20:20:56 +02:00