Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly

From: Ryoga Yoshida <bt23yoshidar(at)oss(dot)nttdata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Doesn't pgstat_report_wal() handle the argument "force" incorrectly
Date: 2023-09-25 02:27:27
Message-ID: 2f6f68343fcd244ef7be5dfae8e55f63@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2023-09-25 09:56, Michael Paquier wrote:
> It seems to me that you are right here. It would make sense to me to
> say that force=true is equivalent to nowait=false, as in "I'm OK to
> wait on the lockas I want to make sure that the stats are flushed at
> this point". Currently force=true means nowait=true, as in "I'm OK to
> not have the stats flushed if I cannot take the lock".
>
> Seeing the three callers of pgstat_report_wal(), the checkpointer
> wants to force its way twice, and the WAL writer does not care if they
> are not flushed immediately at it loops forever in this path.
>
> A comment at the top of pgstat_report_wal() would be nice to document
> that a bit better, at least.

Thank you for the review. Certainly, adding a comments is a good idea. I
added a comment.

Ryoga Yoshida

Attachment Content-Type Size
v1-0002-bug-fix-in-foce-within-pgstat_report_wal.patch text/x-diff 804 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2023-09-25 02:38:36 Confused about gram.y referencs in Makefile?
Previous Message Peter Smith 2023-09-25 02:13:59 Re: Synchronizing slots from primary to standby