pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: How to prevent master server crash if hot standby stops
Date: Mon, 06 Apr 2020 15:51:07 +0200
Message-ID: <d977eb1f8b4d178a001c5ab613bfa6ae3961426e.camel@cybertec.at> (raw)
In-Reply-To: <0A8FE679886142EBABB0AC8102477904@dell2>
References: <5E2C91B46CEF42078CC7BEE1EDC10F0E@dell2>
	<b23afcd4f436c3310f236086b9daa39304650874.camel@cybertec.at>
	<0A8FE679886142EBABB0AC8102477904@dell2>

On Mon, 2020-04-06 at 11:47 +0300, Andrus wrote:
> > That's why you use monitoring.
> > Never use replication slots without monitoring replication (or at least the
> > disk space on the primary).
> 
> How to implement this automatically, without human interaction required ?
> 
> "superuser_reserved_connections" setting exists.
> How about implementing    "data_reserved_space" setting ?
> 
> How to create procedure in server or maybe cron scipt which stops replication if disk becomes nearly full ?
> 
> How to force to stop replication slot in master if it is in use ?

You don't.

You reserve enough disk space that WAL can grow for a while before
filling the disk.  Any you need to trigger human intervention with
monitoring.

If you prefer replication to fail silently, don't use replication
slots.  Use "wal_keep_segments" instead.

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






view thread (10+ messages)  latest in thread

Message-ID: <d977eb1f8b4d178a001c5ab613bfa6ae3961426e.camel@cybertec.at>
Permalink:  ../d977eb1f8b4d178a001c5ab613bfa6ae3961426e.camel@cybertec.at/
Also on:    postgresql.org/message-id/d977eb1f8b4d178a001c5ab613bfa6ae3961426e.camel@cybertec.at

 · 

reply

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, kobruleht2@hot.ee
  Subject: Re: How to prevent master server crash if hot standby stops
  In-Reply-To: <d977eb1f8b4d178a001c5ab613bfa6ae3961426e.camel@cybertec.at>
  References: <5E2C91B46CEF42078CC7BEE1EDC10F0E@dell2> <b23afcd4f436c3310f236086b9daa39304650874.camel@cybertec.at> <0A8FE679886142EBABB0AC8102477904@dell2> <d977eb1f8b4d178a001c5ab613bfa6ae3961426e.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