Re: Minor adjustment to pg_aios output naming

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: torikoshia <torikoshia(at)oss(dot)nttdata(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Minor adjustment to pg_aios output naming
Date: 2025-05-21 02:45:24
Message-ID: aC0-RJsgbyk6967t@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 21, 2025 at 11:14:11AM +0900, torikoshia wrote:
> Hi,
>
> I've noticed a minor inconsistency in the output of pg_aios.
>
> According to the documentation, the values for 'operation' are described as:
>
> <literal>readv</literal>, a vectored read
> ...
> <literal>writev</literal>, a vectored write
>
> However, in actual output, they appear as read and write -- without the
> trailing v:
>
> =# select operation from pg_aios;
> ..
> operation | read
>
> While this discrepancy is unlikely to cause any real issues, it would be
> better to keep the naming consistent.
>
> I was a bit unsure which form to align to.
> There are currently no other types of read/write operations in pg_aios, so
> the shorter form might have been sufficient.
> However, using the 'v'-suffixed names makes the vectored nature of these
> operations explicit and future-proofs
> the naming in case other variants are introduced later.
>
> What do you think?

--- a/src/backend/storage/aio/aio_io.c
+++ b/src/backend/storage/aio/aio_io.c
@@ -181,9 +181,9 @@ pgaio_io_get_op_name(PgAioHandle *ioh)
case PGAIO_OP_INVALID:
return "invalid";
case PGAIO_OP_READV:
- return "read";
+ return "readv";
case PGAIO_OP_WRITEV:
- return "write";
+ return "writev";
}

I think that your suggestion of fix is right. The properties are
marked as "WRITEV" and "READV" for vectored operations. So the
documentation is right, not the name used in the code. Will fix,
thanks for the report.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-05-21 02:48:49 Re: Addition of %b/backend_type in log_line_prefix of TAP test logs
Previous Message Fujii Masao 2025-05-21 02:41:18 Re: Addition of %b/backend_type in log_line_prefix of TAP test logs