I'm wondering If I understand WAL internals correctly.
I have a Postrges database and I'm writing new data to it. New files are created in WAL directory and its size is constantly increasing.
When I stop my writing process I expect no new files will be created in WAL and after some time logs from WAL will be checkpointed to storage and old files deleted from WAL.
However this is not what happens. Old files are deleted but new files are constantly created so finally no space in WAL is reclaimed and the directory grows.
I can see no files older than 2h but at the same time every minute new files come up.
Is it correct? How can I free some space in WAL directory then?