Fix logical decoding sendtime update

Started by Shulgin, Oleksandralmost 11 years ago2 messageshackers
Jump to latest
#1Shulgin, Oleksandr
oleksandr.shulgin@zalando.de

Hi Hackers,

it turns out, that the code in WalSndWriteData is setting the timestamp of
the replication message just *after* it has been sent out to the client,
thus the sendtime field always reads as zero.

Attached is a trivial patch to fix this. The physical replication path
already does the correct thing apparently.

Cheers!
--
Alex

Attachments:

logical-decoding-sendtime-fix.difftext/plain; charset=US-ASCII; name=logical-decoding-sendtime-fix.diffDownload+3-3
#2Andres Freund
andres@anarazel.de
In reply to: Shulgin, Oleksandr (#1)
Re: Fix logical decoding sendtime update

On 2015-06-10 17:57:42 +0200, Shulgin, Oleksandr wrote:

it turns out, that the code in WalSndWriteData is setting the timestamp of
the replication message just *after* it has been sent out to the client,
thus the sendtime field always reads as zero.

Ugh, what a stupid bug. Thanks!

Andres

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers