fix the spelling mistakes of comments

Started by Liu, Huailingover 7 years ago5 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliessuccessCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t40381
psql -h localhost -U postgres

Built from patchset v1 (message #1), September 20, 2026 at 12:43 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t40381_1 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t40381_1 && git checkout t40381_1

Patchset v1 (message #1) is on t40381_1

Jump to latest
#1Liu, Huailing
liuhuailing@cn.fujitsu.com

Hi, everyone

When reading the codes in file src/backend/replication/syncrep.c,
I have found two spelling mistakes of comments.

First
---------------------------------------------------------------------------------------------
/*-------------------------------------------------------------------------
*
* syncrep.c
*
* Synchronous replication is new as of PostgreSQL 9.1.
*
* If requested, transaction commits wait until their commit LSN are
* acknowledged by the synchronous standbys.
*
* This module contains the code for waiting and release★ of backends.
* All code in this module executes on the primary. The core streaming
* replication transport remains within WALreceiver/WALsender modules.
----------------------------------------------------------------------------------------------------
I think the word marked★ should be 'releasing'.

Second
-----------------------------------------------------------------------------------------------------------
/*
* Walk★ the specified queue from head. Set the state of any backends that
* need to be woken, remove them from the queue, and then wake them.
* Pass all = true to wake whole queue; otherwise, just wake up to
* the walsender's LSN.
*
* Must hold SyncRepLock.
*/
static int
SyncRepWakeQueue(bool all, int mode)
--------------------------------------------------------------------------------------------------------------
I think the word marked★ should be 'Wake'.

Attached patch fixed them.

--
以上
Liu Huailing
--------------------------------------------------
Liu Huailing
Development Department III
Software Division II
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
ADDR.: No.6 Wenzhu Road, Software Avenue,
Nanjing, 210012, China
TEL : +86+25-86630566-8439
COINS: 7998-8439
FAX : +86+25-83317685
MAIL : liuhuailing@cn.fujitsu.com
--------------------------------------------------

Attachments:

t40381_1
syncrep.c.patchapplication/octet-stream; name=syncrep.c.patchDownload+2-2
#2Robert Haas
robertmhaas@gmail.com
In reply to: Liu, Huailing (#1)
Re: fix the spelling mistakes of comments

On Wed, Apr 3, 2019 at 6:55 AM Liu, Huailing <liuhuailing@cn.fujitsu.com> wrote:

* This module contains the code for waiting and release★ of backends.
* All code in this module executes on the primary. The core streaming
* replication transport remains within WALreceiver/WALsender modules.

I think the word marked★ should be 'releasing'.

It could be changed, but I don't think it's really wrong as written.

* Walk★ the specified queue from head. Set the state of any backends that

I think the word marked★ should be 'Wake'.

I think it's correct as written.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Michael Paquier
michael@paquier.xyz
In reply to: Robert Haas (#2)
Re: fix the spelling mistakes of comments

On Thu, Apr 04, 2019 at 07:57:02AM -0400, Robert Haas wrote:

On Wed, Apr 3, 2019 at 6:55 AM Liu, Huailing <liuhuailing@cn.fujitsu.com> wrote:

* This module contains the code for waiting and release★ of backends.
* All code in this module executes on the primary. The core streaming
* replication transport remains within WALreceiver/WALsender modules.

I think the word marked★ should be 'releasing'.

It could be changed, but I don't think it's really wrong as written.

Indeed.

* Walk★ the specified queue from head. Set the state of any backends that

I think the word marked★ should be 'Wake'.

I think it's correct as written.

Yes, it's correct as-is. The code *walks* through the shmem queue to
*wake* some of its elements.
--
Michael

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Michael Paquier (#3)
Re: fix the spelling mistakes of comments

Michael Paquier <michael@paquier.xyz> writes:

On Thu, Apr 04, 2019 at 07:57:02AM -0400, Robert Haas wrote:

On Wed, Apr 3, 2019 at 6:55 AM Liu, Huailing <liuhuailing@cn.fujitsu.com> wrote:

* This module contains the code for waiting and release★ of backends.

I think the word marked★ should be 'releasing'.

It could be changed, but I don't think it's really wrong as written.

Indeed.

Well, the problem is the lack of grammatical agreement between "waiting"
and "release". It's poor English at least.

regards, tom lane

#5Robert Haas
robertmhaas@gmail.com
In reply to: Tom Lane (#4)
Re: fix the spelling mistakes of comments

On Thu, Apr 4, 2019 at 11:55 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Indeed.

Well, the problem is the lack of grammatical agreement between "waiting"
and "release". It's poor English at least.

It's not correct for formal writing, but I think a lot of people would
find it acceptable in casual speech. At any rate, the proposed change
to "This module contains the code for waiting and releasing of
backends" is no better, because it's still faulty parallelism. You
can release a backend, but you can't "wait" a backend. If you want to
make it really good English, you're going to have to change more than
one word. (e.g. "This module contains the code to make backends wait
for replication, and to release them from waiting at the appropriate
time.")

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company