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

Commitf6d6d29

Browse files
committed
Change default values for backup and replication parameters
This changes the default values of the following parameters:wal_level = replicamax_wal_senders = 10max_replication_slots = 10in order to make it possible to make a backup and set up simplereplication on the default settings, without requiring a system restart.Discussion:https://postgr.es/m/CABUevEy4PR_EAvZEzsbF5s+V0eEvw7shJ2t-AUwbHOjT+yRb3A@mail.gmail.comReviewed by Peter Eisentraut. Benchmark help from Tomas Vondra.
1 parent05cd12e commitf6d6d29

File tree

9 files changed

+21
-20
lines changed

9 files changed

+21
-20
lines changed

‎doc/src/sgml/backup.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1420,7 +1420,8 @@ restore_command = 'cp /mnt/server/archivedir/%f %p'
14201420
<para>
14211421
If more flexibility in copying the backup files is needed, a lower
14221422
level process can be used for standalone hot backups as well.
1423-
To prepare for low level standalone hot backups, set <varname>wal_level</> to
1423+
To prepare for low level standalone hot backups, make sure
1424+
<varname>wal_level</> is set to
14241425
<literal>replica</> or higher, <varname>archive_mode</> to
14251426
<literal>on</>, and set up an <varname>archive_command</> that performs
14261427
archiving only when a <emphasis>switch file</> exists. For example:

‎doc/src/sgml/config.sgml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,12 +2183,12 @@ include_dir 'conf.d'
21832183
</term>
21842184
<listitem>
21852185
<para>
2186-
<varname>wal_level</> determines how much information is written
2187-
tothe WAL. The default value is <literal>minimal</>, which writes
2188-
only the information neededtorecover from a crash or immediate
2189-
shutdown. <literal>replica</>adds logging required for WAL
2190-
archiving as well asinformation required torun
2191-
read-only queries on a standby server. Finally,
2186+
<varname>wal_level</> determines how much information is written to
2187+
the WAL. The default value is <literal>replica</>, which writes enough
2188+
datatosupport WAL archiving and replication, including running
2189+
read-only queries on a standby server. <literal>minimal</>removes all
2190+
logging except theinformation required torecover from a crash or
2191+
immediate shutdown. Finally,
21922192
<literal>logical</> adds information necessary to support logical
21932193
decoding. Each level includes the information logged at all lower
21942194
levels. This parameter can only be set at server start.
@@ -2926,7 +2926,7 @@ include_dir 'conf.d'
29262926
Specifies the maximum number of concurrent connections from
29272927
standby servers or streaming base backup clients (i.e., the
29282928
maximum number of simultaneously running WAL sender
2929-
processes). The default iszero, meaning replication is
2929+
processes). The default is10. The value 0 means replication is
29302930
disabled. WAL sender processes count towards the total number
29312931
of connections, so the parameter cannot be set higher than
29322932
<xref linkend="guc-max-connections">. Abrupt streaming client
@@ -2951,7 +2951,7 @@ include_dir 'conf.d'
29512951
<para>
29522952
Specifies the maximum number of replication slots
29532953
(see <xref linkend="streaming-replication-slots">) that the server
2954-
can support. The default iszero. This parameter can only be set at
2954+
can support. The default is10. This parameter can only be set at
29552955
server start.
29562956
<varname>wal_level</varname> must be set
29572957
to <literal>replica</literal> or higher to allow replication slots to

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ static struct config_int ConfigureNamesInt[] =
23152315
NULL
23162316
},
23172317
&max_wal_senders,
2318-
0,0,MAX_BACKENDS,
2318+
10,0,MAX_BACKENDS,
23192319
NULL,NULL,NULL
23202320
},
23212321

@@ -2326,7 +2326,7 @@ static struct config_int ConfigureNamesInt[] =
23262326
NULL
23272327
},
23282328
&max_replication_slots,
2329-
0,0,MAX_BACKENDS/* XXX? */ ,
2329+
10,0,MAX_BACKENDS/* XXX? */ ,
23302330
NULL,NULL,NULL
23312331
},
23322332

@@ -3749,7 +3749,7 @@ static struct config_enum ConfigureNamesEnum[] =
37493749
NULL
37503750
},
37513751
&wal_level,
3752-
WAL_LEVEL_MINIMAL,wal_level_options,
3752+
WAL_LEVEL_REPLICA,wal_level_options,
37533753
NULL,NULL,NULL
37543754
},
37553755

‎src/backend/utils/misc/postgresql.conf.sample

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174

175175
# - Settings -
176176

177-
#wal_level =minimal# minimal, replica, or logical
177+
#wal_level =replica# minimal, replica, or logical
178178
# (change requires restart)
179179
#fsync = on# flush data to disk for crash safety
180180
# (turning this off can cause
@@ -229,12 +229,12 @@
229229

230230
# Set these on the master and on any standby that will send replication data.
231231

232-
#max_wal_senders =0# max number of walsender processes
232+
#max_wal_senders =10# max number of walsender processes
233233
# (change requires restart)
234234
#wal_keep_segments = 0# in logfile segments, 16MB each; 0 disables
235235
#wal_sender_timeout = 60s# in milliseconds; 0 disables
236236

237-
#max_replication_slots =0# max number of replication slots
237+
#max_replication_slots =10# max number of replication slots
238238
# (change requires restart)
239239
#track_commit_timestamp = off# collect timestamp of transaction commit
240240
# (change requires restart)

‎src/test/modules/commit_ts/t/002_standby.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
'postgresql.conf',qq{
1616
track_commit_timestamp = on
1717
max_wal_senders = 5
18-
wal_level = hot_standby
1918
});
2019
$master->start;
2120
$master->backup($bkplabel);

‎src/test/modules/commit_ts/t/003_standby_2.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
'postgresql.conf',qq{
1515
track_commit_timestamp = on
1616
max_wal_senders = 5
17-
wal_level = hot_standby
1817
});
1918
$master->start;
2019
$master->backup($bkplabel);

‎src/test/perl/PostgresNode.pm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ sub init
415415

416416
if ($params{allows_streaming})
417417
{
418-
print$conf"wal_level = replica\n";
419418
print$conf"max_wal_senders = 5\n";
420419
print$conf"wal_keep_segments = 20\n";
421420
print$conf"max_wal_size = 128MB\n";
@@ -424,6 +423,11 @@ sub init
424423
print$conf"hot_standby = on\n";
425424
print$conf"max_connections = 10\n";
426425
}
426+
else
427+
{
428+
print$conf"wal_level = minimal\n";
429+
print$conf"max_wal_senders = 0\n";
430+
}
427431

428432
if ($TestLib::windows_os)
429433
{

‎src/test/recovery/t/006_logical_decoding.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
$node_master->init(allows_streaming=> 1);
1111
$node_master->append_conf(
1212
'postgresql.conf',qq(
13-
max_replication_slots = 4
1413
wal_level = logical
1514
));
1615
$node_master->start;

‎src/test/recovery/t/008_fsm_truncation.pl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
$node_master->append_conf('postgresql.conf',qq{
1616
fsync = on
17-
wal_level = replica
1817
wal_log_hints = on
1918
max_prepared_transactions = 5
2019
autovacuum = off

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp