mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Change default values for backup and replication parameters
This changes the default values of the following parameters: wal_level = replica max_wal_senders = 10 max_replication_slots = 10 in order to make it possible to make a backup and set up simple replication on the default settings, without requiring a system restart. Discussion: https://postgr.es/m/CABUevEy4PR_EAvZEzsbF5s+V0eEvw7shJ2t-AUwbHOjT+yRb3A@mail.gmail.com Reviewed by Peter Eisentraut. Benchmark help from Tomas Vondra.
This commit is contained in:
@ -2315,7 +2315,7 @@ static struct config_int ConfigureNamesInt[] =
|
||||
NULL
|
||||
},
|
||||
&max_wal_senders,
|
||||
0, 0, MAX_BACKENDS,
|
||||
10, 0, MAX_BACKENDS,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
@ -2326,7 +2326,7 @@ static struct config_int ConfigureNamesInt[] =
|
||||
NULL
|
||||
},
|
||||
&max_replication_slots,
|
||||
0, 0, MAX_BACKENDS /* XXX? */ ,
|
||||
10, 0, MAX_BACKENDS /* XXX? */ ,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
@ -3749,7 +3749,7 @@ static struct config_enum ConfigureNamesEnum[] =
|
||||
NULL
|
||||
},
|
||||
&wal_level,
|
||||
WAL_LEVEL_MINIMAL, wal_level_options,
|
||||
WAL_LEVEL_REPLICA, wal_level_options,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
|
@ -174,7 +174,7 @@
|
||||
|
||||
# - Settings -
|
||||
|
||||
#wal_level = minimal # minimal, replica, or logical
|
||||
#wal_level = replica # minimal, replica, or logical
|
||||
# (change requires restart)
|
||||
#fsync = on # flush data to disk for crash safety
|
||||
# (turning this off can cause
|
||||
@ -229,12 +229,12 @@
|
||||
|
||||
# Set these on the master and on any standby that will send replication data.
|
||||
|
||||
#max_wal_senders = 0 # max number of walsender processes
|
||||
#max_wal_senders = 10 # max number of walsender processes
|
||||
# (change requires restart)
|
||||
#wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
|
||||
#wal_sender_timeout = 60s # in milliseconds; 0 disables
|
||||
|
||||
#max_replication_slots = 0 # max number of replication slots
|
||||
#max_replication_slots = 10 # max number of replication slots
|
||||
# (change requires restart)
|
||||
#track_commit_timestamp = off # collect timestamp of transaction commit
|
||||
# (change requires restart)
|
||||
|
@ -15,7 +15,6 @@ $master->append_conf(
|
||||
'postgresql.conf', qq{
|
||||
track_commit_timestamp = on
|
||||
max_wal_senders = 5
|
||||
wal_level = hot_standby
|
||||
});
|
||||
$master->start;
|
||||
$master->backup($bkplabel);
|
||||
|
@ -14,7 +14,6 @@ $master->append_conf(
|
||||
'postgresql.conf', qq{
|
||||
track_commit_timestamp = on
|
||||
max_wal_senders = 5
|
||||
wal_level = hot_standby
|
||||
});
|
||||
$master->start;
|
||||
$master->backup($bkplabel);
|
||||
|
@ -415,7 +415,6 @@ sub init
|
||||
|
||||
if ($params{allows_streaming})
|
||||
{
|
||||
print $conf "wal_level = replica\n";
|
||||
print $conf "max_wal_senders = 5\n";
|
||||
print $conf "wal_keep_segments = 20\n";
|
||||
print $conf "max_wal_size = 128MB\n";
|
||||
@ -424,6 +423,11 @@ sub init
|
||||
print $conf "hot_standby = on\n";
|
||||
print $conf "max_connections = 10\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print $conf "wal_level = minimal\n";
|
||||
print $conf "max_wal_senders = 0\n";
|
||||
}
|
||||
|
||||
if ($TestLib::windows_os)
|
||||
{
|
||||
|
@ -10,7 +10,6 @@ my $node_master = get_new_node('master');
|
||||
$node_master->init(allows_streaming => 1);
|
||||
$node_master->append_conf(
|
||||
'postgresql.conf', qq(
|
||||
max_replication_slots = 4
|
||||
wal_level = logical
|
||||
));
|
||||
$node_master->start;
|
||||
|
@ -14,7 +14,6 @@ $node_master->init(allows_streaming => 1);
|
||||
|
||||
$node_master->append_conf('postgresql.conf', qq{
|
||||
fsync = on
|
||||
wal_level = replica
|
||||
wal_log_hints = on
|
||||
max_prepared_transactions = 5
|
||||
autovacuum = off
|
||||
|
Reference in New Issue
Block a user