pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Kaushik Iska <kaushik@peerdb.io>
Cc: pgsql-general@postgresql.org, Sai Krishna Srirampur <sai@peerdb.io>
Cc: Philip Dubé <philip@peerdb.io>
Subject: Re: Intermittent Issue with WAL Segment Removal in Logical Replication
Date: Sat, 30 Dec 2023 01:26:35 +0100
Message-ID: <51b620b8-d13b-649e-4f1d-c57f1d73eb87@enterprisedb.com> (raw)
In-Reply-To: <CAHYLuV=_+_+OqXm=yuObjqPYfQhiBbTRJk9qFzhAte4TfNtV3Q@mail.gmail.com>
References: <CAHYLuVkH4nWohHyMBam2wQi0XT0NN5FJdTWjb+sS--YCkDWofA@mail.gmail.com>
	<CAHYLuV=M2YTxecoc1MH=TbChei7pAyk2gNLHnCM_eGSnGhjeOQ@mail.gmail.com>
	<3b75e08a-2d53-fbb5-731a-3a8e5c71edd8@enterprisedb.com>
	<CAHYLuV=_+_+OqXm=yuObjqPYfQhiBbTRJk9qFzhAte4TfNtV3Q@mail.gmail.com>

On 12/29/23 22:28, Kaushik Iska wrote:
> I am unfortunately not really familiar with Google Cloud SQL internals
> as well. But we have seen this happen on Amazon RDS as well.
> 

Do you have a reproducer for regular Postgres?

> Could it be possible that we are requesting a future WAL segment, say
> WAL upto X is written and we are asking for X + 1? It could be that the
> error message is misleading.
> 

I don't think that should be possible. The LSN in the START_REPLICATION
comes from the replica, where it's tracked as the last LSN received from
the upstream. So that shouldn't be in the future. And it's doesn't seem
to be suspiciously close to segment boundary either.

In fact, the LSN in the message is 6/5AE67D79, but the "failed" segment
is 000000010000000600000059, which is the *preceding* one. So it can't
be in the future.

> I do not have the information from pg_replication_slots as I have
> terminated the test. I am fairly certain that I can reproduce this
> again. I will gather both the restart_lsn and contents of pg_wal for the
> failed segment. Is there any other information that would help debug
> this further?
> 

Hard to say. The best thing would be to have a reproducer script, ofc.
If that's not possible, the information already requested seems like a
good start.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (6+ messages)

Message-ID: <51b620b8-d13b-649e-4f1d-c57f1d73eb87@enterprisedb.com>
Permalink:  ../51b620b8-d13b-649e-4f1d-c57f1d73eb87@enterprisedb.com/
Also on:    postgresql.org/message-id/51b620b8-d13b-649e-4f1d-c57f1d73eb87@enterprisedb.com

 · 

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: tomas.vondra@enterprisedb.com, kaushik@peerdb.io, sai@peerdb.io, philip@peerdb.io
  Subject: Re: Intermittent Issue with WAL Segment Removal in Logical Replication
  In-Reply-To: <51b620b8-d13b-649e-4f1d-c57f1d73eb87@enterprisedb.com>
  References: <CAHYLuVkH4nWohHyMBam2wQi0XT0NN5FJdTWjb+sS--YCkDWofA@mail.gmail.com> <CAHYLuV=M2YTxecoc1MH=TbChei7pAyk2gNLHnCM_eGSnGhjeOQ@mail.gmail.com> <3b75e08a-2d53-fbb5-731a-3a8e5c71edd8@enterprisedb.com> <CAHYLuV=_+_+OqXm=yuObjqPYfQhiBbTRJk9qFzhAte4TfNtV3Q@mail.gmail.com> <51b620b8-d13b-649e-4f1d-c57f1d73eb87@enterprisedb.com>

* 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