Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated

From: Paul Förster <paul(dot)foerster(at)gmail(dot)com>
To: Andrus <kobruleht2(at)hot(dot)ee>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated
Date: 2020-05-31 20:01:43
Message-ID: B7E0C7C6-865B-4632-B10A-11B2E468D40A@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Andrus,

> On 31. May, 2020, at 21:47, Andrus <kobruleht2(at)hot(dot)ee> wrote:
> replikaator(at)[unknown] ERROR: requested WAL segment 00000001000002CF000000E9 has already been removed

the message says it all. You need to copy the WAL file 00000001000002CF000000E9 and newer to the replica's pg_wal directory because it has been removed already on the master site. Obviously, you can only do that if the files have been archived. Otherwise, you'd have to fully reinitiate the replica.

Replication will start again as soon as the requested WALs are copied over to the replica.

Use a replication slot to avoid this situation. If you use a replication slot, the master will only remove WAL files which are not needed by any one replica.

Hope this helps.

Cheers,
Paul

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message tony 2020-05-31 20:10:12 Re: pg_dump of database with numerous objects
Previous Message Adrian Klaver 2020-05-31 19:59:18 Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated