postgresql/src/include
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 Tighten up includes in sinvaladt.h, twophase.h, proc.h 2012-06-25 18:40:40 -04:00
bootstrap Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
catalog Add array_remove() and array_replace() functions. 2012-07-11 13:59:35 -04:00
commands Have REASSIGN OWNED work on extensions, too 2012-07-03 15:09:59 -04:00
datatype Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
executor Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
foreign Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
lib Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
libpq Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
mb Fix bogus macro definition. 2012-07-10 22:36:11 -04:00
nodes Fix memory leak in ARRAY(SELECT ...) subqueries. 2012-06-21 17:27:19 -04:00
optimizer Fix planner to pass correct collation to operator selectivity estimators. 2012-07-08 23:51:08 -04:00
parser Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
port Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
portability Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
postmaster Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
regex Re-implement extraction of fixed prefixes from regular expressions. 2012-07-10 14:54:37 -04:00
replication Make walsender more responsive. 2012-07-02 09:41:01 -04:00
rewrite Prevent CREATE TABLE LIKE/INHERITS from (mis) copying whole-row Vars. 2012-06-30 16:45:14 -04:00
snowball Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
storage When LWLOCK_STATS is defined, count spindelays. 2012-06-26 16:06:07 -04:00
tcop Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
tsearch Replace int2/int4 in C code with int16/int32 2012-06-25 01:51:46 +03:00
utils Add array_remove() and array_replace() functions. 2012-07-11 13:59:35 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
Makefile Fix server header file installation with vpath builds 2011-11-10 20:52:54 +02:00
c.h Replace int2/int4 in C code with int16/int32 2012-06-25 01:51:46 +03:00
fmgr.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
funcapi.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
getaddrinfo.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
getopt_long.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
miscadmin.h Do stack-depth checking in all postmaster children. 2012-04-08 19:07:55 +03:00
pg_config.h.in Add fsync capability to initdb, and use sync_file_range() if available. 2012-07-13 17:16:58 -04:00
pg_config.h.win32 Add fsync capability to initdb, and use sync_file_range() if available. 2012-07-13 17:16:58 -04:00
pg_config_manual.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pg_trace.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
pgstat.h Unify calling conventions for postgres/postmaster sub-main functions 2012-06-25 21:30:12 +03:00
pgtime.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
port.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
postgres.h Run pgindent on 9.2 source tree in preparation for first 9.3 2012-06-10 15:20:04 -04:00
postgres_ext.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
postgres_fe.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
rusagestub.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
windowapi.h Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00