Re: Why are wait events not reported even though it reads/writes atimeline history file?

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Why are wait events not reported even though it reads/writes atimeline history file?
Дата
Msg-id 20200428060958.GG279958@paquier.xyz
обсуждение исходный текст
Ответ на Re: Why are wait events not reported even though it reads/writes atimeline history file?  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Ответы Re: Why are wait events not reported even though it reads/writes atimeline history file?
Список pgsql-hackers
On Tue, Apr 28, 2020 at 02:49:00PM +0900, Fujii Masao wrote:
> Isn't it safer to report the wait event during fgets() rather than putting
> those calls around the whole loop, like other code does? For example,
> writeTimeLineHistory() reports the wait event during read() rather than
> whole loop.

Yeah, I/O wait events should be taken only during the duration of the
system calls.  Particularly here, you may finish with an elog() that
causes the wait event to be set longer than it should, leading to a
rather incorrect state if a snapshot of pg_stat_activity is taken.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: +(pg_lsn, int8) and -(pg_lsn, int8) operators
Следующее
От: Richard Guo
Дата:
Сообщение: Pulling up sublink may break join-removal logic