Re: How to prevent master server crash if hot standby stops

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to prevent master server crash if hot standby stops
Date: 2020-04-06 08:28:41
Message-ID: 20200406082841.GB523433@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 06, 2020 at 11:03:20AM +0300, Andrus wrote:
> If slave stops responing, master server will create files in pg_wal directory.
> If disk becomes full, master server crashes also.
>
> How to avoid this ?
>
> If disk is nearly full, master should stop additional files creation
> (and maybe stop or disable replication slot).
> Postgres 12 in Debian 10 is used.

When you use replication slots, it is very important to put in place a
monitoring solution to check if too much WAL is retained, and note
that there is nothing able to do that natively in core Postgres.
There are however multiple ways to solve this problem, like a
background worker (for the slot monitoring as well as optionally
killing and/or dropping), a simple cron job or even check_postgres.
--
Michael

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-04-06 08:33:14 Re: Server with hot standby slave wont start after vacuum
Previous Message Laurenz Albe 2020-04-06 08:27:05 Re: How to prevent master server crash if hot standby stops