Re: Removing the pgstat_flush_io() call from the walwriter

From: Andres Freund <andres(at)anarazel(dot)de>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Removing the pgstat_flush_io() call from the walwriter
Date: 2024-12-18 16:55:11
Message-ID: 4qorcmgtasfeysk3go5oyoikeqah6rei35kprsz3zhq3idleqp@p7adsho6aiax
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2024-12-18 15:53:39 +0000, Bertrand Drouvot wrote:
> On Wed, Dec 18, 2024 at 10:35:45AM -0500, Andres Freund wrote:
> > Hi,
> >
> > On 2024-12-18 15:14:07 +0000, Bertrand Drouvot wrote:
> > > While working on [1], it has been noticed that pgstat_flush_io() is called for
> > > the walwriter. Indeed, it's coming from the pgstat_report_wal() call in
> > > WalWriterMain(). That can not report any I/O stats activity (as the
> > > walwriter is not part of the I/O stats tracking, see pgstat_tracks_io_bktype()).
> > >
> > > The behavior is there since 28e626bde00 and I did not find any explicit reason
> > > to do so provided in the linked thread [2].
> > >
> > > Calling pgstat_flush_io() from there looks unnecessary, so $SUBJECT, until the
> > > walwriter is part of the I/O stats tracking system.
> >
> > I don't really see the point of this change? What do we gain by moving stuff
> > around like you did?
>
> Thanks for looking at it!
>
> The purpose is to remove the unnecessary pgstat_flush_io() call from
> WalWriterMain(). In passing the patch also removes pgstat_report_wal() because
> it just ends up calling pgstat_flush_wal().
>
> Is your remark related to the way it has been done or do you think it's just
> fine to keep the useless pgstat_flush_io() call? (I agree that the gain is not
> that much as pgstat_io_flush_cb() probably just returns false here when checking
> for "have_iostats").

Yea, i think it's fine to just call it unnecessarily. Particularly because we
do want to actually report IO stats for walwriter eventually.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-12-18 17:00:48 Re: Regression tests fail on OpenBSD due to low semmns value
Previous Message Andres Freund 2024-12-18 16:51:48 Re: Regression tests fail on OpenBSD due to low semmns value