1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

Add initdb --sync-only option to sync the data directory to durable

storage.

Have pg_upgrade use it, and enable server options fsync=off and
full_page_writes=off.

Document that users turning fsync from off to on should run initdb
--sync-only.

[ Previous commit was incorrectly applied as a git merge. ]
This commit is contained in:
Bruce Momjian
2012-12-03 22:47:59 -05:00
parent 25d1ed04a2
commit 630cd14426
5 changed files with 47 additions and 5 deletions

View File

@@ -1696,6 +1696,15 @@ include 'filename'
turning off <varname>fsync</varname>.
</para>
<para>
For reliable recovery when changing <varname>fsync</varname>
off to on, it is necessary to force all modified buffers in the
kernel to durable storage. This can be done while the cluster
is shutdown or while fsync is on by running <command>initdb
--sync-only</command>, running <command>sync</>, unmounting the
file system, or rebooting the server.
</para>
<para>
In many situations, turning off <xref linkend="guc-synchronous-commit">
for noncritical transactions can provide much of the potential

View File

@@ -244,6 +244,17 @@ PostgreSQL documentation
</listitem>
</varlistentry>
<varlistentry>
<term><option>-S</option></term>
<term><option>--sync-only</option></term>
<listitem>
<para>
Safely write all database files to disk and exit. This does not
perform any of the normal <application>initdb</> operations.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-T <replaceable>CFG</></option></term>
<term><option>--text-search-config=<replaceable>CFG</></option></term>