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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, david(dot)g(dot)johnston(at)gmail(dot)com, 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-07-06 00:02:33
Message-ID: 2040586.1657065753@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Japin Li <japinli(at)hotmail(dot)com> writes:
> [ v4-wal-level-documentation.patch ]

Hm, I don't care for the wording here:

+ A precondition for using minimal WAL is to disable WAL archiving and
+ streaming replication by setting <varname>archive_mode</varname> to
+ <literal>off</literal>, and <xref linkend="guc-max-wal-senders"/> to
+ <literal>0</literal>.

"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."

+ servers. If setting <varname>max_wal_senders</varname> to
+ <literal>0</literal> consider also reducing the amount of WAL produced
+ by changing <varname>wal_level</varname> to <literal>minimal</literal>.

I don't think this is great advice. It will encourage people to use
wal_level = minimal even if they have other requirements that weigh
against it. If they feel that their system is producing too much
WAL, I doubt they'll have a hard time finding the wal_level knob.

TBH, I think the real problem with the docs in this area is that
the first para about wal_level is disjointed and unclear; we ought
to nuke and rewrite that. In particular it fails to provide adequate
context about what "logical decoding" means. I think possibly what
it needs to say is that replica mode supports *physical* replication
but if you want to use *logical* replication you need logical mode;
if you need neither, and are not doing WAL archiving either, you
can get away with minimal mode.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-06 00:12:09 Re: doc: Clarify Routines and Extension Membership
Previous Message Michael Paquier 2022-07-05 23:57:24 Re: avoid multiple hard links to same WAL file after a crash