]> granicus.if.org Git - postgresql/commit
Fix timeout handling in logical replication worker
authorMichael Paquier <michael@paquier.xyz>
Fri, 18 Oct 2019 05:27:04 +0000 (14:27 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 18 Oct 2019 05:27:04 +0000 (14:27 +0900)
commit47698b4b62e3b7aad7e35d86b7ccdaa62799b435
treeb5b3266b536373dd40fbe32fbc908d6785bb42a6
parent0d9fcbada99213f21c67ce1b96e4022ae2d8c33f
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
src/backend/replication/logical/worker.c