pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Subject: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated
Date: Sun, 31 May 2020 22:47:44 +0300
Message-ID: <26EC9619620649D1B55C9C95811E4ADB@dell2> (raw)

Hi!

pg_basebackup takes 8 hours.
After it is finished,  replication slave does not start:

LOG:  consistent recovery state reached at 2DE/985A5BE0
LOG:  database system is ready to accept read only connections
LOG:  started streaming WAL from primary at 2DE/99000000 on timeline 1
replikaator@[unknown] LOG:  received replication command: SHOW data_directory_mode
replikaator@[unknown] LOG:  received replication command: IDENTIFY_SYSTEM
replikaator@[unknown] LOG:  received replication command: START_REPLICATION 2CF/E9000000 TIMELIN
replikaator@[unknown] ERROR:  requested WAL segment 00000001000002CF000000E9 has already been re
replikaator@[unknown] LOG:  received replication command: SHOW data_directory_mode
replikaator@[unknown] LOG:  received replication command: IDENTIFY_SYSTEM
replikaator@[unknown] LOG:  received replication command: START_REPLICATION 2CF/E9000000 TIMELIN
replikaator@[unknown] ERROR:  requested WAL segment 00000001000002CF000000E9 has already been removed
...

i tried it again and same error occured.

How to force replication to start?

I increased wal parameters in master to

wal_compression=on
max_wal_size = 5GB
min_wal_size = 4GB # was 80MB
wal_keep_segments= 360 # was 180

Will this allow replication to start after pg_basebackup ?

According to doc min_wal_size and wal_keep_segments both keep the minimum number of wal segments for replication.
Why those parameters are duplicated?

Andrus.





view thread (17+ messages)  latest in thread

Message-ID: <26EC9619620649D1B55C9C95811E4ADB@dell2>
Permalink:  ../26EC9619620649D1B55C9C95811E4ADB@dell2/
Also on:    postgresql.org/message-id/26EC9619620649D1B55C9C95811E4ADB@dell2

 · 

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: kobruleht2@hot.ee
  Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated
  In-Reply-To: <26EC9619620649D1B55C9C95811E4ADB@dell2>
  References: <26EC9619620649D1B55C9C95811E4ADB@dell2>

* 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