]> granicus.if.org Git - postgresql/commit
Make logical WAL sender report streaming state appropriately
authorMichael Paquier <michael@paquier.xyz>
Thu, 12 Jul 2018 01:19:35 +0000 (10:19 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 12 Jul 2018 01:19:35 +0000 (10:19 +0900)
commit9a7b7adc130a197e5c993a99e6aaa981f9341a35
tree79f81b20a80c672849b570ddc26af8c9bc7602c7
parent39a96512b3ed72de7b24b2667d9575d7e9fcb326
Make logical WAL sender report streaming state appropriately

WAL senders sending logically-decoded data fail to properly report in
"streaming" state when starting up, hence as long as one extra record is
not replayed, such WAL senders would remain in a "catchup" state, which
is inconsistent with the physical cousin.

This can be easily reproduced by for example using pg_recvlogical and
restarting the upstream server.  The TAP tests have been slightly
modified to detect the failure and strengthened so as future tests also
make sure that a node is in streaming state when waiting for its
catchup.

Backpatch down to 9.4 where this code has been introduced.

Reported-by: Sawada Masahiko
Author: Simon Riggs, Sawada Masahiko
Reviewed-by: Petr Jelinek, Michael Paquier, Vaishnavi Prabakaran
Discussion: https://postgr.es/m/CAD21AoB2ZbCCqOx=bgKMcLrAvs1V0ZMqzs7wBTuDySezTGtMZA@mail.gmail.com
src/backend/replication/walsender.c
src/test/perl/PostgresNode.pm
src/test/subscription/t/001_rep_changes.pl