public inbox for pgsql-novice@postgresql.org
help / color / mirror / Atom feedFrom: Laurenz Albe <laurenz.albe@cybertec.at>
To: Subramanian,Ramachandran <ramachandran.subramanian@alte-leipziger.de>
To: pgsql-novice@lists.postgresql.org <pgsql-novice@lists.postgresql.org>
Subject: Re: Replication Testing- How to introduce a Lag
Date: Fri, 20 Mar 2026 08:40:43 +0100
Message-ID: <f3927bc3a9baf4400325b91652869907f0581c97.camel@cybertec.at> (raw)
In-Reply-To: <aadb9058660d4e10b5cee44b82458802@alte-leipziger.de>
References: <aadb9058660d4e10b5cee44b82458802@alte-leipziger.de>
On Fri, 2026-03-20 at 06:33 +0000, Subramanian,Ramachandran wrote:
> I have set up streaming replication in a our test environment and it is working OK .
>
> 1. Is there a way to force a lag between the source and the stand-by in an environment where there is NO load?
Yes, set "recovery_min_apply_delay" on the standby.
> 2. During the set up process as I was thrashing around from server to server I received this message
> in the stand-by if I make the standby follow a new server B after it had been following a server A.
> what seems to work is, additionally clearing out the archive logs dir of the standby server along
> with the data dir, before running the pg_basebackup from the standby. I am extremely new to
> postgres and I want to make sure that what I am doing is not a dangerous practice.
>
> FATAL: requested timeline 2 is not a child of this server's history
You have "recovery_timeline = 'latest'" on the standby, right?
Then the standby that gives you that error probably followed the original primary to
a point past where the new primary forked off timeline 1.
You need to shutdown the standby that gives you the error message and run "pg_rewind"
to reposition it to follow the new primary. Prerequisite: "wal_log_hints = on" or
data checksums enabled.
Otherwise you need to rebuild the standby with a new pg_basebackup.
Yours,
Laurenz Albe
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 using the --to and --cc options:
reply via email
To: pgsql-novice@postgresql.org
Cc: laurenz.albe@cybertec.at, ramachandran.subramanian@alte-leipziger.de, pgsql-novice@lists.postgresql.org
Subject: Re: Replication Testing- How to introduce a Lag
In-Reply-To: <f3927bc3a9baf4400325b91652869907f0581c97.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox