From: | Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Why are wait events not reported even though it reads/writes a timeline history file? |
Date: | 2020-05-07 07:51:16 |
Message-ID: | f0a38d7d-1e81-7a08-abf8-61b8d4481c91@oss.nttdata.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2020/05/02 11:24, Michael Paquier wrote:
> 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?
Yeah, so I updated the patch so that ferror() is called only
when fgets() returns NULL. Attached is the updated version of
the patch.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachment | Content-Type | Size |
---|---|---|
v5-0001-Fix-to-report-wait-events-about-timeline-history-.patch | text/plain | 1.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2020-05-07 07:57:00 | Re: Should smgrdounlink() be removed? |
Previous Message | Masahiko Sawada | 2020-05-07 07:26:35 | Re: xid wraparound danger due to INDEX_CLEANUP false |