Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
63653f7f
Commit
63653f7f
authored
Aug 30, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete TODO item:
* Remove wal_files postgresql.conf option because WAL files are now recycled
parent
fefb57ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
56 deletions
+18
-56
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+1
-12
doc/src/sgml/wal.sgml
doc/src/sgml/wal.sgml
+9
-18
src/backend/access/transam/xlog.c
src/backend/access/transam/xlog.c
+6
-18
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+1
-6
src/include/access/xlog.h
src/include/access/xlog.h
+1
-2
No files found.
doc/src/sgml/runtime.sgml
View file @
63653f7f
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.1
29 2002/08/30 00:28:40 tgl
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.1
30 2002/08/30 16:50:49 momjian
Exp $
-->
-->
<Chapter Id="runtime">
<Chapter Id="runtime">
...
@@ -1949,17 +1949,6 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
...
@@ -1949,17 +1949,6 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir'
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
<term><varname>WAL_FILES</varname> (<type>integer</type>)</term>
<listitem>
<para>
Number of log files that are created in advance at checkpoint
time. This option can only be set at server start or in the
<filename>postgresql.conf</filename> file.
</para>
</listitem>
</varlistentry>
<varlistentry>
<varlistentry>
<term><varname>WAL_SYNC_METHOD</varname> (<type>string</type>)</term>
<term><varname>WAL_SYNC_METHOD</varname> (<type>string</type>)</term>
<listitem>
<listitem>
...
...
doc/src/sgml/wal.sgml
View file @
63653f7f
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.1
6 2002/07/05 19:06:11
momjian Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.1
7 2002/08/30 16:50:50
momjian Exp $ -->
<chapter id="wal">
<chapter id="wal">
<title>Write-Ahead Logging (<acronym>WAL</acronym>)</title>
<title>Write-Ahead Logging (<acronym>WAL</acronym>)</title>
...
@@ -276,9 +276,6 @@
...
@@ -276,9 +276,6 @@
By default a new 16MB segment file is created only if more than 75% of
By default a new 16MB segment file is created only if more than 75% of
the current segment has been used. This is inadequate if the system
the current segment has been used. This is inadequate if the system
generates more than 4MB of log output between checkpoints.
generates more than 4MB of log output between checkpoints.
One can instruct the server to pre-create up to 64 log segments
at checkpoint time by modifying the <varname>WAL_FILES</varname>
configuration parameter.
</para>
</para>
<para>
<para>
...
@@ -306,20 +303,14 @@
...
@@ -306,20 +303,14 @@
<para>
<para>
The number of 16MB segment files will always be at least
The number of 16MB segment files will always be at least
<varname>WAL_FILES</varname> + 1, and will normally not exceed
1, and will normally not exceed <varname>CHECKPOINT_SEGMENTS</varname>)
<varname>WAL_FILES</varname> + MAX(<varname>WAL_FILES</varname>,
+ 1. This may be used to estimate space requirements for WAL.
<varname>CHECKPOINT_SEGMENTS</varname>) + 1. This may be used to
Ordinarily, when old log segment files are no longer needed,
estimate space requirements for WAL. Ordinarily, when an old log
they are recycled (renamed to become the next sequential future
segment files are no longer needed, they are recycled (renamed to
segments). If, due to a short-term peak of log output rate, there
become the next sequential future segments). If, due to a short-term
are more than <varname>CHECKPOINT_SEGMENTS</varname>) + 1 segment files,
peak of log output rate, there are more than
the unneeded segment files will be deleted instead of recycled until the
<varname>WAL_FILES</varname> + MAX(<varname>WAL_FILES</varname>,
system gets back under this limit.
<varname>CHECKPOINT_SEGMENTS</varname>) + 1 segment files, then
unneeded segment files will be deleted instead of recycled until the
system gets back under this limit. (If this happens on a regular
basis, <varname>WAL_FILES</varname> should be increased to avoid it.
Deleting log segments that will only have to be created again later
is expensive and pointless.)
</para>
</para>
<para>
<para>
...
...
src/backend/access/transam/xlog.c
View file @
63653f7f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.10
2 2002/08/17 15:12:06
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.10
3 2002/08/30 16:50:50
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -87,7 +87,6 @@
...
@@ -87,7 +87,6 @@
/* User-settable parameters */
/* User-settable parameters */
int
CheckPointSegments
=
3
;
int
CheckPointSegments
=
3
;
int
XLOGbuffers
=
8
;
int
XLOGbuffers
=
8
;
int
XLOGfiles
=
0
;
/* # of files to preallocate during ckpt */
int
XLOG_DEBUG
=
0
;
int
XLOG_DEBUG
=
0
;
char
*
XLOG_sync_method
=
NULL
;
char
*
XLOG_sync_method
=
NULL
;
const
char
XLOG_sync_method_default
[]
=
DEFAULT_SYNC_METHOD_STR
;
const
char
XLOG_sync_method_default
[]
=
DEFAULT_SYNC_METHOD_STR
;
...
@@ -97,7 +96,7 @@ char XLOG_archive_dir[MAXPGPATH]; /* null string means
...
@@ -97,7 +96,7 @@ char XLOG_archive_dir[MAXPGPATH]; /* null string means
/*
/*
* XLOGfileslop is used in the code as the allowed "fuzz" in the number of
* XLOGfileslop is used in the code as the allowed "fuzz" in the number of
* preallocated XLOG segments --- we try to have at least XLOGfiles advance
* preallocated XLOG segments --- we try to have at least XLOGfiles advance
* segments but no more than XLOGfiles
+XLOGfiles
lop segments. This could
* segments but no more than XLOGfileslop segments. This could
* be made a separate GUC variable, but at present I think it's sufficient
* be made a separate GUC variable, but at present I think it's sufficient
* to hardwire it as 2*CheckPointSegments+1. Under normal conditions, a
* to hardwire it as 2*CheckPointSegments+1. Under normal conditions, a
* checkpoint will free no more than 2*CheckPointSegments log segments, and
* checkpoint will free no more than 2*CheckPointSegments log segments, and
...
@@ -1422,7 +1421,7 @@ XLogFileInit(uint32 log, uint32 seg,
...
@@ -1422,7 +1421,7 @@ XLogFileInit(uint32 log, uint32 seg,
* ours to pre-create a future log segment.
* ours to pre-create a future log segment.
*/
*/
if
(
!
InstallXLogFileSegment
(
log
,
seg
,
tmppath
,
if
(
!
InstallXLogFileSegment
(
log
,
seg
,
tmppath
,
*
use_existent
,
XLOGfiles
+
XLOGfiles
lop
,
*
use_existent
,
XLOGfileslop
,
use_lock
))
use_lock
))
{
{
/* No need for any more future segments... */
/* No need for any more future segments... */
...
@@ -1568,20 +1567,9 @@ PreallocXlogFiles(XLogRecPtr endptr)
...
@@ -1568,20 +1567,9 @@ PreallocXlogFiles(XLogRecPtr endptr)
uint32
_logSeg
;
uint32
_logSeg
;
int
lf
;
int
lf
;
bool
use_existent
;
bool
use_existent
;
int
i
;
XLByteToPrevSeg
(
endptr
,
_logId
,
_logSeg
);
XLByteToPrevSeg
(
endptr
,
_logId
,
_logSeg
);
if
(
XLOGfiles
>
0
)
if
((
endptr
.
xrecoff
-
1
)
%
XLogSegSize
>=
{
for
(
i
=
1
;
i
<=
XLOGfiles
;
i
++
)
{
NextLogSeg
(
_logId
,
_logSeg
);
use_existent
=
true
;
lf
=
XLogFileInit
(
_logId
,
_logSeg
,
&
use_existent
,
true
);
close
(
lf
);
}
}
else
if
((
endptr
.
xrecoff
-
1
)
%
XLogSegSize
>=
(
uint32
)
(
0
.
75
*
XLogSegSize
))
(
uint32
)
(
0
.
75
*
XLogSegSize
))
{
{
NextLogSeg
(
_logId
,
_logSeg
);
NextLogSeg
(
_logId
,
_logSeg
);
...
@@ -1635,11 +1623,11 @@ MoveOfflineLogs(uint32 log, uint32 seg, XLogRecPtr endptr)
...
@@ -1635,11 +1623,11 @@ MoveOfflineLogs(uint32 log, uint32 seg, XLogRecPtr endptr)
/*
/*
* Before deleting the file, see if it can be recycled as
* Before deleting the file, see if it can be recycled as
* a future log segment. We allow recycling segments up
* a future log segment. We allow recycling segments up
* to XLOGfiles
+ XLOGfiles
lop segments beyond the current
* to XLOGfileslop segments beyond the current
* XLOG location.
* XLOG location.
*/
*/
if
(
InstallXLogFileSegment
(
endlogId
,
endlogSeg
,
path
,
if
(
InstallXLogFileSegment
(
endlogId
,
endlogSeg
,
path
,
true
,
XLOGfiles
+
XLOGfiles
lop
,
true
,
XLOGfileslop
,
true
))
true
))
{
{
elog
(
LOG
,
"recycled transaction log file %s"
,
elog
(
LOG
,
"recycled transaction log file %s"
,
...
...
src/backend/utils/misc/guc.c
View file @
63653f7f
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* command, configuration file, and command line options.
* command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information.
* See src/backend/utils/misc/README for more information.
*
*
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.8
7 2002/08/29 21:02:12
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.8
8 2002/08/30 16:50:50
momjian Exp $
*
*
* Copyright 2000 by PostgreSQL Global Development Group
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
* Written by Peter Eisentraut <peter_e@gmx.net>.
...
@@ -640,11 +640,6 @@ static struct config_int
...
@@ -640,11 +640,6 @@ static struct config_int
8
,
4
,
INT_MAX
,
NULL
,
NULL
8
,
4
,
INT_MAX
,
NULL
,
NULL
},
},
{
{
"wal_files"
,
PGC_SIGHUP
},
&
XLOGfiles
,
0
,
0
,
64
,
NULL
,
NULL
},
{
{
{
"wal_debug"
,
PGC_SUSET
},
&
XLOG_DEBUG
,
{
"wal_debug"
,
PGC_SUSET
},
&
XLOG_DEBUG
,
0
,
0
,
16
,
NULL
,
NULL
0
,
0
,
16
,
NULL
,
NULL
...
...
src/include/access/xlog.h
View file @
63653f7f
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Id: xlog.h,v 1.3
5 2002/08/17 15:12:07
momjian Exp $
* $Id: xlog.h,v 1.3
6 2002/08/30 16:50:50
momjian Exp $
*/
*/
#ifndef XLOG_H
#ifndef XLOG_H
#define XLOG_H
#define XLOG_H
...
@@ -185,7 +185,6 @@ extern XLogRecPtr ProcLastRecEnd;
...
@@ -185,7 +185,6 @@ extern XLogRecPtr ProcLastRecEnd;
/* these variables are GUC parameters related to XLOG */
/* these variables are GUC parameters related to XLOG */
extern
int
CheckPointSegments
;
extern
int
CheckPointSegments
;
extern
int
XLOGbuffers
;
extern
int
XLOGbuffers
;
extern
int
XLOGfiles
;
extern
int
XLOG_DEBUG
;
extern
int
XLOG_DEBUG
;
extern
char
*
XLOG_sync_method
;
extern
char
*
XLOG_sync_method
;
extern
const
char
XLOG_sync_method_default
[];
extern
const
char
XLOG_sync_method_default
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment