fix the spelling mistakes of comments
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:
syncrep.c.patchapplication/octet-stream; name=syncrep.c.patchDownload
diff --git a/src/backend/replication/syncrep.c b/src/backend/replication/syncrep.c
index 6c160c1..6f25506 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -7,7 +7,7 @@
* 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.
+ * This module contains the code for waiting and releasing of backends.
* All code in this module executes on the primary. The core streaming
* replication transport remains within WALreceiver/WALsender modules.
*
@@ -989,7 +989,7 @@ SyncRepGetStandbyPriority(void)
}
/*
- * Walk the specified queue from head. Set the state of any backends that
+ * Wake 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.
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
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
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
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