pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: Marc Millas <marc.millas@mokadb.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: log shipping with pg_receivewal
Date: Tue, 14 Dec 2021 14:38:55 +0900
Message-ID: <Ybgt73w5OujbvGY6@paquier.xyz> (raw)
In-Reply-To: <CADX_1aYC1buV3T=NRC_=p=HxbHpPF3EXck-KWN-cymgRY260Gg@mail.gmail.com>
References: <CADX_1aYC1buV3T=NRC_=p=HxbHpPF3EXck-KWN-cymgRY260Gg@mail.gmail.com>

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

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (3+ messages)  latest in thread

Message-ID: <Ybgt73w5OujbvGY6@paquier.xyz>
Permalink:  ../Ybgt73w5OujbvGY6@paquier.xyz/
Also on:    postgresql.org/message-id/Ybgt73w5OujbvGY6@paquier.xyz

 · 

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-general@postgresql.org
  Cc: michael@paquier.xyz, marc.millas@mokadb.com
  Subject: Re: log shipping with pg_receivewal
  In-Reply-To: <Ybgt73w5OujbvGY6@paquier.xyz>
  References: <CADX_1aYC1buV3T=NRC_=p=HxbHpPF3EXck-KWN-cymgRY260Gg@mail.gmail.com> <Ybgt73w5OujbvGY6@paquier.xyz>

* 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