Re: Why are wait events not reported even though it reads/writes a timeline history file?
Masahiro Ikeda <ikedamsh@oss.nttdata.com>
From: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>, Fujii Masao
<masao.fujii@oss.nttdata.com>
Cc: pgsql-hackers@postgresql.org
Date: 2020-04-28T08:42:32Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-to-report-wait-events-about-timeline-history-.patch (text/x-diff) patch v2-0001
On 2020-04-28 15:09, Michael Paquier wrote: > 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. > -- Thanks for your comments. I fixed it to report the wait event during fgets() only. Please review the v2 patch I attached. Regard, -- Masahiro Ikeda
Commits
-
Report missing wait event for timeline history file.
- 3a48740e898c 10.13 landed
- cc534fc3b289 11.8 landed
- a354d015386a 12.3 landed
- f2ff2035962c 13.0 landed