From: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
---|---|
To: | Thom Brown <thom(at)linux(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Blank archive_command |
Date: | 2022-01-17 15:25:14 |
Message-ID: | CALj2ACUt0QBfBUA767qN618OA3=stL-AepFJZDAyFR72Rm+45A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Jan 17, 2022 at 8:14 PM Thom Brown <thom(at)linux(dot)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.
From | Date | Subject | |
---|---|---|---|
Next Message | houzj.fnst@fujitsu.com | 2022-01-17 15:28:17 | RE: row filtering for logical replication |
Previous Message | Andrew Dunstan | 2022-01-17 15:25:12 | Re: Adding CI to our tree |