Re: Option to ensure monotonic timestamps

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Option to ensure monotonic timestamps
Дата
Msg-id 20180220182616.3bvwnmyz4n57h3di@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Option to ensure monotonic timestamps  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Option to ensure monotonic timestamps
Список pgsql-hackers
Hi,

On 2018-02-20 12:32:22 -0500, Tom Lane wrote:
> The "global" variable would actually need to be cluster-wide, ie in shared
> memory, which would imply contention and the need for locks.  I think the
> overhead of this would be mighty high, and the return pretty low.

I think if we wanted to go for something like this (which I doubt), we'd
have that global variable as an atomic 64bit variable in shmem, and
*only* use it for stuff where the ordering actually matters. I.e. not
for transaction start times etc...


> It's also worth pointing out that if you don't trust the kernel clock,
> simply clamping to the last returned value isn't likely to be terribly
> satisfactory.  What if $idiotsysadmin steps the clock back an hour?
> We've had actual problems of that sort, for example with the stats
> collector going AWOL for awhile because it thought it'd already written a
> sufficiently new stats file.  There's now an explicit check for clock-
> went-backwards in pgstat_recv_inquiry, which will be broken in that sort
> of scenario if you cause GetCurrentTimestamp to do clamping internally.

I guess you could hack something together with CLOCK_MONOTONIC or such,
but brrrr.

Greetings,

Andres Freund


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: master check fails on Windows Server 2008
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Option to ensure monotonic timestamps