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

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Fujii Masao <masao.fujii@oss.nttdata.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-08T19:47:31Z
Lists: pgsql-hackers
On Mon, Mar 8, 2021 at 8:48 AM Fujii Masao <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.

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"

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

David J.

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.