replication_origin and replication_origin_lsn usage on subscriber - Mailing list pgsql-hackers

From Amit Kapila
Subject replication_origin and replication_origin_lsn usage on subscriber
Date
Msg-id CAA4eK1JwXaCezFw+kZwoxbLKYD0nWpC2rPgx7vUsaDAc0AZaow@mail.gmail.com
Whole thread Raw
Responses Re: replication_origin and replication_origin_lsn usage on subscriber
List pgsql-hackers
During logical decoding, we send replication_origin and
replication_origin_lsn when we decode commit.  In pgoutput_begin_txn,
we send values for these two but never used on the subscriber side.
Though we have provided a function (logicalrep_read_origin) to read
these two values but that is not used in code anywhere.

I think this is primarily for external application usage, but it is
not very clear how will they use it.  As far as I understand, the
value of origin can be used to avoid loops in bi-directional
replication, and origin_lsn can be used to track how far subscriber
has recevied changes.  I am not sure about this and particularly how
origin_lsn can be used in external applications.

This has come up in the discussion of the "logical streaming of large
in-progress transactions" [1]. Basically, we are not sure when to send
these values during streaming as we don't know its clear usage.

Thoughts?

[1] - https://www.postgresql.org/message-id/CAFiTN-skHvSWDHV66qpzMfnHH6AvsE2YAjvh4Kt613E8ZD8WoQ%40mail.gmail.com

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Re: [HACKERS] WIP: Aggregation push-down
Next
From: Amit Langote
Date:
Subject: Re: ALTER tbl rewrite loses CLUSTER ON index