Re: About to add WAL write/fsync statistics to pg_stat_wal view

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Masahiro Ikeda <ikedamsh@oss.nttdata.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Masahiko Sawada <sawada.mshk@gmail.com>, Li Japin <japinli@hotmail.com>, kuroda.hayato@fujitsu.com
Date: 2021-03-09T08:02:40Z
Lists: pgsql-hackers

On 2021/03/09 4:47, David G. Johnston wrote:
> On Mon, Mar 8, 2021 at 8:48 AM Fujii Masao <masao.fujii@oss.nttdata.com <mailto:masao.fujii@oss.nttdata.com>> wrote:
> 
> 
>     Thanks for updating the patch! I applied cosmetic changes to that.
>     Patch attached. Barring any objection, I will commit this version.
> 
> 
> Read over the patch and it looks good.

Thanks for the review! I committed the patch.


> 
> One minor "the" omission (in a couple of places, copy-paste style):
> 
> +       See <xref linkend="wal-configuration"/> for more information about
> +       internal WAL function <function>XLogWrite</function>.
> 
> "about *the* internal WAL function"

I added "the" in such two places. Thanks!


> 
> Also, I'm not sure why you find omitting documentation that the millisecond field has a fractional part out to microseconds to be helpful.

If this information should be documented, we should do that for
not only wal_write/sync_time but also other several columns,
for example, pg_stat_database.blk_write_time?

Regards,

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



Commits

  1. Send statistics collected during shutdown checkpoint to the stats collector.

  2. Force to send remaining WAL stats to the stats collector at walwriter exit.

  3. Track total amounts of times spent writing and syncing WAL data to disk.

  4. Retry short writes when flushing WAL.