Re: Outdated replication protocol error?

From: Andres Freund <andres(at)anarazel(dot)de>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, pgsql-hackers(at)postgresql(dot)org, Simon Riggs <simon(at)2ndquadrant(dot)com>, Craig Ringer <craig(dot)ringer(at)enterprisedb(dot)com>
Subject: Re: Outdated replication protocol error?
Date: 2021-01-15 21:55:48
Message-ID: 20210115215548.ct4ersu7pnwumyfa@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2021-01-14 16:40:26 +0900, Fujii Masao wrote:
> On 2021/01/12 9:06, Jeff Davis wrote:
> > Commit 5ee2197767 (about 4 years old) introduced the error:
> >
> > "IDENTIFY_SYSTEM has not been run before START_REPLICATION"
> >
> > But it seems like running START_REPLICATION first works (at least in
> > the simple case).
> >
> > We should either:
> >
> > 1. Document that IDENTIFY_SYSTEM must always be run before
> > START_REPLICATION, and always issue a WARNING if that's not done (an
> > ERROR might break existing applications); or
> >
> > 2. If the commit is out of date and no longer needed, or if it's easy
> > enough to fix, just remove the error (and Assert a valid
> > ThisTimeLineID).
>
> +1 to remove the error if START_REPLICATION can always work fine without
> IDENTIFY_SYSTEM. I found that the error happens when we connect to the standby
> and just run START_REPLICATION without IDENTIFY_SYSTEM. But I'm not sure
> if IDENTIFY_SYSTEM is actually necessary even in that case.

The current approach seems quite bad to me too. By that point the value
could be just about arbitrarily out of date - but that doesn't really
matter because GetStandbyFlushRecPtr() updates it. And for the
!am_cascading_walsender it's trivial to compute.

Has anybody dug out the thread leading to the commit?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-01-15 21:59:17 Re: Key management with tests
Previous Message Andres Freund 2021-01-15 21:51:56 Re: Change default of checkpoint_completion_target