Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput? - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?
Date
Msg-id CAA4eK1+KPW9NyRyRfc9MVg9373z8akhL7kNi5X4BSZkVy23UFA@mail.gmail.com
Whole thread Raw
In response to Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?  (Euler Taveira <euler.taveira@2ndquadrant.com>)
Responses Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?  ("Euler Taveira" <euler@eulerto.com>)
List pgsql-hackers
On Wed, Nov 25, 2020 at 8:58 AM Euler Taveira
<euler.taveira@2ndquadrant.com> wrote:
>
> On Wed, 18 Nov 2020 at 03:04, David Pirotte <dpirotte@gmail.com> wrote:
>>
>> On Fri, Nov 6, 2020 at 7:05 AM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote:
>>>
>>> +/*
>>> + * Write MESSAGE to stream
>>> + */
>>> +void
>>> +logicalrep_write_message(StringInfo out, ReorderBufferTXN *txn, XLogRecPtr lsn,
>>> +                        bool transactional, const char *prefix, Size sz,
>>> +                        const char *message)
>>> +{
>>> +   uint8       flags = 0;
>>> +
>>> +   pq_sendbyte(out, LOGICAL_REP_MSG_MESSAGE);
>>> +
>>>
>>> Similar to the UPDATE/DELETE/INSERT records decoded when streaming is being
>>> used, we need to add transaction id for transactional messages. May be we add
>>> that even in case of non-streaming case and use it to decide whether it's a
>>> transactional message or not. That might save us a byte when we are adding a
>>> transaction id.
>>
>>
> I also reviewed your patch. This feature would be really useful for replication
> scenarios. Supporting this feature means that you don't need to use a table to
> pass messages from one node to another one. Here are a few comments/ideas.
>

Your ideas/suggestions look good to me. Don't we need to provide a
read function corresponding to logicalrep_write_message? We have it
for other write functions. Can you please combine all of your changes
into one patch?

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Replication slot stats misgivings
Next
From: David Rowley
Date:
Subject: Re: Hybrid Hash/Nested Loop joins and caching results from subplans