Re: WAL files keep piling up

From: Zbigniew Kostrzewa <zkostrzewa(at)gmail(dot)com>
To: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: WAL files keep piling up
Date: 2022-01-03 22:48:14
Message-ID: CA+VG59H_p_ZD0Mrac+B8Q30fCwSZc898RE-5o303YJnOKfX_Dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>
> I have a PostgreSQL (9.6.15) two node cluster setup with Patroni. The
> instances are configured to work in master <-> synchronous standby setup
> and both run in docker containers with pgdata volume mounted from host.
> When master is restarted the synchronous standby automatically takes the
> role of master and master starts operating as synchronous replica.
>

So it seems that Patroni starts Postgres in two phases. First it starts
both instances in standby mode and then, once it establishes who is the
leader, it promotes one of the instances. It seems that when promoting a
standby to a leader a new timeline is created which causes new WAL file to
be created in pg_xlog/. In a result each restart results in a new timeline
and a new WAL file. However, nothing cleans up the WAL files stamped with
previous timelines. Is there a way to figure out which WAL files can be
safely removed?

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Steve Nixon 2022-01-04 17:16:00 VACUUM: Nonremovable rows due to wal sender process
Previous Message Marc Millas 2021-12-28 18:59:29 Re: 9.6 write time