Re: [HACKERS] Race conditions with WAL sender PID lookups

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: [HACKERS] Race conditions with WAL sender PID lookups
Дата
Msg-id CAEepm=17Mwu-9P9debzsAqfi1RZqwT4TmbYpWK+bOGFPLw989A@mail.gmail.com
обсуждение исходный текст
Ответ на [HACKERS] Race conditions with WAL sender PID lookups  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [HACKERS] Race conditions with WAL sender PID lookups  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Thu, May 11, 2017 at 1:48 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> I had my eyes on the WAL sender code this morning, and I have noticed
> that walsender.c is not completely consistent with the PID lookups it
> does in walsender.c. In two code paths, the PID value is checked
> without holding the WAL sender spin lock (WalSndRqstFileReload and
> pg_stat_get_wal_senders), which looks like a very bad idea contrary to
> what the new WalSndWaitStopping() does and what InitWalSenderSlot() is
> doing for ages.

There is also code that accesses shared walsender state without
spinlocks over in syncrep.c.  I think that file could use a few words
of explanation for why it's OK to access pid, state and flush without
synchronisation.

-- 
Thomas Munro
http://www.enterprisedb.com



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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: [HACKERS] [POC] hash partitioning
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: [HACKERS] [bug fix] PG10: libpq doesn't connect to alternativehosts when some errors occur