Fix incorrect buffer lock description in pg_visibility comment

Started by Chao Li11 months ago5 messageshackers
Jump to latest
#1Chao Li
li.evan.chao@gmail.com

Hi Hackers,

While reviewing the patch [1]/messages/by-id/CAEze2WgPu-EYYuYQimy=AHQHGa7w8EvLVve5DM5eGMR6zh-7sw@mail.gmail.com, though I couldn’t raise a comment for it, I
noticed a comment error in the file pg_visibility.c, where a buffer lock is
held in shared mode but the code comment mentioned exclusive mode. I am
filing a small patch to correct the comment.

I only changed "exclusively" to "shared", the format changed was done by
pgindent.

[1]: /messages/by-id/CAEze2WgPu-EYYuYQimy=AHQHGa7w8EvLVve5DM5eGMR6zh-7sw@mail.gmail.com
/messages/by-id/CAEze2WgPu-EYYuYQimy=AHQHGa7w8EvLVve5DM5eGMR6zh-7sw@mail.gmail.com

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

Attachments:

v1-0001-Fix-incorrect-buffer-lock-description-in-pg_visib.patchapplication/octet-stream; name=v1-0001-Fix-incorrect-buffer-lock-description-in-pg_visib.patchDownload+5-6
#2Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Chao Li (#1)
Re: Fix incorrect buffer lock description in pg_visibility comment

Hi,

On Tue, Dec 23, 2025 at 6:18 PM Chao Li <li.evan.chao@gmail.com> wrote:

Hi Hackers,

While reviewing the patch [1], though I couldn’t raise a comment for it, I noticed a comment error in the file pg_visibility.c, where a buffer lock is held in shared mode but the code comment mentioned exclusive mode. I am filing a small patch to correct the comment.

I only changed "exclusively" to "shared", the format changed was done by pgindent.

Yeah, it seems like a typo since the first commit of pg_visiblity,
e472ce9624e0. I think we can backpatch it to all supported versions.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

#3Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Masahiko Sawada (#2)
Re: Fix incorrect buffer lock description in pg_visibility comment

On Mon, Dec 29, 2025 at 10:33 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote:

Hi,

On Tue, Dec 23, 2025 at 6:18 PM Chao Li <li.evan.chao@gmail.com> wrote:

Hi Hackers,

While reviewing the patch [1], though I couldn’t raise a comment for it, I noticed a comment error in the file pg_visibility.c, where a buffer lock is held in shared mode but the code comment mentioned exclusive mode. I am filing a small patch to correct the comment.

I only changed "exclusively" to "shared", the format changed was done by pgindent.

Yeah, it seems like a typo since the first commit of pg_visiblity,
e472ce9624e0. I think we can backpatch it to all supported versions.

I find that "shared locked" sounds unnatural to me. How about
rephrasing to "... we're holding the buffer locked in shared mode"?
I've attached the patch.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

Attachments:

t52988_2
0001-pg_visibility-Fix-incorrect-buffer-lock-description.patchapplication/octet-stream; name=0001-pg_visibility-Fix-incorrect-buffer-lock-description.patchDownload+1-2
#4Chao Li
li.evan.chao@gmail.com
In reply to: Masahiko Sawada (#3)
Re: Fix incorrect buffer lock description in pg_visibility comment

On Jan 6, 2026, at 02:41, Masahiko Sawada <sawada.mshk@gmail.com> wrote:

I find that "shared locked" sounds unnatural to me. How about
rephrasing to "... we're holding the buffer locked in shared mode”?

Hi Masahiko-san,

Thanks for taking care of this patch. Yeah, I agree “shared locked” is not good, at least it should be “shared-ly locked”. So, Your version, “locked in shared mode” is better.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/

#5Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Chao Li (#4)
Re: Fix incorrect buffer lock description in pg_visibility comment

On Mon, Jan 5, 2026 at 3:45 PM Chao Li <li.evan.chao@gmail.com> wrote:

On Jan 6, 2026, at 02:41, Masahiko Sawada <sawada.mshk@gmail.com> wrote:

I find that "shared locked" sounds unnatural to me. How about
rephrasing to "... we're holding the buffer locked in shared mode”?

Hi Masahiko-san,

Thanks for taking care of this patch. Yeah, I agree “shared locked” is not good, at least it should be “shared-ly locked”. So, Your version, “locked in shared mode” is better.

Thank you for reviewing the patch! Pushed.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com