mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Rename standby_keep_segments to wal_keep_segments.
Also, make the name of the GUC and the name of the backing variable match. Alnong the way, clean up a couple of slight typographical errors in the related docs.
This commit is contained in:
parent
c670410e7f
commit
481cb5d9b5
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.268 2010/04/19 00:55:25 rhaas Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.269 2010/04/20 11:15:06 rhaas Exp $ -->
|
||||||
|
|
||||||
<chapter Id="runtime-config">
|
<chapter Id="runtime-config">
|
||||||
<title>Server Configuration</title>
|
<title>Server Configuration</title>
|
||||||
@ -1842,10 +1842,10 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="guc-standby-keep-segments" xreflabel="standby_keep_segments">
|
<varlistentry id="guc-wal-keep-segments" xreflabel="wal_keep_segments">
|
||||||
<term><varname>standby_keep_segments</varname> (<type>integer</type>)</term>
|
<term><varname>wal_keep_segments</varname> (<type>integer</type>)</term>
|
||||||
<indexterm>
|
<indexterm>
|
||||||
<primary><varname>standby_keep_segments</> configuration parameter</primary>
|
<primary><varname>wal_keep_segments</> configuration parameter</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@ -1853,17 +1853,17 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
directory, in case a standby server needs to fetch them via streaming
|
directory, in case a standby server needs to fetch them via streaming
|
||||||
replication. Each segment is normally 16 megabytes. If a standby
|
replication. Each segment is normally 16 megabytes. If a standby
|
||||||
server connected to the primary falls behind more than
|
server connected to the primary falls behind more than
|
||||||
<varname>standby_keep_segments</> segments, the primary might remove
|
<varname>wal_keep_segments</> segments, the primary might remove
|
||||||
a WAL segment still needed by the standby and the replication
|
a WAL segment still needed by the standby and the replication
|
||||||
connection will be terminated.
|
connection will be terminated.
|
||||||
|
|
||||||
This sets only the minimum number of segments retained for standby
|
This sets only the minimum number of segments retained for standby
|
||||||
purposes, the system might need to retain more segments for WAL
|
purposes; the system might need to retain more segments for WAL
|
||||||
archival or to recover from a checkpoint. If <varname>standby_keep_segments</>
|
archival or to recover from a checkpoint. If <varname>wal_keep_segments</>
|
||||||
is zero (the default), the system doesn't keep any extra segments
|
is zero (the default), the system doesn't keep any extra segments
|
||||||
for standby purposes, and the number of old WAL segments available
|
for standby purposes, and the number of old WAL segments available
|
||||||
for standbys is determined based only on the location of the previous
|
for standbys is determined based only on the location of the previous
|
||||||
checkpoint and status of WAL archival.
|
checkpoint and status of WAL archiving.
|
||||||
This parameter can only be set in the <filename>postgresql.conf</>
|
This parameter can only be set in the <filename>postgresql.conf</>
|
||||||
file or on the server command line.
|
file or on the server command line.
|
||||||
</para>
|
</para>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.60 2010/04/12 10:01:04 heikki Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.61 2010/04/20 11:15:06 rhaas Exp $ -->
|
||||||
|
|
||||||
<chapter id="high-availability">
|
<chapter id="high-availability">
|
||||||
<title>High Availability, Load Balancing, and Replication</title>
|
<title>High Availability, Load Balancing, and Replication</title>
|
||||||
@ -737,7 +737,7 @@ trigger_file = '/path/to/trigger_file'
|
|||||||
falls behind too much, the primary will delete old WAL files still
|
falls behind too much, the primary will delete old WAL files still
|
||||||
needed by the standby, and the standby will have to be manually restored
|
needed by the standby, and the standby will have to be manually restored
|
||||||
from a base backup. You can control how long the primary retains old WAL
|
from a base backup. You can control how long the primary retains old WAL
|
||||||
segments using the <varname>standby_keep_segments</> setting.
|
segments using the <varname>wal_keep_segments</> setting.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.400 2010/04/18 18:44:53 sriggs Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.401 2010/04/20 11:15:06 rhaas Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
/* User-settable parameters */
|
/* User-settable parameters */
|
||||||
int CheckPointSegments = 3;
|
int CheckPointSegments = 3;
|
||||||
int StandbySegments = 0;
|
int wal_keep_segments = 0;
|
||||||
int XLOGbuffers = 8;
|
int XLOGbuffers = 8;
|
||||||
int XLogArchiveTimeout = 0;
|
int XLogArchiveTimeout = 0;
|
||||||
bool XLogArchiveMode = false;
|
bool XLogArchiveMode = false;
|
||||||
@ -7285,10 +7285,10 @@ CreateCheckPoint(int flags)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Calculate the last segment that we need to retain because of
|
* Calculate the last segment that we need to retain because of
|
||||||
* standby_keep_segments, by subtracting StandbySegments from the
|
* wal_keep_segments, by subtracting wal_keep_segments from the
|
||||||
* new checkpoint location.
|
* new checkpoint location.
|
||||||
*/
|
*/
|
||||||
if (StandbySegments > 0)
|
if (wal_keep_segments > 0)
|
||||||
{
|
{
|
||||||
uint32 log;
|
uint32 log;
|
||||||
uint32 seg;
|
uint32 seg;
|
||||||
@ -7297,8 +7297,8 @@ CreateCheckPoint(int flags)
|
|||||||
|
|
||||||
XLByteToSeg(recptr, log, seg);
|
XLByteToSeg(recptr, log, seg);
|
||||||
|
|
||||||
d_seg = StandbySegments % XLogSegsPerFile;
|
d_seg = wal_keep_segments % XLogSegsPerFile;
|
||||||
d_log = StandbySegments / XLogSegsPerFile;
|
d_log = wal_keep_segments / XLogSegsPerFile;
|
||||||
if (seg < d_seg)
|
if (seg < d_seg)
|
||||||
{
|
{
|
||||||
d_log += 1;
|
d_log += 1;
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.548 2010/04/19 00:55:25 rhaas Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.549 2010/04/20 11:15:06 rhaas Exp $
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------
|
*--------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1656,11 +1656,11 @@ static struct config_int ConfigureNamesInt[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
{"standby_keep_segments", PGC_SIGHUP, WAL_CHECKPOINTS,
|
{"wal_keep_segments", PGC_SIGHUP, WAL_CHECKPOINTS,
|
||||||
gettext_noop("Sets the number of WAL files held for standby servers"),
|
gettext_noop("Sets the number of WAL files held for standby servers"),
|
||||||
NULL
|
NULL
|
||||||
},
|
},
|
||||||
&StandbySegments,
|
&wal_keep_segments,
|
||||||
0, 0, INT_MAX, NULL, NULL
|
0, 0, INT_MAX, NULL, NULL
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
|
|
||||||
#max_wal_senders = 0 # max number of walsender processes
|
#max_wal_senders = 0 # max number of walsender processes
|
||||||
#wal_sender_delay = 200ms # 1-10000 milliseconds
|
#wal_sender_delay = 200ms # 1-10000 milliseconds
|
||||||
#standby_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
|
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.108 2010/04/18 18:17:12 sriggs Exp $
|
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.109 2010/04/20 11:15:06 rhaas Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef XLOG_H
|
#ifndef XLOG_H
|
||||||
#define XLOG_H
|
#define XLOG_H
|
||||||
@ -187,7 +187,7 @@ extern XLogRecPtr XactLastRecEnd;
|
|||||||
|
|
||||||
/* these variables are GUC parameters related to XLOG */
|
/* these variables are GUC parameters related to XLOG */
|
||||||
extern int CheckPointSegments;
|
extern int CheckPointSegments;
|
||||||
extern int StandbySegments;
|
extern int wal_keep_segments;
|
||||||
extern int XLOGbuffers;
|
extern int XLOGbuffers;
|
||||||
extern bool XLogArchiveMode;
|
extern bool XLogArchiveMode;
|
||||||
extern char *XLogArchiveCommand;
|
extern char *XLogArchiveCommand;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user