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

Commit63653f7

Browse files
committed
Complete TODO item:
* Remove wal_files postgresql.conf option because WAL files are now recycled
1 parentfefb57c commit63653f7

File tree

5 files changed

+18
-56
lines changed

5 files changed

+18
-56
lines changed

‎doc/src/sgml/runtime.sgml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.129 2002/08/3000:28:40 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.130 2002/08/3016:50:49 momjian Exp $
33
-->
44

55
<Chapter Id="runtime">
@@ -1949,17 +1949,6 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
19491949
</listitem>
19501950
</varlistentry>
19511951

1952-
<varlistentry>
1953-
<term><varname>WAL_FILES</varname> (<type>integer</type>)</term>
1954-
<listitem>
1955-
<para>
1956-
Number of log files that are created in advance at checkpoint
1957-
time. This option can only be set at server start or in the
1958-
<filename>postgresql.conf</filename> file.
1959-
</para>
1960-
</listitem>
1961-
</varlistentry>
1962-
19631952
<varlistentry>
19641953
<term><varname>WAL_SYNC_METHOD</varname> (<type>string</type>)</term>
19651954
<listitem>

‎doc/src/sgml/wal.sgml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.16 2002/07/05 19:06:11 momjian Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.17 2002/08/30 16:50:50 momjian Exp $ -->
22

33
<chapter id="wal">
44
<title>Write-Ahead Logging (<acronym>WAL</acronym>)</title>
@@ -276,9 +276,6 @@
276276
By default a new 16MB segment file is created only if more than 75% of
277277
the current segment has been used. This is inadequate if the system
278278
generates more than 4MB of log output between checkpoints.
279-
One can instruct the server to pre-create up to 64 log segments
280-
at checkpoint time by modifying the <varname>WAL_FILES</varname>
281-
configuration parameter.
282279
</para>
283280

284281
<para>
@@ -306,20 +303,14 @@
306303

307304
<para>
308305
The number of 16MB segment files will always be at least
309-
<varname>WAL_FILES</varname> + 1, and will normally not exceed
310-
<varname>WAL_FILES</varname> + MAX(<varname>WAL_FILES</varname>,
311-
<varname>CHECKPOINT_SEGMENTS</varname>) + 1. This may be used to
312-
estimate space requirements for WAL. Ordinarily, when an old log
313-
segment files are no longer needed, they are recycled (renamed to
314-
become the next sequential future segments). If, due to a short-term
315-
peak of log output rate, there are more than
316-
<varname>WAL_FILES</varname> + MAX(<varname>WAL_FILES</varname>,
317-
<varname>CHECKPOINT_SEGMENTS</varname>) + 1 segment files, then
318-
unneeded segment files will be deleted instead of recycled until the
319-
system gets back under this limit. (If this happens on a regular
320-
basis, <varname>WAL_FILES</varname> should be increased to avoid it.
321-
Deleting log segments that will only have to be created again later
322-
is expensive and pointless.)
306+
1, and will normally not exceed <varname>CHECKPOINT_SEGMENTS</varname>)
307+
+ 1. This may be used to estimate space requirements for WAL.
308+
Ordinarily, when old log segment files are no longer needed,
309+
they are recycled (renamed to become the next sequential future
310+
segments). If, due to a short-term peak of log output rate, there
311+
are more than <varname>CHECKPOINT_SEGMENTS</varname>) + 1 segment files,
312+
the unneeded segment files will be deleted instead of recycled until the
313+
system gets back under this limit.
323314
</para>
324315

325316
<para>

