From: hubert depesz lubaczewski <depesz@depesz.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
Date: Mon, 6 Feb 2023 12:15:52 +0100
Message-ID: <Y+DhaMNT7377obKJ@depesz.com> (raw)
In-Reply-To: <CAD21AoBG2OSDOFTtpPtQ7fx5Vt8p3dS5hPAv28CBSC6z2kHx-g@mail.gmail.com>
References: <Y3T6WxK483Vu6bsi@depesz.com>
<CAD21AoBFmWYvgmwiugOmHD8h9-0k+zY=Cd584PNGjvRGZk9fSA@mail.gmail.com>
<Y3YKlyfdn8sX5Gpn@depesz.com>
<CAA4eK1Lz6W4mEL0ANPxL-bLQRmrh1+4sWbXf2CWG9oAgKs_j3A@mail.gmail.com>
<Y3tFw2r6NVMnWqA/@depesz.com>
<CAA4eK1L3LThSYYNf3hEDhy9qomFkdVmfV1YCjNDDbNBPhcg=Pg@mail.gmail.com>
<Y3tpa/MmSnO3wBjG@depesz.com>
<CAD21AoDb3zB=0sZJN5K+eynALhJeOogHREPXhPprgCOU99hrrw@mail.gmail.com>
<Y5HGyYfvOiQZFg8H@depesz.com>
<CAD21AoBG2OSDOFTtpPtQ7fx5Vt8p3dS5hPAv28CBSC6z2kHx-g@mail.gmail.com>
On Mon, Feb 06, 2023 at 05:25:42PM +0900, Masahiko Sawada wrote:
> Based on the analysis we did[1][2], I've created the manual scenario
> to reproduce this issue with the attached patch and the script.
>
> The scenario.md explains the basic steps to reproduce this issue. It
> consists of 13 steps (very tricky!!). It's not sophisticated and could
> be improved. test.sh is the shell script I used to execute the
> reproduction steps from 1 to 10. In my environment, I could reproduce
> this issue by the following steps.
>
> 1. apply the patch and build PostgreSQL.
> 2. run test.sh.
> 3. execute the step 11 and later described in scenario.md.
>
> The test.sh is a very hacky and dirty script and is optimized in my
> environment (especially adding many sleeps). You might need to adjust
> it while checking scenario.md.
>
> I've also confirmed that this issue is fixed by the attached patch,
> which clears candidate_restart_lsn and friends during
> ReplicationSlotRelease().
Hi,
one important question - do I patch newer Pg, or older? The thing is
that we were able to replicate the problem (with some luck) only on
production databases, and patching them will be hard sell. Maybe
possible, but if it's enough to patch the pg14 (recipient) it would make
my life much easier.
Best regards,
depesz
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-bugs@postgresql.org
Cc: depesz@depesz.com, sawada.mshk@gmail.com, amit.kapila16@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: WAL segments removed from primary despite the fact that logical replication slot needs it.
In-Reply-To: <Y+DhaMNT7377obKJ@depesz.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