pgsql: pg_createsubscriber: Only --recovery-timeout controls the end of

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_createsubscriber: Only --recovery-timeout controls the end of
Date: 2024-06-17 07:59:22
Message-ID: E1sJ7Gs-001rTT-2O@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_createsubscriber: Only --recovery-timeout controls the end of recovery process

It used to check if the target server is connected to the primary
server (send required WAL) to rapidly react when the process won't
succeed. This code is not enough to guarantee that the recovery
process will complete. There is a window between the walreceiver
shutdown and the pg_is_in_recovery() returns false that can reach
NUM_CONN_ATTEMPTS attempts and fails.

Instead, rely only on the --recovery-timeout option to give up the
process after the specified number of seconds.

This should help with buildfarm failures on slow machines.

Author: Euler Taveira <euler(dot)taveira(at)enterprisedb(dot)com>
Reviewed-by: Hayato Kuroda <kuroda(dot)hayato(at)fujitsu(dot)com>
Discussion: https://www.postgresql.org/message-id/776c5cac-5ef5-4001-b1bc-5b698bc0c62a%40app.fastmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/04c8634c0c4d636540c9283efdd695558403dc4e

Modified Files
--------------
doc/src/sgml/ref/pg_createsubscriber.sgml | 7 ------
src/bin/pg_basebackup/pg_createsubscriber.c | 29 +++-------------------
src/bin/pg_basebackup/t/040_pg_createsubscriber.pl | 2 ++
3 files changed, 5 insertions(+), 33 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2024-06-17 08:55:03 pgsql: pg_createsubscriber: Remove replication slot check on primary
Previous Message Michael Paquier 2024-06-17 05:27:52 pgsql: Make regress function make_tuple_indirect() able to handle plain