replication_origin and replication_origin_lsn usage on subscriber

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: replication_origin and replication_origin_lsn usage on subscriber
Date: 2020-02-06 09:10:29
Message-ID: CAA4eK1JwXaCezFw+kZwoxbLKYD0nWpC2rPgx7vUsaDAc0AZaow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-02-06 09:14:16 Re: ALTER tbl rewrite loses CLUSTER ON index
Previous Message Richard Guo 2020-02-06 08:30:32 Re: [HACKERS] WIP: Aggregation push-down