Re: [HACKERS] More race conditions in logical replication

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] More race conditions in logical replication
Дата
Msg-id CA+TgmoZneGkWSUyxPxbWkzpYmOHzOGxOJ1g+_PqPR4VDc4fR7A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] More race conditions in logical replication  (Petr Jelinek <petr.jelinek@2ndquadrant.com>)
Список pgsql-hackers
On Tue, Jul 25, 2017 at 5:47 AM, Petr Jelinek
<petr.jelinek@2ndquadrant.com> wrote:
> As a side note, the ConditionVariablePrepareToSleep()'s comment could be
> improved because currently it says the only advantage is that we skip
> double-test in the beginning of ConditionVariableSleep(). But that's not
> true, it's essential for preventing race conditions like the one above
> because it puts the current process into waiting list so we can be sure
> it will be signaled on broadcast once ConditionVariablePrepareToSleep()
> has been called.

But if you don't call ConditionVariablePrepareToSleep() before calling
ConditionVariableSleep(), then the first call to the latter will call
the former and return without doing anything else.  So I don't see how
this can ever go wrong if you're using these primitives as documented.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] More race conditions in logical replication
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Inadequate infrastructure for NextValueExpr