Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf72a342

Browse files
committed
Copy-editing for recent documentation changes relevant to WAL,
full_page_writes, etc.
1 parent6d6c372 commitf72a342

File tree

3 files changed

+129
-143
lines changed

3 files changed

+129
-143
lines changed

‎doc/src/sgml/backup.sgml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.71 2005/10/15 01:15:33 alvherre Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.72 2005/10/22 21:56:07 tgl Exp $
33
-->
44
<chapter id="backup">
55
<title>Backup and Restore</title>
@@ -1148,21 +1148,20 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows
11481148

11491149
<para>
11501150
It should also be noted that the default <acronym>WAL</acronym>
1151-
format is fairly bulky since it includes many disk page snapshots. The pages
1152-
are partially compressed, using the simple expedient of removing the
1153-
empty space (if any) within each block. You can significantly reduce
1151+
format is fairly bulky since it includes many disk page snapshots.
1152+
These page snapshots are designed to support crash recovery,
1153+
since we may need to fix partially-written disk pages. Depending
1154+
on your system hardware and software, the risk of partial writes may
1155+
be small enough to ignore, in which case you can significantly reduce
11541156
the total volume of archived logs by turning off page snapshots
1155-
using the <xref linkend="guc-full-page-writes"> parameter,
1156-
though you should read the notes and warnings in
1157-
<xref linkend="reliability"> before you do so.
1158-
These page snapshots are designed to allow crash recovery,
1159-
since we may need to fix partially-written disk pages. It is not
1160-
necessary to store these page copies for PITR operations, however.
1161-
If you turn off <xref linkend="guc-full-page-writes">, your PITR
1162-
backup and recovery operations will continue to work successfully.
1157+
using the <xref linkend="guc-full-page-writes"> parameter.
1158+
(Read the notes and warnings in
1159+
<xref linkend="reliability"> before you do so.)
1160+
Turning off page snapshots does not prevent use of the logs for PITR
1161+
operations.
11631162
An area for future development is to compress archived WAL data by
1164-
removing unnecessary page copies when <xref linkend="guc-full-page-writes">
1165-
isturnedon. In the meantime, administrators
1163+
removing unnecessary page copiesevenwhen <varname>full_page_writes</>
1164+
is on. In the meantime, administrators
11661165
may wish to reduce the number of page snapshots included in WAL by
11671166
increasing the checkpoint interval parameters as much as feasible.
11681167
</para>

‎doc/src/sgml/config.sgml

Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.31 2005/10/15 20:12:32 neilc Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.32 2005/10/22 21:56:07 tgl Exp $
33
-->
44
<chapter Id="runtime-config">
55
<title>Run-time Configuration</title>
@@ -1251,14 +1251,15 @@ SET ENABLE_SEQSCAN TO OFF;
12511251
<listitem>
12521252
<para>
12531253
If this option is on, the <productname>PostgreSQL</> server
1254-
will use the <function>fsync()</> system call in several places
1255-
to make sure that updates are physically written to disk. This
1256-
insures that a database cluster will recover to a
1254+
will try to make sure that updates are physically written to
1255+
disk, by issuing <function>fsync()</> system calls or various
1256+
equivalent methods (see <xref linkend="guc-wal-sync-method">).
1257+
This ensures that the database cluster can recover to a
12571258
consistent state after an operating system or hardware crash.
12581259
</para>
12591260