‎src/backend/access/transam/xlog.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.102 2002/08/17 15:12:06 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.103 2002/08/30 16:50:50 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -87,7 +87,6 @@
8787
/* User-settable parameters */
8888
intCheckPointSegments=3;
8989
intXLOGbuffers=8;
90-
intXLOGfiles=0;/* # of files to preallocate during ckpt */
9190
intXLOG_DEBUG=0;
9291
char*XLOG_sync_method=NULL;
9392
constcharXLOG_sync_method_default[]=DEFAULT_SYNC_METHOD_STR;
@@ -97,7 +96,7 @@ charXLOG_archive_dir[MAXPGPATH];/* null string means
9796
/*
9897
* XLOGfileslop is used in the code as the allowed "fuzz" in the number of
9998
* preallocated XLOG segments --- we try to have at least XLOGfiles advance
100-
* segments but no more thanXLOGfiles+XLOGfileslop segments. This could
99+
* segments but no more than XLOGfileslop segments. This could
101100
* be made a separate GUC variable, but at present I think it's sufficient
102101
* to hardwire it as 2*CheckPointSegments+1. Under normal conditions, a
103102
* checkpoint will free no more than 2*CheckPointSegments log segments, and
@@ -1422,7 +1421,7 @@ XLogFileInit(uint32 log, uint32 seg,
14221421
* ours to pre-create a future log segment.
14231422
*/
14241423
if (!InstallXLogFileSegment(log,seg,tmppath,
1425-
*use_existent,XLOGfiles+XLOGfileslop,
1424+
*use_existent,XLOGfileslop,
14261425
use_lock))
14271426
{
14281427
/* No need for any more future segments... */
@@ -1568,20 +1567,9 @@ PreallocXlogFiles(XLogRecPtr endptr)
15681567
uint32_logSeg;
15691568
intlf;
15701569
booluse_existent;
1571-
inti;
15721570

15731571
XLByteToPrevSeg(endptr,_logId,_logSeg);
1574-
if (XLOGfiles>0)
1575-
{
1576-
for (i=1;i <=XLOGfiles;i++)
1577-
{
1578-
NextLogSeg(_logId,_logSeg);
1579-
use_existent= true;
1580-
lf=XLogFileInit(_logId,_logSeg,&use_existent, true);
1581-
close(lf);
1582-
}
1583-
}
1584-
elseif ((endptr.xrecoff-1) %XLogSegSize >=
1572+
if ((endptr.xrecoff-1) %XLogSegSize >=
15851573
(uint32) (0.75*XLogSegSize))
15861574
{
15871575
NextLogSeg(_logId,_logSeg);
@@ -1635,11 +1623,11 @@ MoveOfflineLogs(uint32 log, uint32 seg, XLogRecPtr endptr)
16351623
/*
16361624
* Before deleting the file, see if it can be recycled as
16371625
* a future log segment. We allow recycling segments up
1638-
* toXLOGfiles +XLOGfileslop segments beyond the current
1626+
* to XLOGfileslop segments beyond the current
16391627
* XLOG location.
16401628
*/
16411629
if (InstallXLogFileSegment(endlogId,endlogSeg,path,
1642-
true,XLOGfiles+XLOGfileslop,
1630+
true,XLOGfileslop,
16431631
true))
16441632
{
16451633
elog(LOG,"recycled transaction log file %s",

‎src/backend/utils/misc/guc.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* command, configuration file, and command line options.
66
* See src/backend/utils/misc/README for more information.
77
*
8-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.87 2002/08/29 21:02:12 momjian Exp $
8+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.88 2002/08/30 16:50:50 momjian Exp $
99
*
1010
* Copyright 2000 by PostgreSQL Global Development Group
1111
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -640,11 +640,6 @@ static struct config_int
640640
8,4,INT_MAX,NULL,NULL
641641
},
642642

643-
{
644-
{"wal_files",PGC_SIGHUP },&XLOGfiles,
645-
0,0,64,NULL,NULL
646-
},
647-
648643
{
649644
{"wal_debug",PGC_SUSET },&XLOG_DEBUG,
650645
0,0,16,NULL,NULL

‎src/include/access/xlog.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: xlog.h,v 1.35 2002/08/17 15:12:07 momjian Exp $
9+
* $Id: xlog.h,v 1.36 2002/08/30 16:50:50 momjian Exp $
1010
*/
1111
#ifndefXLOG_H
1212
#defineXLOG_H
@@ -185,7 +185,6 @@ extern XLogRecPtr ProcLastRecEnd;
185185
/* these variables are GUC parameters related to XLOG */
186186
externintCheckPointSegments;
187187
externintXLOGbuffers;
188-
externintXLOGfiles;
189188
externintXLOG_DEBUG;
190189
externchar*XLOG_sync_method;
191190
externconstcharXLOG_sync_method_default[];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp