From: Masahiro Ikeda <ikedamsh@oss.nttdata.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
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: Tue, 26 Jan 2021 15:56:22 +0900
Message-ID: <395f109540835fabe76dbd9d45733a14@oss.nttdata.com> (raw)
In-Reply-To: <CAKFQuwa7xDBXwk2nr2=+_f+=2YcwUaXC2eU7eCpokipCEBJe7A@mail.gmail.com>
References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com>
<BC7530CF-3730-4E4C-A843-3B9F514786C3@hotmail.com>
<65e99b78066ab1e3dc82a4e6f5e6f3cd@oss.nttdata.com>
<7aef8ee6eea05a38ca91580caa5b2f07@oss.nttdata.com>
<CAD21AoB=RCYME3+iroY+8TrC9tsHTPo7kRKCpU7C_kZ8kgGW2A@mail.gmail.com>
<8555ab589d74ec2df61237209f4f21f2@oss.nttdata.com>
<CAD21AoC+Z7-OAwr0RES+WgAvMmi3Uv-bh6u4W1cfS_=Z0hddqg@mail.gmail.com>
<95c26651303d0e5227cb763061cf15dc@oss.nttdata.com>
<d18188f83ab56a32b48e29baf920d245@oss.nttdata.com>
<CAD21AoAMxDwey2v5tVF-3Xhu2VNUXA-9CUuZ1ZmKS3__nceJTw@mail.gmail.com>
<afeef2fecff653f2e29d1dc5056c08a3@oss.nttdata.com>
<CAD21AoC0B_miiA5rkk-yAac8_q6C4aVmNWFOHhE6vwNncma0Ng@mail.gmail.com>
<CAKFQuwa7xDBXwk2nr2=+_f+=2YcwUaXC2eU7eCpokipCEBJe7A@mail.gmail.com>
Hi, David.
Thanks for your comments.
On 2021-01-26 08:48, David G. Johnston wrote:
> On Mon, Jan 25, 2021 at 8:03 AM Masahiko Sawada
> <sawada.mshk@gmail.com> wrote:
>
>> On Mon, Jan 25, 2021 at 4:51 PM Masahiro Ikeda
>> <ikedamsh@oss.nttdata.com> wrote:
>>>
>>> Hi, thanks for the reviews.
>>>
>>> I updated the attached patch.
>>
>> Thank you for updating the patch!
>
> Your original email with "total number of times" is more correct,
> removing the "of times" and just writing "total number of WAL" is not
> good wording.
>
> Specifically, this change is strictly worse than the original.
>
> - Number of times WAL data was written to disk because WAL
> buffers became full
> + Total number of WAL data written to disk because WAL buffers
> became full
>
> Both have the flaw that they leave implied exactly what it means to
> "write WAL to disk". It is also unclear whether a counter, bytes, or
> both, would be more useful here. I've incorporated this into my
> documentation suggestions below:
> (wal_buffers_full)
>
> -- Revert - the original was better, though maybe add more detail
> similar to the below. I didn't research exactly how this works.
OK, I understood.
I reverted since this is a counter statistics.
> (wal_write)
> The number of times WAL buffers were written out to disk via XLogWrite
>
Thanks.
I thought it's better to omit "The" and "XLogWrite" because other views'
description
omits "The" and there is no description of "XlogWrite" in the documents.
What do you think?
> -- Seems like this should have a bytes version too
Do you mean that we need to separate statistics for wal write?
> (wal_write_time)
> The amount of time spent writing WAL buffers to disk, excluding sync
> time unless the wal_sync_method is either open_datasync or open_sync.
> Units are in milliseconds with microsecond resolution. This is zero
> when track_wal_io_timing is disabled.
Thanks, I'll fix it.
> (wal_sync)
> The number of times WAL files were synced to disk while
> wal_sync_method was set to one of the "sync at commit" options (i.e.,
> fdatasync, fsync, or fsync_writethrough).
Thanks, I'll fix it.
> -- it is not going to be zero just because those settings are
> presently disabled as they could have been enabled at some point since
> the last time these statistics were reset.
Right, your description is correct.
The "track_wal_io_timing" has the same limitation, doesn't it?
> (wal_sync_time)
> The amount of time spent syncing WAL files to disk, in milliseconds
> with microsecond resolution. This requires setting wal_sync_method to
> one of the "sync at commit" options (i.e., fdatasync, fsync, or
> fsync_writethrough).
Thanks, I'll fix it.
I will add the comments related to "track_wal_io_timing".
> Also,
>
> I would suggest extracting the changes to postmaster/pgstat.c and
> replication/walreceiver.c to a separate patch as you've fundamentally
> changed how it behaves with regards to that function and how it
> interacts with the WAL receiver. That seems an entirely separate
> topic warranting its own patch and discussion.
OK, I will separate two patches.
On 2021-01-26 08:52, David G. Johnston wrote:
> On Mon, Jan 25, 2021 at 4:37 PM Masahiro Ikeda
> <ikedamsh@oss.nttdata.com> wrote:
>
>> I agree with your comments. I think it should report when
>> reaching the end of WAL too. I add the code to report the stats
>> when finishing the current WAL segment file when timeout in the
>> main loop and when reaching the end of WAL.
>
> The following is not an improvement:
>
> - /* Send WAL statistics to the stats collector. */+ /* Send WAL
> statistics to stats collector */
>
> The word "the" there makes it proper English. Your copy-pasting
> should have kept the existing good wording in the other locations
> rather than replace the existing location with the newly added
> incorrect wording.
Thanks, I'll fix it.
> This doesn't make sense:
>
> * current WAL segment file to avoid loading stats collector.
>
> Maybe "overloading" or "overwhelming"?
>
> I see you removed the pgstat_send_wal(force) change. The rest of my
> comments on the v6 patch still stand I believe.
Yes, "overloading" is right. Thanks.
Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION
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: 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: <395f109540835fabe76dbd9d45733a14@oss.nttdata.com>
References: <0509ad67b585a5b86a83d445dfa75392@oss.nttdata.com> <BC7530CF-3730-4E4C-A843-3B9F514786C3@hotmail.com> <65e99b78066ab1e3dc82a4e6f5e6f3cd@oss.nttdata.com> <7aef8ee6eea05a38ca91580caa5b2f07@oss.nttdata.com> <CAD21AoB=RCYME3+iroY+8TrC9tsHTPo7kRKCpU7C_kZ8kgGW2A@mail.gmail.com> <8555ab589d74ec2df61237209f4f21f2@oss.nttdata.com> <CAD21AoC+Z7-OAwr0RES+WgAvMmi3Uv-bh6u4W1cfS_=Z0hddqg@mail.gmail.com> <95c26651303d0e5227cb763061cf15dc@oss.nttdata.com> <d18188f83ab56a32b48e29baf920d245@oss.nttdata.com> <CAD21AoAMxDwey2v5tVF-3Xhu2VNUXA-9CUuZ1ZmKS3__nceJTw@mail.gmail.com> <afeef2fecff653f2e29d1dc5056c08a3@oss.nttdata.com> <CAD21AoC0B_miiA5rkk-yAac8_q6C4aVmNWFOHhE6vwNncma0Ng@mail.gmail.com> <CAKFQuwa7xDBXwk2nr2=+_f+=2YcwUaXC2eU7eCpokipCEBJe7A@mail.gmail.com> <395f109540835fabe76dbd9d45733a14@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