Re: [HACKERS] On markers of changed data

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] On markers of changed data
Дата
Msg-id CAB7nPqRxCnvqcMdsbDOCiyJH3eJw7sxv-jiwAf9gR4JgGZ-F5w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] On markers of changed data  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] On markers of changed data  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Re: [HACKERS] On markers of changed data  (Stephen Frost <sfrost@snowman.net>)
Re: [HACKERS] On markers of changed data  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, Oct 6, 2017 at 11:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andrey Borodin <x4mmm@yandex-team.ru> writes:
>> Is it safe to use file modification time to track that file were changes
>> since previous backup?
>
> I'd say no:
>
> 1. You don't know the granularity of the filesystem's timestamps, at least
> not without making unportable assumptions.
>
> 2. There's no guarantee that the system clock can't be set backwards.
>
> 3. It's not uncommon for filesystems to have optimizations whereby they
> skip or delay some updates of file mtimes.  (I think this is usually
> optional, but you couldn't know whether it's turned on.)
>
> #2 is probably the worst of these problems.

Or upwards. A simple example of things depending on clock changes is
for example VM snapshotting. Any logic not depending on monotonic
timestamps, with things like clock_gettime(CLOCK_MONOTONIC) is a lot
of fun to investigate until you know that they are not using any
monotonic logic... So the answer is *no*, do not depend on FS-level
timestamps. The only sane method for Postgres is really to scan the
page header LSNs, and of course you already know that.
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] On markers of changed data
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] On markers of changed data