Re: BUG #14963: Number of wal files are keep on increasing - Mailing list pgsql-bugs

From Raghavendra Rao J S V
Subject Re: BUG #14963: Number of wal files are keep on increasing
Date
Msg-id CAEHH7R50pwkKJ13NPxxA3od+oL3pOX9vMAdxMxFzaRaKo9m0xg@mail.gmail.com
Whole thread Raw
In response to BUG #14963: Number of wal files are keep on increasing  (raghavendrajsv@gmail.com)
Responses Re: BUG #14963: Number of wal files are keep on increasing  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-bugs
Thank you very much for your explanation.

We are taking the backup of database everyday using pg_basebackup utility. We have implemented a pg_basebackup utility through shell script.This will be invoked everyday at 2AM and takes the backup of database.

We don't have any building standby server. In order to take the backup of the database through pg_basebackup utility, we have enable below things.

wal_level = archive
archive_mode = on
max_wal_senders = 1

Through your update, I understand we haven't enabled archive_command (#archive_command = '') due to this number of wal files are keep on growing in pg_xlog. How to meet my requirement? Please guide me .

Regards,
Raghavendra Rao



On Tue, Dec 12, 2017 at 2:32 PM, Francisco Olarte <folarte@peoplecall.com> wrote:
Raghavendra :

On Tue, Dec 12, 2017 at 9:52 AM, Raghavendra Rao J S V
<raghavendrajsv@gmail.com> wrote:
> Below error is there in several times in log file.
> WARNING,01000,"archive_mode enabled, yet archive_command is not
> set",,,,,,,,,""

This tells it all.

Archive mode tells postgres you want to keep all the log files, for
backup purposes or building standby or whatever.

To implement this postgres calls your archive_command to copy the log
files, and if it fails logs and KEEPS the file, assuming it will
succeed later, but it doesn't delete them, as postgres tries very hard
to avoid loosing any data.

In your case you should probably disable archive mode, since you are
not archiving. Or maybe implement archive command ( see the section on
archiving on the docs ).

Also note your are hitting this behaviour for archive_command,
explicitly written in the docs: "If archive_command is an empty string
(the default) while archive_mode is enabled, WAL archiving is
temporarily disabled, but the server continues to accumulate WAL
segment files in the expectation that a command will soon be provided.
"

This is for situation like a change in log storage, postgres
accumulates logs until you finish the switch, then you restart with a
new working archive command and all the logs are copied and deleted.

Francisco Olarte.



--
Regards,
Raghavendra Rao J S V
Mobile- 8861161425

pgsql-bugs by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re: BUG #14963: Number of wal files are keep on increasing
Next
From: martinsson.patrik@gmail.com
Date:
Subject: BUG #14967: Postgresql won't start after upgrade frompostgresql93-9.3.20-1PGDG.rhel7.x86_64