Fix a comment in WalSnd structure

Started by Bharath Rupireddyover 3 years ago2 messages
#1Bharath Rupireddy
bharath.rupireddyforpostgres@gmail.com
1 attachment(s)

Hi,

WalSnd structure mutex is being used to protect all the variables of
that structure, not just 'variables shown above' [1]diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h index c14888e493..9c61f92c44 100644 --- a/src/include/replication/walsender_private.h +++ b/src/include/replication/walsender_private.h @@ -65,7 +65,7 @@ typedef struct WalSnd */ int sync_standby_priority;. A tiny patch
attached to fix the comment.

Thoughts?

[1]
diff --git a/src/include/replication/walsender_private.h
b/src/include/replication/walsender_private.h
index c14888e493..9c61f92c44 100644
--- a/src/include/replication/walsender_private.h
+++ b/src/include/replication/walsender_private.h
@@ -65,7 +65,7 @@ typedef struct WalSnd
         */
        int                     sync_standby_priority;
-       /* Protects shared variables shown above. */
+       /* Protects shared variables in this structure. */
        slock_t         mutex;

--
Bharath Rupireddy
RDS Open Source Databases: https://aws.amazon.com/rds/postgresql/

Attachments:

v1-0001-Fix-a-comment-in-WalSnd-structure.patchapplication/x-patch; name=v1-0001-Fix-a-comment-in-WalSnd-structure.patchDownload
From 58ef0c3165a9a12718af6173d42479c6e8a756de Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Date: Wed, 17 Aug 2022 11:42:51 +0000
Subject: [PATCH v1] Fix a comment in WalSnd structure

WalSnd structure mutex is being used to protect all the variables
of that structure, not just 'variables shown above'. Correct the
comment.
---
 src/include/replication/walsender_private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h
index c14888e493..9c61f92c44 100644
--- a/src/include/replication/walsender_private.h
+++ b/src/include/replication/walsender_private.h
@@ -65,7 +65,7 @@ typedef struct WalSnd
 	 */
 	int			sync_standby_priority;
 
-	/* Protects shared variables shown above. */
+	/* Protects shared variables in this structure. */
 	slock_t		mutex;
 
 	/*
-- 
2.34.1

#2Michael Paquier
michael@paquier.xyz
In reply to: Bharath Rupireddy (#1)
Re: Fix a comment in WalSnd structure

On Fri, Aug 19, 2022 at 05:40:40PM +0530, Bharath Rupireddy wrote:

WalSnd structure mutex is being used to protect all the variables of
that structure, not just 'variables shown above' [1]. A tiny patch
attached to fix the comment.

Yep, walsender.c tells the same story, aka that replyTime and latch
are updated with the spinlock taken. I'll go update the comment, and
you suggestion sounds fine to me.
--
Michael