Re: Important lag in replication streaming between master and standby

From: Luca Ferrari <fluca1978(at)gmail(dot)com>
To: Mai Peng <maily(dot)peng(at)webedia-group(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Important lag in replication streaming between master and standby
Date: 2019-08-27 07:42:44
Message-ID: CAKoxK+6GOq-3C8OftzyU0ksrcDC_aqe6xX_+CyLhYw8LJrPj2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Aug 26, 2019 at 5:21 PM Mai Peng <maily(dot)peng(at)webedia-group(dot)com> wrote:
>
> Hello,
>
> I’ve got several times this error : "requested WAL segment 000000020000A01A0000004F has already been remove". I think it’s due to the lag between our master in EU zone and our standby in US zone.
> How could we configure Postgres to handle this issue?

As others already stated, you can use either wal_keep_segments or
replication_slots with advantages and drawbacks on both sides. One
thing to point out, also, since you did not provide a lot of
information, is that if you have another slave consuming wals, it
could remove (archive_cleanup) segments ignoring other slaves.

Personally, I would go for a replication slot and see if the lag can
be kept under control (i.e., the pg_wal directory does not grow too
much).

Luca

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message AL-Temimi, Muthana 2019-08-27 08:45:44 question
Previous Message soumitra bhandary 2019-08-26 15:45:52 Re: Important lag in replication streaming between master and standby