On Wed, Nov 25, 2020 at 8:58 AM Euler Taveira <euler.tave...@2ndquadrant.com> wrote: > > On Wed, 18 Nov 2020 at 03:04, David Pirotte <dpiro...@gmail.com> wrote: >> >> On Fri, Nov 6, 2020 at 7:05 AM Ashutosh Bapat <ashutosh.bapat....@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.