Re: slave stops replica

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Pepe TD Vo <pepevo(at)yahoo(dot)com>, Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: slave stops replica
Date: 2021-08-27 15:09:58
Message-ID: aaf2d9ed1a5e8b271bcc0d4bb6a577385a6bb45f.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2021-08-27 at 10:56 +0000, Pepe TD Vo wrote:
> > > I had master slave replica and yesterday the slave server's device was full on /var
> > > where the archive copy from master.  After trying to figure out why the
> > > pg_archivecleanup doesn't work, SA removed all wal files except the  current
> > >
> > > I tried to create a test table on master and didn't see it pick up from slave.
> > > I found out again /var is full. 
> >
> > If you have deleted WAL that has no yet been applied to the standby, replication
> > is broken and you have to build the standby from scratch.
>
> Can we delete the old WALs?

Only the ones you don't need for replication.
Of course, if you rebuild replication from scratch, you can delete the WAL archives.

> May I know what is the retention to perform tuning on the server like Oracle to
> keep only 7 days and why pg_archivecleanup doesn't work?

I guess that pg_archivecleanup doesn't delete anything because it is only
called once replication has processed a WAL segment and doesn't need it any more.

If you are missing a WAL segment because you deleted it, replication gets stuck
at that point and will wait indefinitely for that WAL segment. So nothing is
processedm and nothing is deleted.

A gap in the WAL will stop and break replication, as I said.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Bossart, Nathan 2021-08-27 18:16:01 Re: Estimating HugePages Requirements?
Previous Message Magnus Hagander 2021-08-27 14:40:27 Re: Estimating HugePages Requirements?