Re: Blank archive_command - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Blank archive_command
Date
Msg-id CALj2ACUt0QBfBUA767qN618OA3=stL-AepFJZDAyFR72Rm+45A@mail.gmail.com
Whole thread Raw
In response to Blank archive_command  (Thom Brown <thom@linux.com>)
Responses Re: Blank archive_command
Re: Blank archive_command
List pgsql-hackers
On Mon, Jan 17, 2022 at 8:14 PM Thom Brown <thom@linux.com> wrote:
>
> Hi,
>
> Should archive_command being blank when archiving is enabled result in
> a fatal error?  This doesn't even produce a warning when restarting,
> just an entry in the log when it goes to archive a WAL segment, and
> finds the archive_command is empty.
>
> Is there a valid scenario where someone would have archiving enabled
> but no archive command?  Naturally it will build up WAL until it is
> corrected, which will result in a less desirable error, and likely at
> a less convenient time, and to avoid it, someone either has to have
> checked the logs and noticed this error, or got curious as to why
> their WAL collection is nearly running out of shelf space.

Yes, the .ready files under archive_status and wal files under pg_wal
directory grow up with archive_mode on but no archive_command. The
archiver keeps emitting "archive_mode enabled, yet archive_command is
not set" warnings into server logs, maybe this is something that needs
to be monitored for. The expectation is to have a good archiving
configuration setup in place which updates both archive_command and
archive_mode to appropriate values.

The server keeps the WAL files from the point when archive_mode is
enabled, but not from the point when the archive_command is set. The
archive_mode needs postmaster restart whereas archive_command doesn't,
if the archive_command too needed a postmaster restart, then we would
have failed FATALly if archive_command was empty. But making the
archive_command a needs-postmaster-restart class of parameter is not
the path we go IMO because avoiding pomaster restarts in production
environments is to be avoided whenever possible.

An extreme scenario I can think of is if the archive_command is set to
empty by a service layer code. Of course, this is something postgres
doesn't need to care about. However, a reasonable thing to do is to
emit a WARNING or ERROR-out when archive_command is set to null in
it's check_archive_command when archive_mode is on?

Regards,
Bharath Rupireddy.



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Adding CI to our tree
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: row filtering for logical replication