Re: snapshot too old, configured by time

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: snapshot too old, configured by time
Дата
Msg-id 20151203154230.GE20698@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: snapshot too old, configured by time  (Kevin Grittner <kgrittn@gmail.com>)
Список pgsql-hackers
On 2015-12-02 14:48:24 -0600, Kevin Grittner wrote:
> On Wed, Dec 2, 2015 at 12:39 AM, Michael Paquier
> <michael.paquier@gmail.com> wrote:
> > On Mon, Nov 9, 2015 at 8:07 AM, Steve Singer <steve@ssinger.info> wrote:
> 
> >> In snapmgr.c
> >>
> >>
> >> + * XXX: If we can trust a read of an int64 value to be atomic, we can skip the
> >> + * spinlock here.
> >> + */
> >> +int64
> >> +GetOldSnapshotThresholdTimestamp(void)
> >>
> >>
> >> Was your intent with the XXX for it to be a TODO to only aquire the lock on
> >> platforms without the atomic 64bit operations?
> 
> I'm not sure whether we can safely assume a read of an int64 to be
> atomic on any platform; if we actually can on some platforms, and
> we have a #define to tell us whether we are in such an environment,
> we could condition the spinlock calls on that.  Are we there yet?

We currently don't assume it's atomic. And there are platforms, e.g 32
bit arm, where that's not the case
(c.f. https://wiki.postgresql.org/wiki/Atomics). It'd be rather useful
to abstract that knowledge into a macro...

Andres



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

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Fwd: Another little thing about psql wrapped expanded output
Следующее
От: Catalin Iacob
Дата:
Сообщение: Re: proposal: PL/Pythonu - function ereport