mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Change the logic to decide when to delete old WAL segments, so that it
doesn't take into account how far the WAL senders are. This way a hung WAL sender doesn't prevent old WAL segments from being recycled/removed in the primary, ultimately causing the disk to fill up. Instead add standby_keep_segments setting to control how many old WAL segments are kept in the primary. This also makes it more reliable to use streaming replication without WAL archiving, assuming that you set standby_keep_segments high enough.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.546 2010/04/01 00:43:29 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.547 2010/04/12 09:52:29 heikki Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@ -1647,6 +1647,15 @@ static struct config_int ConfigureNamesInt[] =
|
||||
0, 0, 60, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"standby_keep_segments", PGC_SIGHUP, WAL_CHECKPOINTS,
|
||||
gettext_noop("Sets the number of WAL files held for standby servers"),
|
||||
NULL
|
||||
},
|
||||
&StandbySegments,
|
||||
0, 0, INT_MAX, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"checkpoint_segments", PGC_SIGHUP, WAL_CHECKPOINTS,
|
||||
gettext_noop("Sets the maximum distance in log segments between automatic WAL checkpoints."),
|
||||
|
Reference in New Issue
Block a user