Fix contradictory comment for pgstat_slru_flush_cb()

From: Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Fix contradictory comment for pgstat_slru_flush_cb()
Date: 2026-06-22 13:00:58
Message-ID: CAOzEurRtfgkMELeFoNN9NroMjQnU7E3-OAx8UF98EteTxWoDGg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-pgstat-Fix-return-value-comment-for-pgstat_slru_f.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Akshay Joshi 2026-06-22 13:04:29 Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement
Previous Message Tatsuo Ishii 2026-06-22 12:55:36 Re: Row pattern recognition