Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jSuPH-0005rk-7y for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Apr 2020 03:26:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jSuPF-0003fL-Tm for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Apr 2020 03:26:05 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jSuPF-0003fE-My for pgsql-hackers@lists.postgresql.org; Mon, 27 Apr 2020 03:26:05 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jSuPC-0000m7-6q for pgsql-hackers@postgresql.org; Mon, 27 Apr 2020 03:26:05 +0000 Received: from hnk.local (p2421237-ipbf2725funabasi.chiba.ocn.ne.jp [122.24.33.237]) by oss.nttdata.com (Postfix) with ESMTPSA id 9F25D60696; Mon, 27 Apr 2020 12:25:56 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at oss.nttdata.com Subject: Re: Why are wait events not reported even though it reads/writes a timeline history file? To: Masahiro Ikeda , pgsql-hackers@postgresql.org References: From: Fujii Masao Message-ID: Date: Mon, 27 Apr 2020 12:25:56 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/04/24 11:29, Masahiro Ikeda wrote: > 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". Yeah, this sounds strange. > In my understanding, sscanf() is blocking read. > So, it's important to report a wait event. Shouldn't the wait event be reported during fgets() rather than sscanf()? > 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(). Yes. > 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. Thanks! I agree to fix those issues. > 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. Maybe both are correct?? I have no strong opinion about this. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION