pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix timestamp of sent message for write context in logical decod
Date: Wed, 06 Nov 2019 07:14:02 +0000
Message-ID: <E1iSFVy-0004mJ-MA@gemulon.postgresql.org> (raw)

Fix timestamp of sent message for write context in logical decoding

When sending data for logical decoding using the streaming replication
protocol via a WAL sender, the timestamp of the sent write message is
allocated at the beginning of the message when preparing for the write,
and actually computed when the write message is ready to be sent.

The timestamp was getting computed after sending the message.  This
impacts anything using logical decoding, causing for example logical
replication to report mostly NULL for last_msg_send_time in
pg_stat_subscription.

This commit makes sure that the timestamp is computed before sending the
message.  This is wrong since 5a991ef, so backpatch down to 9.4.

Author: Jeff Janes
Discussion: https://postgr.es/m/CAMkU=1z=WMn8jt7iEdC5sYNaPgAgOASb_OW5JYv-vMdYaJSL-w@mail.gmail.com
Backpatch-through: 9.4

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/15d90a02a0cefbc89d9533287f904f2aea7034ed

Modified Files
--------------
src/backend/replication/walsender.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1iSFVy-0004mJ-MA@gemulon.postgresql.org>
Permalink:  ../E1iSFVy-0004mJ-MA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iSFVy-0004mJ-MA@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix timestamp of sent message for write context in logical decod
  In-Reply-To: <E1iSFVy-0004mJ-MA@gemulon.postgresql.org>
  References: <E1iSFVy-0004mJ-MA@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox