From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Andrew Anderson <forumwriter007@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: WAL-files is not removing authomaticaly
Date: Thu, 11 Mar 2021 10:18:07 +0100
Message-ID: <8824049ee9e1f6476cf65ebb156c71fb2b44fa87.camel@cybertec.at> (raw)
In-Reply-To: <CAHAzDikSTvg5y8u-sNbpTNtQ_p3jWjhJBzPDMW1pU5T1x-MKFQ@mail.gmail.com>
References: <CAHAzDi=7s2UpiFKQyQb+yNqFLaL3jrH=n2z=f52U8fc=QXbc7Q@mail.gmail.com>
<7eee13c535a2f1de6e8dece0791531f3dc7f2c0e.camel@cybertec.at>
<CAHAzDikSTvg5y8u-sNbpTNtQ_p3jWjhJBzPDMW1pU5T1x-MKFQ@mail.gmail.com>
On Thu, 2021-03-11 at 09:43 +0200, Andrew Anderson wrote:
> > Never, ever, remove WAL files manually.
> > A crash might render your database unrecoverable.
> You're right, it's not a good idea.
>
> > You'll have to figure out what is blocking WAL removal.
> This is my favorite dream!
>
> > Are there archive failures reported in "pg_stat_archiver" and the log?
> master=# select * from pg_stat_archiver;
> archived_count | last_archived_wal | last_archived_time | failed_count | last_failed_wal | last_failed_time | stats_reset
> ----------------+--------------------------+-------------------------------+--------------+-----------------+------------------+------------------------------
> 3021 | 000000010000000B000000C9 | 2021-03-11 08:53:56.133796+02 | 0 | | | 2021-01-06 14:33:40.70147+02
> (1 row)
>
> In today's logs there is no any errors:
> $ grep "FATAL\|WARNING" /opt/pglogs/master.log
> $
>
> $ grep "FATAL\|WARNING" /opt/pglogs/slave.log
> $
>
> > You say that replication is working fine, but try
> >
> > SELECT pg_current_wal_lsn();
> >
> > on the primary and compare that with the "restart_lsn" of the replication slot.
>
> It parameters is differ:
> master=# SELECT pg_current_wal_lsn();
> pg_current_wal_lsn
> --------------------
> B/CB099398
> (1 row)
>
> master=# select * from pg_replication_slots;
> slot_name | plugin | slot_type | datoid | database | temporary | active | active_pid | xmin | catalog_xmin | restart_lsn | confirmed_flush_lsn
> ----------------------+--------+-----------+--------+----------+-----------+--------+------------+------+--------------+-------------+---------------------
> standby_slot | | physical | | | f | t | 2631806 | | | B/CB0AC068 |
> (1 row)
>
> But when I add new data to the table on master, it apears on slave.
>
> > Look for strange messages in the log file on both servers.
> Looking for strange messages gives nothing, in today's logs there is no any strange messages, just about connects of applications.
All that looks fine.
If that happens again, set "log_min_messages" to "debug2".
Then the log file will contain information abotu the WAL segments that
PostgreSQL is trying to remove. That might give you some insight.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, forumwriter007@gmail.com
Subject: Re: WAL-files is not removing authomaticaly
In-Reply-To: <8824049ee9e1f6476cf65ebb156c71fb2b44fa87.camel@cybertec.at>
References: <CAHAzDi=7s2UpiFKQyQb+yNqFLaL3jrH=n2z=f52U8fc=QXbc7Q@mail.gmail.com> <7eee13c535a2f1de6e8dece0791531f3dc7f2c0e.camel@cybertec.at> <CAHAzDikSTvg5y8u-sNbpTNtQ_p3jWjhJBzPDMW1pU5T1x-MKFQ@mail.gmail.com> <8824049ee9e1f6476cf65ebb156c71fb2b44fa87.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox