Re: WAL files keep piling up - Mailing list pgsql-performance

From Zbigniew Kostrzewa
Subject Re: WAL files keep piling up
Date
Msg-id CA+VG59H_p_ZD0Mrac+B8Q30fCwSZc898RE-5o303YJnOKfX_Dw@mail.gmail.com
Whole thread Raw
List 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?

pgsql-performance by date:

Previous
From: Marc Millas
Date:
Subject: Re: 9.6 write time
Next
From: Steve Nixon
Date:
Subject: VACUUM: Nonremovable rows due to wal sender process