Re: log shipping with pg_receivewal - Mailing list pgsql-general

From Michael Paquier
Subject Re: log shipping with pg_receivewal
Date
Msg-id Ybgt73w5OujbvGY6@paquier.xyz
Whole thread Raw
In response to log shipping with pg_receivewal  (Marc Millas <marc.millas@mokadb.com>)
List pgsql-general
On Tue, Dec 14, 2021 at 05:25:04AM +0100, Marc Millas wrote:
> My question: as the synchronous option is supposed to make pg_receivewal
> write transaction immediately in the wal files, is there a way to ask the
> standby to apply them on the fly ie. without waiting a wal file change ?

Nope, there is no such option.  First, pg_receivewal strongly relies
on the rename of WAL segment to its correct name once completed.  If
there is any failure, we would start back at the beginning of the last
partial segment found.

Saying that, you could do things by using a restore_command that
checks after a .partial file directly in the path used by
pg_receivewal to store the archives, and Postgres would repeatedly ask
for a segment once it is out.  But really, this is going to be really
expensive as a restore_command would copy a full file, so that's a lot
of bandwidth wasted away for nothing.  Streaming replication would be
likely your best, and cheapest, option here.
--
Michael

Attachment

pgsql-general by date:

Previous
From: Marc Millas
Date:
Subject: log shipping with pg_receivewal
Next
From: Dilip Kumar
Date:
Subject: Re: log shipping with pg_receivewal