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