Re: Why are wait events not reported even though it reads/writes a timeline history file?
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Masahiro Ikeda <ikedamsh@oss.nttdata.com>, pgsql-hackers@postgresql.org
Date: 2020-05-02T02:24:07Z
Lists: pgsql-hackers
On Fri, May 01, 2020 at 12:04:56PM +0900, Fujii Masao wrote:
> I applied cosmetic changes to the patch (attached). Barring any objection,
> I will push this patch (also back-patch to v10 where wait-event for timeline
> file was added).
Sorry for arriving late to the party. I have one tiny comment.
> + pgstat_report_wait_start(WAIT_EVENT_TIMELINE_HISTORY_READ);
> + res = fgets(fline, sizeof(fline), fd);
> + pgstat_report_wait_end();
> + if (ferror(fd))
> + ereport(ERROR,
> + (errcode_for_file_access(),
> + errmsg("could not read file \"%s\": %m", path)));
> + if (res == NULL)
> + break;
It seems to me that there is no point to check ferror() if fgets()
does not return NULL, no?
--
Michael
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