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 timeout handling in logical replication worker
Date: Fri, 18 Oct 2019 05:27:54 +0000
Message-ID: <E1iLKnq-0004lP-Ia@gemulon.postgresql.org> (raw)

Fix timeout handling in logical replication worker

The timestamp tracking the last moment a message is received in a
logical replication worker was initialized in each loop checking if a
message was received or not, causing wal_receiver_timeout to be ignored
in basically any logical replication deployments.  This also broke the
ping sent to the server when reaching half of wal_receiver_timeout.

This simply moves the initialization of the timestamp out of the apply
loop to the beginning of LogicalRepApplyLoop().

Reported-by: Jehan-Guillaume De Rorthais
Author: Julien Rouhaud
Discussion: https://postgr.es/m/CAOBaU_ZHESFcWva8jLjtZdCLspMj7vqaB2k++rjHLY897ZxbYw@mail.gmail.com
Backpatch-through: 10

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/feed5ee4753afa1b53e441271cc3e28345bcae0b

Modified Files
--------------
src/backend/replication/logical/worker.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1iLKnq-0004lP-Ia@gemulon.postgresql.org>
Permalink:  ../E1iLKnq-0004lP-Ia@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iLKnq-0004lP-Ia@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 timeout handling in logical replication worker
  In-Reply-To: <E1iLKnq-0004lP-Ia@gemulon.postgresql.org>
  References: <E1iLKnq-0004lP-Ia@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