Re: Logical Replication - PG_Wall size is too big, What can I do ?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Jaurès FOUTE KUETE <jauresfoute(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical Replication - PG_Wall size is too big, What can I do ?
Date: 2024-07-09 07:42:51
Message-ID: 8b77f9ece694ada85ea64c90d657f0ba4d515100.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2024-07-09 at 07:05 +0100, Jaurès FOUTE KUETE wrote:
> [image showing a large "pg_wal" directory]
>
> We are facing this issue and want to know how can I do to clean this folder without problem.
>
> What can be the cause of that ?
> and How can I clean this folder without stopping Logical Replication ?

The cause is logical replication (probably the initial synchronization of
the tables), and the only way to clean that directory is to abort logical
replication.

PostgreSQL has to retain all WAL (transaction log) until copying the data
is done and it can actually start decoding.

One way to reduce the impact is to add tables to the publication one
after the other (and refreshing the publication each time). Copying the
data for a single table can finish faster, and logical replication can
start catching up sooner, so PostgreSQL doesn't have to keep so much WAL.

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2024-07-09 07:48:24 Re: SQL: Chaining versus Pipelining
Previous Message Jaurès FOUTE KUETE 2024-07-09 06:05:22 Logical Replication - PG_Wall size is too big, What can I do ?