pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Li Japin <japinli@hotmail.com>
Cc: kuroda.hayato@fujitsu.com
Subject: Re: About to add WAL write/fsync statistics to pg_stat_wal view
Date: Thu, 25 Mar 2021 22:06:32 +0900
Message-ID: <c90644d1-1180-e500-c788-2dbb89fab0d5@oss.nttdata.com> (raw)
In-Reply-To: <01356fe4-5498-73bd-1fd1-e11eecb4fc8f@oss.nttdata.com>
References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com>
	<4a81fc95615db54b75f59759752b2cef@oss.nttdata.com>
	<49d412cc-2e39-a487-1861-a8560ebb88cb@oss.nttdata.com>
	<da0059e5e7282573c52ecffd3554a810@oss.nttdata.com>
	<b10edd92-b428-25e9-89d4-e36592a67363@oss.nttdata.com>
	<99fbf195e4b02a629cbf8190a0b9d47a@oss.nttdata.com>
	<7c08820c-06d6-0968-100a-5df71d67768b@oss.nttdata.com>
	<f2ea17310b046cc6688b6f868a780cc8@oss.nttdata.com>
	<550de3c1-3408-de76-6fc1-a46eedc217a3@oss.nttdata.com>
	<b53fc36fbc55fe6c08d4fa0df0d29a5b@oss.nttdata.com>
	<a965d3ed-47d3-7d30-c15f-fc0f98810e4d@oss.nttdata.com>
	<90d8baf25655a08299185cb1a616bda1@oss.nttdata.com>
	<ce0f7bf6-9c7d-0a80-c580-3952c49d87e1@oss.nttdata.com>
	<82ccde1a-ead9-598c-f472-004a01ff23e9@oss.nttdata.com>
	<940c12fd-96dc-67d2-afe9-dbb679eda010@oss.nttdata.com>
	<ced8789e-b2e0-3322-6b61-402c5e259eea@oss.nttdata.com>
	<7ec4c9af-6f1a-8be8-bce1-c111e04eee8d@oss.nttdata.com>
	<01356fe4-5498-73bd-1fd1-e11eecb4fc8f@oss.nttdata.com>



On 2021/03/25 11:50, Masahiro Ikeda wrote:
> 
> 
> On 2021/03/23 16:10, Fujii Masao wrote:
>>
>>
>> On 2021/03/22 20:25, ikedamsh wrote:
>>> Agreed. Users can know whether the stats is for walreceiver or not. The
>>> pg_stat_wal view in standby server shows for the walreceiver, and in primary
>>> server it shows for the others. So, I updated the document.
>>> (v20-0003-Makes-the-wal-receiver-report-WAL-statistics.patch)
>>
>> Thanks for updating the docs!
>>
>> There was the discussion about when the stats collector is invoked, at [1].
>> Currently during archive recovery or standby, the stats collector is
>> invoked when the startup process reaches the consistent state, sends
>> PMSIGNAL_BEGIN_HOT_STANDBY, and then the system is starting accepting
>> read-only connections. But walreceiver can be invoked at earlier stage.
>> This can cause walreceiver to generate and send the statistics about WAL
>> writing even though the stats collector has not been running yet. This might
>> be problematic? If so, maybe we need to ensure that the stats collector is
>> invoked before walreceiver?
>>
>> During recovery, the stats collector is not invoked if hot standby mode is
>> disabled. But walreceiver can be running in this case. So probably we should
>> change walreceiver so that it's invoked even when hot standby is disabled?
>> Otherwise we cannnot collect the statistics about WAL writing by walreceiver
>> in that case.
>>
>> [1]
>> https://postgr.es/m/e5a982a5-8bb4-5a10-cf9a-40dd1921bdb5@oss.nttdata.com
> 
> Thanks for comments! I didn't notice that.
> As I mentioned[1], if my understanding is right, this issue seem to be not for
> only the wal receiver.
> 
> Since the shared memory thread already handles these issues, does this patch,
> which to collect the stats for the wal receiver and make a common function for
> writing wal files, have to be committed after the patches for share memory
> stats are committed? Or to handle them in this thread because we don't know
> when the shared memory stats patches will be committed.
> 
> I think the former is better because to collect stats in shared memory is very
> useful feature for users and it make a big change in design. So, I think it's
> beneficial to make an effort to move the shared memory stats thread forward
> (by reviewing or testing) instead of handling the issues in this thread.

Sounds reasonable. Agreed.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (67+ messages)

Message-ID: <c90644d1-1180-e500-c788-2dbb89fab0d5@oss.nttdata.com>
Permalink:  ../c90644d1-1180-e500-c788-2dbb89fab0d5@oss.nttdata.com/
Also on:    postgresql.org/message-id/c90644d1-1180-e500-c788-2dbb89fab0d5@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, ikedamsh@oss.nttdata.com, david.g.johnston@gmail.com, sawada.mshk@gmail.com, japinli@hotmail.com, kuroda.hayato@fujitsu.com
  Subject: Re: About to add WAL write/fsync statistics to pg_stat_wal view
  In-Reply-To: <c90644d1-1180-e500-c788-2dbb89fab0d5@oss.nttdata.com>
  References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com> <49d412cc-2e39-a487-1861-a8560ebb88cb@oss.nttdata.com> <da0059e5e7282573c52ecffd3554a810@oss.nttdata.com> <b10edd92-b428-25e9-89d4-e36592a67363@oss.nttdata.com> <99fbf195e4b02a629cbf8190a0b9d47a@oss.nttdata.com> <7c08820c-06d6-0968-100a-5df71d67768b@oss.nttdata.com> <f2ea17310b046cc6688b6f868a780cc8@oss.nttdata.com> <550de3c1-3408-de76-6fc1-a46eedc217a3@oss.nttdata.com> <b53fc36fbc55fe6c08d4fa0df0d29a5b@oss.nttdata.com> <a965d3ed-47d3-7d30-c15f-fc0f98810e4d@oss.nttdata.com> <90d8baf25655a08299185cb1a616bda1@oss.nttdata.com> <ce0f7bf6-9c7d-0a80-c580-3952c49d87e1@oss.nttdata.com> <82ccde1a-ead9-598c-f472-004a01ff23e9@oss.nttdata.com> <940c12fd-96dc-67d2-afe9-dbb679eda010@oss.nttdata.com> <ced8789e-b2e0-3322-6b61-402c5e259eea@oss.nttdata.com> <7ec4c9af-6f1a-8be8-bce1-c111e04eee8d@oss.nttdata.com> <01356fe4-5498-73bd-1fd1-e11eecb4fc8f@oss.nttdata.com> <c90644d1-1180-e500-c788-2dbb89fab0d5@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox