Fix contradictory comment for pgstat_slru_flush_cb()

Поиск
Список
Период
Сортировка
Искать

Fix contradictory comment for pgstat_slru_flush_cb()

От:
Shinya Kato <shinya11.kato@gmail.com>
Дата:
Вложения:
Hi hackers,

The comment above pgstat_slru_flush_cb() in pgstat_slru.c describes
the return value twice, and the two descriptions contradict each
other:

    /*
     * Flush out locally pending SLRU stats entries
     *
     * If nowait is true, this function returns false on lock failure. Otherwise
     * this function always returns true.
     *
     * If nowait is true, this function returns true if the lock could not be
     * acquired. Otherwise return false.
     */

The first paragraph has the return value backwards. The function
returns true only when nowait is set and the lock could not be
acquired, and false otherwise, as the second paragraph correctly
states. The reversed paragraph is a leftover from f4d3ca421d9, which
removed an unrelated sentence but not the surrounding text.

The attached patch removes the incorrect first paragraph.

Thoughts?

-- 
Best regards,
Shinya Kato
NTT OSS Center

Re: Fix contradictory comment for pgstat_slru_flush_cb()

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
On Mon, Jun 22, 2026 at 10:00:58PM +0900, Shinya Kato wrote:
> The first paragraph has the return value backwards. The function
> returns true only when nowait is set and the lock could not be
> acquired, and false otherwise, as the second paragraph correctly
> states. The reversed paragraph is a leftover from f4d3ca421d9, which
> removed an unrelated sentence but not the surrounding text.
> 
> The attached patch removes the incorrect first paragraph.

Looks like you are right here.  Grabbed for later.
--
Michael

Re: Fix contradictory comment for pgstat_slru_flush_cb()

От:
Shinya Kato <shinya11.kato@gmail.com>
Дата:
On Tue, Jun 23, 2026 at 8:29 AM Michael Paquier  wrote:
> Looks like you are right here.  Grabbed for later.

Thanks for looking into this. Just to keep track of it, I've created a
CF entry [1].

[1] https://commitfest.postgresql.org/patch/7135/

-- 
Shinya Kato
NTT OSS Center


Re: Fix contradictory comment for pgstat_slru_flush_cb()

От:
Shinya Kato <shinya11.kato@gmail.com>
Дата:
On Thu, Aug 13, 2026 at 2:22 PM Michael Paquier  wrote:
>
> On Wed, Aug 12, 2026 at 12:28:18PM +0900, Shinya Kato wrote:
> > Thanks for looking into this. Just to keep track of it, I've created a
> > CF entry [1].
> >
> > [1] https://commitfest.postgresql.org/patch/7135/
>
> No need to, please see b3a95566fc25.

I didn't see this, thanks!


-- 
Shinya Kato
NTT OSS Center


FAQ