Re: Adding a test for speculative insert abort case

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Adding a test for speculative insert abort case
Дата
Msg-id 20190514191914.oe2cyj76f2ipqodb@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Adding a test for speculative insert abort case  (Andres Freund <andres@anarazel.de>)
Ответы Re: Adding a test for speculative insert abort case  (Melanie Plageman <melanieplageman@gmail.com>)
Список pgsql-hackers
Hi,

On 2019-05-10 14:40:38 -0700, Andres Freund wrote:
> On 2019-05-01 11:41:48 -0700, Andres Freund wrote:
> > I'm imagining something like
> > 
> > if (pg_try_advisory_xact_lock(1))
> >     pg_advisory_xact_lock(2);
> > else
> >     pg_advisory_xact_lock(1);
> > 
> > in t1_lock_func. If you then make the session something roughly like
> > 
> > s1: pg_advisory_xact_lock(1);
> > s1: pg_advisory_xact_lock(2);
> > 
> > s2: upsert t1 <blocking for 1>
> > s1: pg_advisory_xact_unlock(1);
> > s2: <continuing>
> > s2: <blocking for 2>
> > s1: insert into t1 values(1, 'someval');
> > s1: pg_advisory_xact_unlock(2);
> > s2: <continuing>
> > s2: spec-conflict
> 
> Needed to be slightly more complicated than that, but not that much. See
> the attached test.  What do you think?
> 
> I think we should apply something like this (minus the WARNING, of
> course). It's a bit complicated, but it seems worth covering this
> special case.

And pushed. Let's see what the buildfarm says.

Regards,

Andres



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

Предыдущее
От: Ashwin Agrawal
Дата:
Сообщение: Re: Inconsistency between table am callback and table function names
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Match table_complete_speculative() code to comment