Streaming Replication Error

From: <soumik(dot)bhattacharjee(at)kpn(dot)com>
To: <pgsql-admin(at)lists(dot)postgresql(dot)org>, <pgsql-admin(at)postgresql(dot)org>
Subject: Streaming Replication Error
Date: 2019-12-20 16:08:33
Message-ID: 2A91BEF8171A5349931391E0C721CC537D772A5F@CPEMS-KPN501.KPNCNL.LOCAL
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Experts,

I have set up streaming replication on PostgreSQL 12.1

The master and slave are configured as below and WAL files are accumulating on the master.

However, something is wrong as I get complaints that the WAL files are missing after a pg_restore on MASTER

MASTER

postgres(at)srvm:~$ 2019-12-20 16:35:07.910 CET [1334] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:12.920 CET [1338] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:17.925 CET [1340] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:22.932 CET [1362] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:27.935 CET [1364] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:32.942 CET [1365] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:37.948 CET [1366] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:35:42.954 CET [1367] replicator(at)[unknown] ERROR: requested WAL segment 000000010000000100000076 has already been removed

SLAVE

postgres(at)srvs:~$ 2019-12-20 16:36:53.027 CET [21978] LOG: started streaming WAL from primary at 1/76000000 on timeline 1
2019-12-20 16:36:53.027 CET [21978] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:36:58.029 CET [21979] LOG: started streaming WAL from primary at 1/76000000 on timeline 1
2019-12-20 16:36:58.029 CET [21979] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:37:03.040 CET [21980] LOG: started streaming WAL from primary at 1/76000000 on timeline 1
2019-12-20 16:37:03.040 CET [21980] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000000100000076 has already been removed
2019-12-20 16:37:08.042 CET [21981] LOG: started streaming WAL from primary at 1/76000000 on timeline 1
2019-12-20 16:37:08.042 CET [21981] FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000010000000100000076 has already been removed

Then the pg_basebackup is run and the slave started.

The slave has all the data as of the time of the backup, but no new data from the WAL files, and the error above.

max_wal_senders = 10
wal_keep_segments = 120

What have I mis-configured? Do we need to enabled archive_mode = on for streaming replication?

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jeff Janes 2019-12-20 16:44:39 Re: Streaming Replication Error
Previous Message Pepe TD Vo 2019-12-20 13:13:49 Re: backup script error with could not connect to database