Re: Fix documentation for max_wal_size and min_wal_size - Mailing list pgsql-hackers

From Kyotaro Horiguchi
Subject Re: Fix documentation for max_wal_size and min_wal_size
Date
Msg-id 20230424.105756.1969024932825529791.horikyota.ntt@gmail.com
Whole thread Raw
In response to Re: Fix documentation for max_wal_size and min_wal_size  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: Fix documentation for max_wal_size and min_wal_size  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
At Sat, 22 Apr 2023 18:52:27 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in 
> If the WAL segment size is changed from the default value of 16MB
> during initdb,
> the value of min_wal_size in postgresql.conf is set to five times the
> new segment
> size by initdb. However, pg_settings.boot_val (the value of
> min_wal_size used
> when the parameter is not otherwise set) is still 80MB. So if
> pg_settings.boot_val
> should be documented as the default value, the current description
> seems OK.

Hmm, things are a bit more complex than I initially thought. The value is actually set in the configuration file, but
thelines are added by initdb.  The documentation states the following.
 

https://www.postgresql.org/docs/devel/view-pg-settings.html
> boot_val text
>  Parameter value assumed at server startup if the parameter is not
>  otherwise set

So, the description is accurate as it stands. If I remove the lines, they will revert to the default values.


> Or we can clarify that the default value of min_wal_size is 80MB, but
> when initdb
> is run with a non-default segment size, the value in postgresql.conf
> is changed
> to five times the new segment size? This will help users better
> understand
> the behavior of the setting and how it is affected by changes made
> during initdb.

So, to clarify the situation, I would phrase it like this:

The default size is 80MB. Note that if you have changed the WAL
segment size from the default of 16MB with the initdb option
--wal-segsize, the tool should have added the settings with the values
equal to five times the specified segment size to the configuration
file.

It might be a bit wordy, though..

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Fix documentation for max_wal_size and min_wal_size