I've just checked my second reproduction cluster (also Patroni but this time on K8s). It also has non-empty `archive_status/` directory:
ls pg_xlog/ | grep -v history | wc -l
165
165
ls pg_xlog/archive_status/ | wc -l
81
81
ls pg_xlog/archive_status/ | grep done | wc -l
81
81
but on this cluster I did not enable `archive_mode` at any time:
postgres=# select name,setting from pg_settings where name like 'archive_%';
name | setting
-----------------+------------
archive_command | (disabled)
archive_mode | off
archive_timeout | 0
name | setting
-----------------+------------
archive_command | (disabled)
archive_mode | off
archive_timeout | 0
Yes, I am aware 9.6 is pretty old, soon I will be replacing it with 11.x. Thanks.
Kind regards.
śr., 22 gru 2021 o 19:18 Tom Lane <tgl@xxxxxxxxxxxxx> napisał(a):
Zbigniew Kostrzewa <zkostrzewa@xxxxxxxxx> writes:
> Thanks for responding. On current master it looks like so:
> ls pg_xlog/archive_status/ | grep ready | wc -l
> 0
> ls pg_xlog/archive_status/ | grep done | wc -l
> 501
Hmm, if you've got archiving turned off, I wonder why you have
any .done files at all. Perhaps they are leftover from a time
when you did have archiving on, and for some reason they are
confusing the non-archive-mode cleanup logic.
Anyway, you could certainly manually remove the .done files and
the corresponding WAL segment files, and then see what happens.
BTW, I'm sure you realize that 9.6.15 is not exactly current.
regards, tom lane