On Fri, Jul 15, 2022 at 09:29:20PM +0800, Japin Li wrote:
>
> On Fri, 15 Jul 2022 at 08:49, Bruce Momjian <[email protected]> wrote:
> > On Tue, Jul 5, 2022 at 08:02:33PM -0400, Tom Lane wrote:
> >> "Precondition" is an overly fancy word that makes things less clear
> >> not more so. Does it mean that setting wal_level = minimal will fail
> >> if you don't do these other things, or does it just mean that you
> >> won't be getting the absolute minimum WAL volume? If the former,
> >> I think it'd be better to say something like "To set wal_level to minimal,
> >> you must also set [these variables], which has the effect of disabling
> >> both WAL archiving and streaming replication."
> >
> > I have created the attached patch to try to improve this text.
>
> IMO we can add the following sentence for wal_level description, since
> if wal_level = minimal and max_wal_senders > 0, we cannot start the database.
>
> To set wal_level to minimal, you must also set max_wal_senders to 0,
> which has the effect of disabling both WAL archiving and streaming
> replication.
Okay, text added in the attached patch.
--
Bruce Momjian <[email protected]> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 37fd80388c..4c0489c9c3 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -2764,9 +2764,10 @@ include_dir 'conf.d'
levels. This parameter can only be set at server start.
</para>
<para>
- In <literal>minimal</literal> level, no information is logged for
- permanent relations for the remainder of a transaction that creates or
- rewrites them. This can make operations much faster (see
+ The <literal>minimal</literal> level generates the least WAL
+ volume. It logs no row information for permanent relations
+ in transactions that create or
+ rewrite them. This can make operations much faster (see
<xref linkend="populate-pitr"/>). Operations that initiate this
optimization include:
<simplelist>
@@ -2778,19 +2779,20 @@ include_dir 'conf.d'
<member><command>REINDEX</command></member>
<member><command>TRUNCATE</command></member>
</simplelist>
- But minimal WAL does not contain enough information to reconstruct the
- data from a base backup and the WAL logs, so <literal>replica</literal> or
- higher must be used to enable WAL archiving
- (<xref linkend="guc-archive-mode"/>) and streaming replication.
+ However, minimal WAL does not contain sufficient information for
+ point-in-time recovery, so <literal>replica</literal> or
+ higher must be used to enable continuous archiving
+ (<xref linkend="guc-archive-mode"/>) and streaming binary replication.
+ In fact, the server will not even start in this mode if
+ <varname>max_wal_senders</varname> is non-zero.
Note that changing <varname>wal_level</varname> to
- <literal>minimal</literal> makes any base backups taken before
- unavailable for archive recovery and standby server, which may
- lead to data loss.
+ <literal>minimal</literal> makes any base backups taken before this
+ unusable for point-in-time recovery and standby servers.
</para>
<para>
In <literal>logical</literal> level, the same information is logged as
- with <literal>replica</literal>, plus information needed to allow
- extracting logical change sets from the WAL. Using a level of
+ with <literal>replica</literal>, plus information needed to
+ extract logical change sets from the WAL. Using a level of
<literal>logical</literal> will increase the WAL volume, particularly if many
tables are configured for <literal>REPLICA IDENTITY FULL</literal> and
many <command>UPDATE</command> and <command>DELETE</command> statements are