12601261
<para>
1261-
However, using <function>fsync()</function> results in a
1262+
However, using <varname>fsync</varname> results in a
12621263
performance penalty: when a transaction is committed,
12631264
<productname>PostgreSQL</productname> must wait for the
12641265
operating system to flush the write-ahead log to disk. When
@@ -1268,7 +1269,7 @@ SET ENABLE_SEQSCAN TO OFF;
12681269
However, if the system crashes, the results of the last few
12691270
committed transactions may be lost in part or whole. In the
12701271
worst case, unrecoverable data corruption may occur.
1271-
(Crashes of the databaseserver itself are <emphasis>not</>
1272+
(Crashes of the databasesoftware itself are <emphasis>not</>
12721273
a risk factor here. Only an operating-system-level crash
12731274
creates a risk of corruption.)
12741275
</para>
@@ -1277,8 +1278,8 @@ SET ENABLE_SEQSCAN TO OFF;
12771278
Due to the risks involved, there is no universally correct
12781279
setting for <varname>fsync</varname>. Some administrators
12791280
always disable <varname>fsync</varname>, while others only
1280-
turn it offforbulk loads, where there is a clear restart
1281-
point if something goes wrong, whereas some administrators
1281+
turn it offduring initialbulkdataloads, where there is a clear
1282+
restartpoint if something goes wrong. Others
12821283
always leave <varname>fsync</varname> enabled. The default is
12831284
to enable <varname>fsync</varname>, for maximum reliability.
12841285
If you trust your operating system, your hardware, and your
@@ -1288,9 +1289,9 @@ SET ENABLE_SEQSCAN TO OFF;
12881289

12891290
<para>
12901291
This option can only be set at server start or in the
1291-
<filename>postgresql.conf</filename> file. Ifthis option
1292-
is <literal>off</>, consideralso turning off
1293-
<varname>guc-full-page-writes</>.
1292+
<filename>postgresql.conf</filename> file. Ifyou turn
1293+
this optionoff,also consider turning off
1294+
<xref linkend="guc-full-page-writes">.
12941295
</para>
12951296
</listitem>
12961297
</varlistentry>
@@ -1302,8 +1303,10 @@ SET ENABLE_SEQSCAN TO OFF;
13021303
</indexterm>
13031304
<listitem>
13041305
<para>
1305-
Method used for forcing WAL updates out to disk. Possible
1306-
values are:
1306+
Method used for forcing WAL updates out to disk.
1307+
If <varname>fsync</varname> is off then this setting is irrelevant,
1308+
since updates will not be forced out at all.
1309+
Possible values are:
13071310
</para>
13081311
<itemizedlist>
13091312
<listitem>
@@ -1313,17 +1316,17 @@ SET ENABLE_SEQSCAN TO OFF;
13131316
</listitem>
13141317
<listitem>
13151318
<para>
1316-
<literal>fdatasync</> (call <function>fdatasync()</> at each commit),
1319+
<literal>fdatasync</> (call <function>fdatasync()</> at each commit)
13171320
</para>
13181321
</listitem>
13191322
<listitem>
13201323
<para>
1321-
<literal>fsync</> (call <function>fsync()</> at each commit)
1324+
<literal>fsync_writethrough</> (call <function>fsync()</> at each commit, forcing write-through of any disk write cache)
13221325
</para>
13231326
</listitem>
13241327
<listitem>
13251328
<para>
1326-
<literal>fsync_writethrough</> (force write-through of any disk write cache)
1329+
<literal>fsync</> (call <function>fsync()</> at each commit)
13271330
</para>
13281331
</listitem>
13291332
<listitem>
@@ -1334,8 +1337,7 @@ SET ENABLE_SEQSCAN TO OFF;
13341337
</itemizedlist>
13351338
<para>
13361339
Not all of these choices are available on all platforms.
1337-
The top-most supported option is used as the default.
1338-
If <varname>fsync</varname> is off then this setting is irrelevant.
1340+
The default is the first method in the above list that is supported.
13391341
This option can only be set at server start or in the
13401342
<filename>postgresql.conf</filename> file.
13411343
</para>
@@ -1349,21 +1351,37 @@ SET ENABLE_SEQSCAN TO OFF;
13491351
<term><varname>full_page_writes</varname> (<type>boolean</type>)</term>
13501352
<listitem>
13511353
<para>
1352-
A page write in process during an operating system crash might
1353-
be only partially written to disk, leading to an on-disk page
1354-
that contains a mix of old and new data. During recovery, the
1355-
row changes stored in WAL are not enough to completely restore
1356-
the page.
1354+
When this option is on, the <productname>PostgreSQL</> server
1355+
writes the entire content of each disk page to WAL during the
1356+
first modification of that page after a checkpoint.
1357+
This is needed because
1358+
a page write that is in process during an operating system crash might
1359+
be only partially completed, leading to an on-disk page
1360+
that contains a mix of old and new data. The row-level change data
1361+
normally stored in WAL will not be enough to completely restore
1362+
such a page during post-crash recovery. Storing the full page image
1363+
guarantees that the page can be correctly restored, but at a price
1364+
in increasing the amount of data that must be written to WAL.
1365+
(Because WAL replay always starts from a checkpoint, it is sufficient
1366+
to do this during the first change of each page after a checkpoint.
1367+
Therefore, one way to reduce the cost of full-page writes is to
1368+
increase the checkpoint interval parameters.)
13571369
</para>
13581370

13591371
<para>
1360-
When this option is on, the <productname>PostgreSQL</> server
1361-
writes full pages to WAL when they are first modified after a
1362-
checkpoint so crash recovery is possible. Turning this option off
1363-
might lead to a corrupt system after an operating system crash
1364-
or power failure because uncorrected partial pages might contain
1365-
inconsistent or corrupt data. The risks are less but similar to
1366-
<varname>fsync</>.
1372+
Turning this option off speeds normal operation, but
1373+
might lead to a corrupt database after an operating system crash
1374+
or power failure. The risks are similar to turning off
1375+
<varname>fsync</>, though smaller. It may be safe to turn off
1376+
this option if you have hardware (such as a battery-backed disk
1377+
controller) or filesystem software (e.g., Reiser4) that reduces
1378+
the risk of partial page writes to an acceptably low level.
1379+
</para>
1380+
1381+
<para>
1382+
Turning off this option does not affect use of
1383+
WAL archiving for point-in-time recovery (PITR)
1384+
(see <xref linkend="backup-online">).
13671385
</para>
13681386

13691387
<para>
@@ -1384,7 +1402,7 @@ SET ENABLE_SEQSCAN TO OFF;
13841402
Number of disk-page buffers allocated in shared memory for WAL data.
13851403
The default is 8. The setting need only be large enough to hold
13861404
the amount of WAL data generated by one typical transaction, since
1387-
the data isflushed to disk at every transaction commit.
1405+
the data iswritten out to disk at every transaction commit.
13881406
This option can only be set at server start.
13891407
</para>
13901408

@@ -1481,8 +1499,9 @@ SET ENABLE_SEQSCAN TO OFF;
14811499
<para>
14821500
Write a message to the server log if checkpoints caused by
14831501
the filling of checkpoint segment files happen closer together
1484-
than this many seconds. The default is 30 seconds.
1485-
Zero turns off the warning.
1502+
than this many seconds (which suggests that
1503+
<varname>checkpoint_segments</> ought to be raised). The default is
1504+
30 seconds. Zero disables the warning.
14861505
</para>
14871506
</listitem>
14881507
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp