From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@lists.postgresql.org
Subject: Re: repeated decoding of prepared transactions
Date: Sat, 20 Feb 2021 08:55:46 -0800
Message-ID: <4e2b5197-e2ec-4ecb-b4dd-0f6628f640fb@www.fastmail.com> (raw)
In-Reply-To: <CAA4eK1K=0ATht4bDU0vZRiiM03KMApWw0sTo+-WLtXutboZqnQ@mail.gmail.com>
References: <d0f60d60-133d-bf8d-bd70-47784d8fabf3@enterprisedb.com>
<CAA4eK1L5aX1BL9Xg-wSULbFeB417G0v9qk5qZ6NbYCkCo6JUGQ@mail.gmail.com>
<CAA4eK1JLVfB9hiczRyTt6qLmw90qR3-9ZzeZnHi-52nEw5_SYg@mail.gmail.com>
<CAFPTHDbbth0XVwf=WXcmp=_2nU5oNaK4CxetUr22qi1UM5v6rw@mail.gmail.com>
<415799ff-89bb-a78e-2f79-7f29834d0460@enterprisedb.com>
<CAA4eK1K=0ATht4bDU0vZRiiM03KMApWw0sTo+-WLtXutboZqnQ@mail.gmail.com>
Hi,
On Fri, Feb 19, 2021, at 19:38, Amit Kapila wrote:
> On Fri, Feb 19, 2021 at 8:23 PM Markus Wanner
> <markus.wanner@enterprisedb.com> wrote:
> >
> > With that line of thinking, the point in time (or in WAL) of the COMMIT
> > PREPARED does not matter at all to reason about the decoding of the
> > PREPARE operation. Instead, there are only exactly two cases to consider:
> >
> > a) the PREPARE happened before the start_decoding_at LSN and must not be
> > decoded. (But the effects of the PREPARE must then be included in the
> > initial synchronization. If that's not supported, the output plugin
> > should not enable two-phase commit.)
> >
>
> I see a problem with this assumption. During the initial
> synchronization, this transaction won't be visible to snapshot and we
> won't copy it. Then later if we won't decode and send it then the
> replica will be out of sync. Such a problem won't happen with Ajin's
> patch.
Why isn't the more obvious answer to this to not allow/disable 2pc decoding during the initial sync? You can't really make sense of it before you're synced anyway...
Regards,
Andres
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-hackers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: repeated decoding of prepared transactions
In-Reply-To: <4e2b5197-e2ec-4ecb-b4dd-0f6628f640fb@www.fastmail.com>
References: <d0f60d60-133d-bf8d-bd70-47784d8fabf3@enterprisedb.com> <CAA4eK1L5aX1BL9Xg-wSULbFeB417G0v9qk5qZ6NbYCkCo6JUGQ@mail.gmail.com> <CAA4eK1JLVfB9hiczRyTt6qLmw90qR3-9ZzeZnHi-52nEw5_SYg@mail.gmail.com> <CAFPTHDbbth0XVwf=WXcmp=_2nU5oNaK4CxetUr22qi1UM5v6rw@mail.gmail.com> <415799ff-89bb-a78e-2f79-7f29834d0460@enterprisedb.com> <CAA4eK1K=0ATht4bDU0vZRiiM03KMApWw0sTo+-WLtXutboZqnQ@mail.gmail.com> <4e2b5197-e2ec-4ecb-b4dd-0f6628f640fb@www.fastmail.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