Why are wait events not reported even though it reads/writes a timeline history file?

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Why are wait events not reported even though it reads/writes a timeline history file?
Date: 2020-04-24 02:29:43
Message-ID: d11b0c910b63684424e06772eb844ab5@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, 

There are two unexpected codes for me about wait events for timeline
history file.
Please let me know your thoughts whether if we need to change.

1. readTimeLineHistory() function in timeline.c

The readTimeLineHistory() reads a timeline history file, 
but it doesn't report “WAIT_EVENT_TIMELINE_HISTORY_READ".

In my understanding, sscanf() is blocking read. 
So, it's important to report a wait event.

2. writeTimeLineHistory() function in timeline.c

The writeTimeLineHistory() function may write a timeline history file
twice,
but it reports “WAIT_EVENT_TIMELINE_HISTORY_WRITE" only once.

It makes sense to report a wait event twice, because both of them use
write().

I attached a patch to mention the code line number.

I checked the commit log which "WAIT_EVENT_TIMELINE_HISTORY_READ" and
"WAIT_EVENT_TIMELINE_HISTORY_WRITE" are committed and the discussion
about it.
But I can't find the reason.

Please give me your comments.
If we need to change, I can make a patch to fix them.

By the way, which is correct "timeline's history file" or "timeline
history file"?
The timeline.c has both. In my understanding, the latter is correct. If
so, I will modify together.

Regards,

--
Masahiro Ikeda
NTT DATA CORPORATION

Attachment Content-Type Size
0001-some-wait-events-for-timeline-history-file-are-not-r.patch text/x-diff 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Atsushi Torikoshi 2020-04-24 02:56:01 Re: [Proposal] Add accumulated statistics for wait event
Previous Message Tom Lane 2020-04-24 02:21:15 Re: [BUG] non archived WAL removed during production crash recovery