Re: Doc about how to set max_wal_senders when setting minimal wal_level

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Doc about how to set max_wal_senders when setting minimal wal_level
Date: 2022-03-03 03:25:52
Message-ID: CAKFQuwZ24UcfkoyLLSW3PMGQATomOcw1nuYFRuMev-NoOF+mYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 2, 2022 at 7:44 PM Japin Li <japinli(at)hotmail(dot)com> wrote:

>
> Hi, hackers
>
> When I try to change wal_level to minimal and restart the database, it
> complains
> max_wal_senders > 0.
>
> 2022-03-03 10:10:16.938 CST [6389] FATAL: WAL streaming (max_wal_senders
> > 0) requires wal_level "replica" or "logical"
>
> However, the documentation about wal_level [1] doesn't mentation this.
> How about adding a sentence to describe how to set max_wal_senders when
> setting wal_level to minimal?
>
> [1] https://www.postgresql.org/docs/devel/runtime-config-wal.html
>
>
I would suggest a wording more like:

"A precondition for using minimal WAL is to disable WAL archiving and
streaming replication by setting max_wal_senders to 0, and archive_mode to
off."

While accurate, the phrase "you must set" just doesn't feel right to me. I
also don't like how the proposed sentence (either one) is added separately
as opposed to being included in the immediately preceding paragraph. While
this limited patch is probably sufficient I would suggest trying to work
out a slightly larger patch the improves the wording on the entire existing
paragraph while incorporating the reference to max_wal_senders.

Note, we seem to be missing the documentation of the default setting for
archive_mode.

In addition, max_wal_senders could also be changed, adding a sentence like:

"If setting max_wal_senders to 0 consider also reducing the amount of WAL
produced by changing wal_level to minimal."

At least insofar as core is concerned without a wal sender the additional
wal of replica is not actually able to be leveraged as pg_basebackup will
not work (at noted in its own description).

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message osumi.takamichi@fujitsu.com 2022-03-03 03:28:19 RE: Failed transaction statistics to measure the logical replication progress
Previous Message Amit Kapila 2022-03-03 03:15:17 Re: PG DOCS - logical replication filtering