Re: [ADMIN] Strange times in WAL files in archive directory (9.3)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [ADMIN] Strange times in WAL files in archive directory (9.3)
Дата
Msg-id 13126.1485264550@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [ADMIN] Strange times in WAL files in archive directory (9.3)  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Ответы Re: [ADMIN] Strange times in WAL files in archive directory (9.3)  (David Steele <david@pgmasters.net>)
Re: [ADMIN] Strange times in WAL files in archive directory (9.3)  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-admin
Achilleas Mantzios <achill@matrix.gatewaynet.com> writes:
> 1) Do you find this behavior normal?

It's normal operation.  Once a WAL file is not needed anymore, it's
typically renamed into place to be a future WAL file; that's cheaper
than deleting the file and creating/filling a new one.  So those ones
that have older timestamps do not contain useful data right this instant,
but they're ready to accept data once the write pointer advances to them.

> 2) From now on, can we assume a monotonic relation between file names and creation times in order to base our
maintenancescripts on this? 

I wouldn't.  You risk deleting a file just as it starts to be used.
You could possibly look into pg_control to see the current LSN and
avoid touching any files >= that point, but of course this complicates
the maintenance logic quite a bit.

The larger issue here is that you're confusing the function of an archive
area with that of the active WAL directory.  The server will prune what is
in the active WAL directory and does not want your help.  In an archive
directory, I'd expect the files to have monotonic timestamps corresponding
to the times you copied them over to the archive, so you could rely on
the timestamp sequence there.

            regards, tom lane


В списке pgsql-admin по дате отправления:

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [ADMIN] Strange times in WAL files in archive directory (9.3)
Следующее
От: David Steele
Дата:
Сообщение: Re: [ADMIN] Strange times in WAL files in archive directory (9.3)