public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fabrice Chapuis <[email protected]>
To: Christoph Moench-Tegeder <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: wal recycling problem
Date: Fri, 6 Oct 2023 12:49:49 +0200
Message-ID: <CAA5-nLC4o2YLeQnV2ts=CnzAHrMsMvmOukQiP2rwwzs-Mg3c=g@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAA5-nLCrbc90DHbX_9Yav72hEXUetkZ9iO8zmKvCvYNZkDHx9g@mail.gmail.com>
	<[email protected]>
	<CAA5-nLB5axGwwj6ft6G5tHxKqEC932M5k-4Ytb2W1iQziqmuLQ@mail.gmail.com>
	<[email protected]>

Thanks Christoph for your message.
Now I understand why the wals are preserved if logical replication is
configured and enabled. The problem is that when a large volume of data is
loaded into a database, for example during a pg_restore, the wal sender
process associated with the logical replication slot will have to decrypt
all of the wals generated during this operation which will take a long time
and the restart_lsn will not be modified.
From a conceptual point of view I think that specific wals per subscription
should be used and stored in the pg_replslot folder in order to avoid
working directly on the wals of the instance.

What do you think about this proposal?

Regards

Fabrice


On Mon, Oct 2, 2023 at 12:06 PM Christoph Moench-Tegeder <[email protected]>
wrote:

> Hi,
>
> ## Fabrice Chapuis ([email protected]):
>
> > on the other hand there are 2 slots for logical replication which display
> > status extended. I don't understand why given that the
> confirmed_flush_lsn
> > field that is up to date. The restart_lsn remains frozen, for what
> reason?
>
> There you have it - "extended" means "holding wal". And as long as the
> restart_lsn does not advance, checkpointer cannot free any wal beyond
> that lsn. My first idea would be some long-running (or huge) transaction
> which is in process (active or still being streamed). I'd recommend
> looking into what the clients on these slots are doing.
>
> Regards,
> Christoph
>
> --
> Spare Space
>


view thread (9+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: wal recycling problem
  In-Reply-To: <CAA5-nLC4o2YLeQnV2ts=CnzAHrMsMvmOukQiP2rwwzs-Mg3c=g@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox