Re: [PATCH] Present all committed transaction to the output plugin

From: Markus Wanner <markus(dot)wanner(at)enterprisedb(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Present all committed transaction to the output plugin
Date: 2021-02-20 12:48:49
Message-ID: 147dc56a-1663-a280-feeb-5ed4af249ec1@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 20.02.21 12:15, Amit Kapila wrote:
> What exactly is the use case to send empty transactions with or
> without prepared?

I'm not saying that output plugins should *send* empty transactions to
the replica. I rather agree that this indeed is not wanted in most cases.

However, that's not what the patch changes. It just moves the decision
to the output plugin, giving it more flexibility. And possibly allowing
it to still take action. For example, in case of a distributed
two-phase commit scenario, where the publisher waits after its local
PREPARE for replicas to also PREPARE. If such a prepare doesn't even
get to the output plugin, that won't work. Not even thinking of a
PREPARE on one node followed by a COMMIT PREPARED from a different node.
It simply is not the business of the decoder to decide what to do with
empty transactions.

Plus, given the decoder does not manage to reliably filter all empty
transactions, an output plugin might want to implement its own
filtering, anyway (point in case: contrib/test_decoding and its
'skip_empty_xacts' option - that actually kind of implies it would be
possible to not skip them - as does the documentation). So I'm rather
wondering: what's the use case of filtering some, but not all empty
transactions (on the decoder side)?

Regards

Markus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-02-20 12:58:04 Re: some pointless HeapTupleHeaderIndicatesMovedPartitions calls
Previous Message Michael Paquier 2021-02-20 12:25:45 Re: Extensions not dumped when --schema is used