public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: Nathan Bossart <[email protected]>
Cc: Sergei Kornilov <[email protected]>
Cc: Олег Самойлов <[email protected]>
Cc: [email protected]
Cc: Álvaro Herrera <[email protected]>
Subject: Re: basic_archive lost archive_directory
Date: Tue, 10 Feb 2026 10:23:02 +0900
Message-ID: <CAHGQGwFzC+HYEwJGhpmu1NBiQp_Ln8t0z9CDt8QCQDnUtFAFYA@mail.gmail.com> (raw)
In-Reply-To: <aYpYaRipZ_-lYxNY@nathan>
References: <[email protected]>
	<[email protected]>
	<1317421770387925@cea5cfd9-50d3-4d85-a924-a7cc75f8f215>
	<CAHGQGwF3tFP=oQgYHoS3h9TMeFbZwXc6+xdPTW8CkMV2TkjTmg@mail.gmail.com>
	<aYpYaRipZ_-lYxNY@nathan>

On Tue, Feb 10, 2026 at 6:58 AM Nathan Bossart <[email protected]> wrote:
>
> On Tue, Feb 10, 2026 at 02:46:39AM +0900, Fujii Masao wrote:
> > basic_archive is usually loaded only by the archiver via archive_library.
> > In that case, errors reported by check_archive_directory() are not logged
> > by default, since GUC check hook errors are normally emitted only by
> > the postmaster. As a result, misconfigurations (e.g., a non-existent
> > archive_directory) may go unnoticed, which is problematic for users.
>
> I don't think this is true.  With default parameters, I see the following
> in my logs with a misconfigured archive directory setting:
>
> 2026-02-09 15:53:10.372 CST [12803] WARNING:  invalid value for parameter "basic_archive.archive_directory": "/does/not/exist"
> 2026-02-09 15:53:10.372 CST [12803] DETAIL:  Specified archive directory does not exist.

You're right if an invalid value for basic_archive.archive_directory is detected
at server startup. However, when the setting is changed and the configuration
is reloaded, the default behavior does not emit an error log.
Please see the steps below.

-----------------------------------
initdb -D data
mkdir arch
cat <<EOF >> data/postgresql.conf
archive_mode = on
archive_library = 'basic_archive'
basic_archive.archive_directory = '../arch'
EOF
pg_ctl -D data start
echo "basic_archive.archive_directory = 'not_exists'" >> data/postgresql.conf
pg_ctl -D data reload
-----------------------------------

With these steps, the only log messages I see are:

-----------------------------------
LOG:  received SIGHUP, reloading configuration files
LOG:  parameter "basic_archive.archive_directory" changed to "not_exists"
-----------------------------------

BTW, if basic_archive is specified in shared_preload_libraries, the same steps
produce:

-----------------------------------
LOG:  invalid value for parameter "basic_archive.archive_directory":
"not_exists"
DETAIL:  Specified archive directory does not exist.
LOG:  configuration file "/hoge/data/postgresql.conf" contains errors;
unaffected changes were applied
-----------------------------------

Similarly, lowering the archiver log level to DEBUG3 (for example,
via log_min_messages = 'warning,archiver:debug3') also results in:

-----------------------------------
DEBUG:  invalid value for parameter "basic_archive.archive_directory":
"not_exists"
DETAIL:  Specified archive directory does not exist.
DEBUG:  configuration file
"/System/Volumes/Data/dav/head-pgsql/data/postgresql.conf" contains
errors; unaffected changes were applied
-----------------------------------

This illustrates that, with default settings, the error can go unnoticed
on reload.

Regards,

-- 
Fujii Masao






reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: basic_archive lost archive_directory
  In-Reply-To: <CAHGQGwFzC+HYEwJGhpmu1NBiQp_Ln8t0z9CDt8QCQDnUtFAFYA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox