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