confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber. - Mailing list pgsql-hackers

From Ashutosh Sharma
Subject confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.
Date
Msg-id CAE9k0P=hiqRXUonnmtS-5Pu8SbO=yF6vcrVBcfEf2+93ng_f5Q@mail.gmail.com
Whole thread Raw
Responses Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.
List pgsql-hackers
Hi All,

The logically decoded data are sent to the logical subscriber at the time of transaction commit, assuming that the data is small. However, before the transaction commit is performed, the LSN representing the data that is yet to be received by the logical subscriber appears in the confirmed_flush_lsn column of pg_replication_slots catalog. Isn't the information seen in the confirmed_flush_lsn column while the transaction is in progress incorrect ? esp considering the description given in the pg doc for this column.

Actually, while the transaction is running, the publisher keeps on sending keepalive messages containing LSN of the last decoded data saved in reorder buffer and the subscriber responds with the same LSN as the last received LSN which is then updated as confirmed_flush_lsn by the publisher. I think the LSN that we are sending with the keepalive message should be the one representing the transaction begin message, not the LSN of the last decoded data which is yet to be sent. Please let me know if I am missing something here.

--
With Regards,
Ashutosh Sharma.

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: making relfilenodes 56 bits
Next
From: Matthias van de Meent
Date:
Subject: Issue in GIN fast-insert: XLogBeginInsert + Read/LockBuffer ordering