Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 31dcfae

Browse files
committed
Use the terminology "WAL file" not "log file" more consistently.
Referring to the WAL as just "log" invites confusion with the postmaster log, so avoid doing that in docs and error messages. Also shorten "WAL segment file" to just "WAL file" in various places. Bharath Rupireddy, reviewed by Nathan Bossart and Kyotaro Horiguchi Discussion: https://postgr.es/m/CALj2ACUeXa8tDPaiTLexBDMZ7hgvaN+RTb957-cn5qwv9zf-MQ@mail.gmail.com
1 parent 6384052 commit 31dcfae

File tree

14 files changed

+67
-67
lines changed

14 files changed

+67
-67
lines changed

doc/src/sgml/backup.sgml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,7 @@ SELECT * FROM pg_backup_stop(wait_for_archive => true);
11111111
require that you have enough free space on your system to hold two
11121112
copies of your existing database. If you do not have enough space,
11131113
you should at least save the contents of the cluster's <filename>pg_wal</filename>
1114-
subdirectory, as it might contain logs which
1114+
subdirectory, as it might contain WAL files which
11151115
were not archived before the system went down.
11161116
</para>
11171117
</listitem>
@@ -1189,8 +1189,8 @@ SELECT * FROM pg_backup_stop(wait_for_archive => true);
11891189
which tells <productname>PostgreSQL</productname> how to retrieve archived
11901190
WAL file segments. Like the <varname>archive_command</varname>, this is
11911191
a shell command string. It can contain <literal>%f</literal>, which is
1192-
replaced by the name of the desired log file, and <literal>%p</literal>,
1193-
which is replaced by the path name to copy the log file to.
1192+
replaced by the name of the desired WAL file, and <literal>%p</literal>,
1193+
which is replaced by the path name to copy the WAL file to.
11941194
(The path name is relative to the current working directory,
11951195
i.e., the cluster's data directory.)
11961196
Write <literal>%%</literal> if you need to embed an actual <literal>%</literal>
@@ -1478,9 +1478,9 @@ archive_command = 'local_backup_script.sh "%p" "%f"'
14781478
<link linkend="sql-createtablespace"><command>CREATE TABLESPACE</command></link>
14791479
commands are WAL-logged with the literal absolute path, and will
14801480
therefore be replayed as tablespace creations with the same
1481-
absolute path. This might be undesirable if the log is being
1481+
absolute path. This might be undesirable if the WAL is being
14821482
replayed on a different machine. It can be dangerous even if the
1483-
log is being replayed on the same machine, but into a new data
1483+
WAL is being replayed on the same machine, but into a new data
14841484
directory: the replay will still overwrite the contents of the
14851485
original tablespace. To avoid potential gotchas of this sort,
14861486
the best practice is to take a new base backup after creating or
@@ -1497,11 +1497,11 @@ archive_command = 'local_backup_script.sh "%p" "%f"'
14971497
we might need to fix partially-written disk pages. Depending on
14981498
your system hardware and software, the risk of partial writes might
14991499
be small enough to ignore, in which case you can significantly
1500-
reduce the total volume of archived logs by turning off page
1500+
reduce the total volume of archived WAL files by turning off page
15011501
snapshots using the <xref linkend="guc-full-page-writes"/>
15021502
parameter. (Read the notes and warnings in <xref linkend="wal"/>
15031503
before you do so.) Turning off page snapshots does not prevent
1504-
use of the logs for PITR operations. An area for future
1504+
use of the WAL for PITR operations. An area for future
15051505
development is to compress archived WAL data by removing
15061506
unnecessary page copies even when <varname>full_page_writes</varname> is
15071507
on. In the meantime, administrators might wish to reduce the number

doc/src/sgml/config.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4237,7 +4237,7 @@ restore_command = 'copy "C:\\server\\archivedir\\%f" "%p"' # Windows
42374237
</term>
42384238
<listitem>
42394239
<para>
4240-
Specifies the minimum size of past log file segments kept in the
4240+
Specifies the minimum size of past WAL files kept in the
42414241
<filename>pg_wal</filename>
42424242
directory, in case a standby server needs to fetch them for streaming
42434243
replication. If a standby
@@ -4831,7 +4831,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
48314831
needs to control the amount of time to wait for new WAL data to be
48324832
available. For example, in archive recovery, it is possible to
48334833
make the recovery more responsive in the detection of a new WAL
4834-
log file by reducing the value of this parameter. On a system with
4834+
file by reducing the value of this parameter. On a system with
48354835
low WAL activity, increasing it reduces the amount of requests necessary
48364836
to access WAL archives, something useful for example in cloud
48374837
environments where the number of times an infrastructure is accessed

doc/src/sgml/protocol.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2717,7 +2717,7 @@ psql "dbname=postgres replication=database" -c "IDENTIFY_SYSTEM;"
27172717
<listitem>
27182718
<para>
27192719
If set to true, the backup will wait until the last required WAL
2720-
segment has been archived, or emit a warning if log archiving is
2720+
segment has been archived, or emit a warning if WAL archiving is
27212721
not enabled. If false, the backup will neither wait nor warn,
27222722
leaving the client responsible for ensuring the required log is
27232723
available. The default is true.

doc/src/sgml/ref/pg_basebackup.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ PostgreSQL documentation
316316
backup. This will include all write-ahead logs generated during
317317
the backup. Unless the method <literal>none</literal> is specified,
318318
it is possible to start a postmaster in the target
319-
directory without the need to consult the log archive, thus
319+
directory without the need to consult the WAL archive, thus
320320
making the output a completely standalone backup.
321321
</para>
322322
<para>

doc/src/sgml/ref/pg_waldump.sgml

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ PostgreSQL documentation
5353
<term><replaceable class="parameter">startseg</replaceable></term>
5454
<listitem>
5555
<para>
56-
Start reading at the specified log segment file. This implicitly determines
56+
Start reading at the specified WAL segment file. This implicitly determines
5757
the path in which files will be searched for, and the timeline to use.
5858
</para>
5959
</listitem>
@@ -63,7 +63,7 @@ PostgreSQL documentation
6363
<term><replaceable class="parameter">endseg</replaceable></term>
6464
<listitem>
6565
<para>
66-
Stop after reading the specified log segment file.
66+
Stop after reading the specified WAL segment file.
6767
</para>
6868
</listitem>
6969
</varlistentry>
@@ -141,7 +141,7 @@ PostgreSQL documentation
141141
<term><option>--path=<replaceable>path</replaceable></option></term>
142142
<listitem>
143143
<para>
144-
Specifies a directory to search for log segment files or a
144+
Specifies a directory to search for WAL segment files or a
145145
directory with a <literal>pg_wal</literal> subdirectory that
146146
contains such files. The default is to search in the current
147147
directory, the <literal>pg_wal</literal> subdirectory of the
@@ -203,7 +203,7 @@ PostgreSQL documentation
203203
<listitem>
204204
<para>
205205
WAL location at which to start reading. The default is to start reading
206-
the first valid log record found in the earliest file found.
206+
the first valid WAL record found in the earliest file found.
207207
</para>
208208
</listitem>
209209
</varlistentry>
@@ -213,7 +213,7 @@ PostgreSQL documentation
213213
<term><option>--timeline=<replaceable>timeline</replaceable></option></term>
214214
<listitem>
215215
<para>
216-
Timeline from which to read log records. The default is to use the
216+
Timeline from which to read WAL records. The default is to use the
217217
value in <replaceable>startseg</replaceable>, if that is specified; otherwise, the
218218
default is 1.
219219
</para>

doc/src/sgml/wal.sgml

+30-30
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@
297297
transaction processing. Briefly, <acronym>WAL</acronym>'s central
298298
concept is that changes to data files (where tables and indexes
299299
reside) must be written only after those changes have been logged,
300-
that is, after log records describing the changes have been flushed
300+
that is, after WAL records describing the changes have been flushed
301301
to permanent storage. If we follow this procedure, we do not need
302302
to flush data pages to disk on every transaction commit, because we
303303
know that in the event of a crash we will be able to recover the
304304
database using the log: any changes that have not been applied to
305-
the data pages can be redone from the log records. (This is
305+
the data pages can be redone from the WAL records. (This is
306306
roll-forward recovery, also known as REDO.)
307307
</para>
308308

@@ -323,15 +323,15 @@
323323

324324
<para>
325325
Using <acronym>WAL</acronym> results in a
326-
significantly reduced number of disk writes, because only the log
326+
significantly reduced number of disk writes, because only the WAL
327327
file needs to be flushed to disk to guarantee that a transaction is
328328
committed, rather than every data file changed by the transaction.
329-
The log file is written sequentially,
330-
and so the cost of syncing the log is much less than the cost of
329+
The WAL file is written sequentially,
330+
and so the cost of syncing the WAL is much less than the cost of
331331
flushing the data pages. This is especially true for servers
332332
handling many small transactions touching different parts of the data
333333
store. Furthermore, when the server is processing many small concurrent
334-
transactions, one <function>fsync</function> of the log file may
334+
transactions, one <function>fsync</function> of the WAL file may
335335
suffice to commit many transactions.
336336
</para>
337337

@@ -341,10 +341,10 @@
341341
linkend="continuous-archiving"/>. By archiving the WAL data we can support
342342
reverting to any time instant covered by the available WAL data:
343343
we simply install a prior physical backup of the database, and
344-
replay the WAL log just as far as the desired time. What's more,
344+
replay the WAL just as far as the desired time. What's more,
345345
the physical backup doesn't have to be an instantaneous snapshot
346346
of the database state &mdash; if it is made over some period of time,
347-
then replaying the WAL log for that period will fix any internal
347+
then replaying the WAL for that period will fix any internal
348348
inconsistencies.
349349
</para>
350350
</sect1>
@@ -497,15 +497,15 @@
497497
that the heap and index data files have been updated with all
498498
information written before that checkpoint. At checkpoint time, all
499499
dirty data pages are flushed to disk and a special checkpoint record is
500-
written to the log file. (The change records were previously flushed
500+
written to the WAL file. (The change records were previously flushed
501501
to the <acronym>WAL</acronym> files.)
502502
In the event of a crash, the crash recovery procedure looks at the latest
503-
checkpoint record to determine the point in the log (known as the redo
503+
checkpoint record to determine the point in the WAL (known as the redo
504504
record) from which it should start the REDO operation. Any changes made to
505505
data files before that point are guaranteed to be already on disk.
506-
Hence, after a checkpoint, log segments preceding the one containing
506+
Hence, after a checkpoint, WAL segments preceding the one containing
507507
the redo record are no longer needed and can be recycled or removed. (When
508-
<acronym>WAL</acronym> archiving is being done, the log segments must be
508+
<acronym>WAL</acronym> archiving is being done, the WAL segments must be
509509
archived before being recycled or removed.)
510510
</para>
511511

@@ -544,7 +544,7 @@
544544
another factor to consider. To ensure data page consistency,
545545
the first modification of a data page after each checkpoint results in
546546
logging the entire page content. In that case,
547-
a smaller checkpoint interval increases the volume of output to the WAL log,
547+
a smaller checkpoint interval increases the volume of output to the WAL,
548548
partially negating the goal of using a smaller interval,
549549
and in any case causing more disk I/O.
550550
</para>
@@ -614,10 +614,10 @@
614614
<para>
615615
The number of WAL segment files in <filename>pg_wal</filename> directory depends on
616616
<varname>min_wal_size</varname>, <varname>max_wal_size</varname> and
617-
the amount of WAL generated in previous checkpoint cycles. When old log
617+
the amount of WAL generated in previous checkpoint cycles. When old WAL
618618
segment files are no longer needed, they are removed or recycled (that is,
619619
renamed to become future segments in the numbered sequence). If, due to a
620-
short-term peak of log output rate, <varname>max_wal_size</varname> is
620+
short-term peak of WAL output rate, <varname>max_wal_size</varname> is
621621
exceeded, the unneeded segment files will be removed until the system
622622
gets back under this limit. Below that limit, the system recycles enough
623623
WAL files to cover the estimated need until the next checkpoint, and
@@ -650,7 +650,7 @@
650650
which are similar to checkpoints in normal operation: the server forces
651651
all its state to disk, updates the <filename>pg_control</filename> file to
652652
indicate that the already-processed WAL data need not be scanned again,
653-
and then recycles any old log segment files in the <filename>pg_wal</filename>
653+
and then recycles any old WAL segment files in the <filename>pg_wal</filename>
654654
directory.
655655
Restartpoints can't be performed more frequently than checkpoints on the
656656
primary because restartpoints can only be performed at checkpoint records.
@@ -676,12 +676,12 @@
676676
insertion) at a time when an exclusive lock is held on affected
677677
data pages, so the operation needs to be as fast as possible. What
678678
is worse, writing <acronym>WAL</acronym> buffers might also force the
679-
creation of a new log segment, which takes even more
679+
creation of a new WAL segment, which takes even more
680680
time. Normally, <acronym>WAL</acronym> buffers should be written
681681
and flushed by an <function>XLogFlush</function> request, which is
682682
made, for the most part, at transaction commit time to ensure that
683683
transaction records are flushed to permanent storage. On systems
684-
with high log output, <function>XLogFlush</function> requests might
684+
with high WAL output, <function>XLogFlush</function> requests might
685685
not occur often enough to prevent <function>XLogInsertRecord</function>
686686
from having to do writes. On such systems
687687
one should increase the number of <acronym>WAL</acronym> buffers by
@@ -724,7 +724,7 @@
724724
<varname>commit_delay</varname>, so this value is recommended as the
725725
starting point to use when optimizing for a particular workload. While
726726
tuning <varname>commit_delay</varname> is particularly useful when the
727-
WAL log is stored on high-latency rotating disks, benefits can be
727+
WAL is stored on high-latency rotating disks, benefits can be
728728
significant even on storage media with very fast sync times, such as
729729
solid-state drives or RAID arrays with a battery-backed write cache;
730730
but this should definitely be tested against a representative workload.
@@ -828,16 +828,16 @@
828828
<para>
829829
<acronym>WAL</acronym> is automatically enabled; no action is
830830
required from the administrator except ensuring that the
831-
disk-space requirements for the <acronym>WAL</acronym> logs are met,
831+
disk-space requirements for the <acronym>WAL</acronym> files are met,
832832
and that any necessary tuning is done (see <xref
833833
linkend="wal-configuration"/>).
834834
</para>
835835

836836
<para>
837837
<acronym>WAL</acronym> records are appended to the <acronym>WAL</acronym>
838-
logs as each new record is written. The insert position is described by
838+
files as each new record is written. The insert position is described by
839839
a Log Sequence Number (<acronym>LSN</acronym>) that is a byte offset into
840-
the logs, increasing monotonically with each new record.
840+
the WAL, increasing monotonically with each new record.
841841
<acronym>LSN</acronym> values are returned as the datatype
842842
<link linkend="datatype-pg-lsn"><type>pg_lsn</type></link>. Values can be
843843
compared to calculate the volume of <acronym>WAL</acronym> data that
@@ -846,12 +846,12 @@
846846
</para>
847847

848848
<para>
849-
<acronym>WAL</acronym> logs are stored in the directory
849+
<acronym>WAL</acronym> files are stored in the directory
850850
<filename>pg_wal</filename> under the data directory, as a set of
851851
segment files, normally each 16 MB in size (but the size can be changed
852852
by altering the <option>--wal-segsize</option> <application>initdb</application> option). Each segment is
853853
divided into pages, normally 8 kB each (this size can be changed via the
854-
<option>--with-wal-blocksize</option> configure option). The log record headers
854+
<option>--with-wal-blocksize</option> configure option). The WAL record headers
855855
are described in <filename>access/xlogrecord.h</filename>; the record
856856
content is dependent on the type of event that is being logged. Segment
857857
files are given ever-increasing numbers as names, starting at
@@ -861,7 +861,7 @@
861861
</para>
862862

863863
<para>
864-
It is advantageous if the log is located on a different disk from the
864+
It is advantageous if the WAL is located on a different disk from the
865865
main database files. This can be achieved by moving the
866866
<filename>pg_wal</filename> directory to another location (while the server
867867
is shut down, of course) and creating a symbolic link from the
@@ -877,27 +877,27 @@
877877
on the disk. A power failure in such a situation might lead to
878878
irrecoverable data corruption. Administrators should try to ensure
879879
that disks holding <productname>PostgreSQL</productname>'s
880-
<acronym>WAL</acronym> log files do not make such false reports.
880+
<acronym>WAL</acronym> files do not make such false reports.
881881
(See <xref linkend="wal-reliability"/>.)
882882
</para>
883883

884884
<para>
885-
After a checkpoint has been made and the log flushed, the
885+
After a checkpoint has been made and the WAL flushed, the
886886
checkpoint's position is saved in the file
887887
<filename>pg_control</filename>. Therefore, at the start of recovery,
888888
the server first reads <filename>pg_control</filename> and
889889
then the checkpoint record; then it performs the REDO operation by
890-
scanning forward from the log location indicated in the checkpoint
890+
scanning forward from the WAL location indicated in the checkpoint
891891
record. Because the entire content of data pages is saved in the
892-
log on the first page modification after a checkpoint (assuming
892+
WAL on the first page modification after a checkpoint (assuming
893893
<xref linkend="guc-full-page-writes"/> is not disabled), all pages
894894
changed since the checkpoint will be restored to a consistent
895895
state.
896896
</para>
897897

898898
<para>
899899
To deal with the case where <filename>pg_control</filename> is
900-
corrupt, we should support the possibility of scanning existing log
900+
corrupt, we should support the possibility of scanning existing WAL
901901
segments in reverse order &mdash; newest to oldest &mdash; in order to find the
902902
latest checkpoint. This has not been implemented yet.
903903
<filename>pg_control</filename> is small enough (less than one disk page)

0 commit comments

Comments
 (0)