Re: race condition when writing pg_control

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: race condition when writing pg_control
Дата
Msg-id 20200523053935.GB266978@paquier.xyz
обсуждение исходный текст
Ответ на Re: race condition when writing pg_control  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Ответы Re: race condition when writing pg_control  ("Bossart, Nathan" <bossartn@amazon.com>)
Список pgsql-hackers
On Sat, May 23, 2020 at 01:00:17AM +0900, Fujii Masao wrote:
> Per my quick check, XLogReportParameters() seems to have the similar issue,
> i.e., it updates the control file without taking ControlFileLock.
> Maybe we should fix this at the same time?

Yeah.  It also checks the control file values, implying that we should
have LW_SHARED taken at least at the beginning, but this lock cannot
be upgraded we need LW_EXCLUSIVE the whole time.  I am wondering if we
should check with an assert if ControlFileLock is taken when going
through UpdateControlFile().  We have one code path at the beginning
of redo where we don't need a lock close to the backup_label file
checks, but we could just pass down a boolean flag to the routine to
handle that case.  Another good thing in having an assert is that any
new caller of UpdateControlFile() would need to think about the need
of a lock.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Adding missing object access hook invocations
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Planning counters in pg_stat_statements (using pgss_store)