pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
prevent WAL replication to fill filesystem
5+ messages / 4 participants
[nested] [flat]

* prevent WAL replication to fill filesystem
@ 2021-08-31 08:36 basti <mailinglist@unix-solution.de>
  2021-08-31 08:53 ` Re: prevent WAL replication to fill filesystem Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 5+ messages in thread

From: basti @ 2021-08-31 08:36 UTC (permalink / raw)
  To: pgsql-general

Hello,
I have a old PG 9.6 with WAL replication.
for some reason the rsync was failed and the filesystem was filled by
pg_xlog files.
As result PG stops working.

Is there a way to prevent WAL replication to fill filesystem by xlog
files in case of failure?

Best regards





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: prevent WAL replication to fill filesystem
  2021-08-31 08:36 prevent WAL replication to fill filesystem basti <mailinglist@unix-solution.de>
@ 2021-08-31 08:53 ` Laurenz Albe <laurenz.albe@cybertec.at>
  2021-08-31 09:37   ` Re: prevent WAL replication to fill filesystem Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Laurenz Albe @ 2021-08-31 08:53 UTC (permalink / raw)
  To: basti <mailinglist@unix-solution.de>; pgsql-general

On Tue, 2021-08-31 at 10:36 +0200, basti wrote:
>  have a old PG 9.6 with WAL replication.
> for some reason the rsync was failed and the filesystem was filled by
> pg_xlog files.
> As result PG stops working.
> 
> Is there a way to prevent WAL replication to fill filesystem by xlog
> files in case of failure?

Sure.

Upgrade to v13 and set "max_slot_wal_keep_size".

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






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: prevent WAL replication to fill filesystem
  2021-08-31 08:36 prevent WAL replication to fill filesystem basti <mailinglist@unix-solution.de>
  2021-08-31 08:53 ` Re: prevent WAL replication to fill filesystem Laurenz Albe <laurenz.albe@cybertec.at>
@ 2021-08-31 09:37   ` Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
  2021-09-08 04:07     ` Re: prevent WAL replication to fill filesystem Ninad Shah <nshah.postgres@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Jehan-Guillaume de Rorthais @ 2021-08-31 09:37 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: basti <mailinglist@unix-solution.de>; pgsql-general

On Tue, 31 Aug 2021 10:53:45 +0200
Laurenz Albe <laurenz.albe@cybertec.at> wrote:

> On Tue, 2021-08-31 at 10:36 +0200, basti wrote:
> >  have a old PG 9.6 with WAL replication.
> > for some reason the rsync was failed and the filesystem was filled by
> > pg_xlog files.
> > As result PG stops working.
> > 
> > Is there a way to prevent WAL replication to fill filesystem by xlog
> > files in case of failure?  

No. 

You have to size your partition big enough to handle few days of normal
WAL production, monitor the archiving success and react quickly to fix things
when it fails.

> Upgrade to v13 and set "max_slot_wal_keep_size".

How this would prevent the failure if $OP doesn't (want to) use slots ? He
speaks about rsync, so it might be purely archiving error, not streaming.

Regards,





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: prevent WAL replication to fill filesystem
  2021-08-31 08:36 prevent WAL replication to fill filesystem basti <mailinglist@unix-solution.de>
  2021-08-31 08:53 ` Re: prevent WAL replication to fill filesystem Laurenz Albe <laurenz.albe@cybertec.at>
  2021-08-31 09:37   ` Re: prevent WAL replication to fill filesystem Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
@ 2021-09-08 04:07     ` Ninad Shah <nshah.postgres@gmail.com>
  2021-09-08 06:39       ` Re: prevent WAL replication to fill filesystem Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Ninad Shah @ 2021-09-08 04:07 UTC (permalink / raw)
  To: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; basti <mailinglist@unix-solution.de>; pgsql-general

These suggestions are appropriate. However, if you are ready to lose your
replica to keep production running, there are a couple of methods.

1) Set archive_command to "/bin/true"
2) rename .ready files in archive_status to .done.

Again, I personally do not recommend this, so consider this as a last
resort to save your system from the space crunch issue.


Regards,
Ninad Shah


On Tue, 31 Aug 2021 at 15:08, Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
wrote:

> On Tue, 31 Aug 2021 10:53:45 +0200
> Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> > On Tue, 2021-08-31 at 10:36 +0200, basti wrote:
> > >  have a old PG 9.6 with WAL replication.
> > > for some reason the rsync was failed and the filesystem was filled by
> > > pg_xlog files.
> > > As result PG stops working.
> > >
> > > Is there a way to prevent WAL replication to fill filesystem by xlog
> > > files in case of failure?
>
> No.
>
> You have to size your partition big enough to handle few days of normal
> WAL production, monitor the archiving success and react quickly to fix
> things
> when it fails.
>
> > Upgrade to v13 and set "max_slot_wal_keep_size".
>
> How this would prevent the failure if $OP doesn't (want to) use slots ? He
> speaks about rsync, so it might be purely archiving error, not streaming.
>
> Regards,
>
>
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: prevent WAL replication to fill filesystem
  2021-08-31 08:36 prevent WAL replication to fill filesystem basti <mailinglist@unix-solution.de>
  2021-08-31 08:53 ` Re: prevent WAL replication to fill filesystem Laurenz Albe <laurenz.albe@cybertec.at>
  2021-08-31 09:37   ` Re: prevent WAL replication to fill filesystem Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
  2021-09-08 04:07     ` Re: prevent WAL replication to fill filesystem Ninad Shah <nshah.postgres@gmail.com>
@ 2021-09-08 06:39       ` Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Jehan-Guillaume de Rorthais @ 2021-09-08 06:39 UTC (permalink / raw)
  To: Ninad Shah <nshah.postgres@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; basti <mailinglist@unix-solution.de>; pgsql-general



Le 8 septembre 2021 06:07:15 GMT+02:00, Ninad Shah <nshah.postgres@gmail.com> a écrit :
>These suggestions are appropriate. However, if you are ready to lose your
>replica to keep production running, there are a couple of methods.
>
>1) Set archive_command to "/bin/true"
>2) rename .ready files in archive_status to .done.

You do not need to rename files in archive_status, especially after setting /bin/true. The normal production, if running, will soon enough clean everything, quickly.

A good advice is to never do writes in pg_wal yoursef (mv, rm, edit, etc).





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-09-08 06:39 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 08:36 prevent WAL replication to fill filesystem basti <mailinglist@unix-solution.de>
2021-08-31 08:53 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-08-31 09:37   ` Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
2021-09-08 04:07     ` Ninad Shah <nshah.postgres@gmail.com>
2021-09-08 06:39       ` Jehan-Guillaume de Rorthais <jgdr@dalibo.com>

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