Fix comments atop pg_get_replication_slots

Started by sirisha chamarthiabout 3 years ago4 messages
#1sirisha chamarthi
sirichamarthi22@gmail.com
1 attachment(s)

Hi Hackers,

The comments atop seem to indicate that it is only showing active
replication slots. The comment is ambiguous as it also shows all the slots
including lost and inactive slots. Attached a small patch to fix it.

Thanks,
Sirisha

Attachments:

0001-Fix-atop-pg_get_replication_slots-function-to-reflec.patchapplication/octet-stream; name=0001-Fix-atop-pg_get_replication_slots-function-to-reflec.patchDownload
From 5df2518d39c46380a17ff42f0ed06538f35888e9 Mon Sep 17 00:00:00 2001
From: root <root@pgvm.rlsumirojk0etd4qpjbaa2afce.tx.internal.cloudapp.net>
Date: Mon, 21 Nov 2022 07:06:22 +0000
Subject: [PATCH] Fix atop pg_get_replication_slots function to reflect what
 code does

---
 src/backend/replication/slotfuncs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c
index 16a3527903..359833cd4c 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -226,7 +226,7 @@ pg_drop_replication_slot(PG_FUNCTION_ARGS)
 }
 
 /*
- * pg_get_replication_slots - SQL SRF showing active replication slots.
+ * pg_get_replication_slots - SQL SRF showing all replication slots.
  */
 Datum
 pg_get_replication_slots(PG_FUNCTION_ARGS)
-- 
2.25.1

#2Amit Kapila
amit.kapila16@gmail.com
In reply to: sirisha chamarthi (#1)
Re: Fix comments atop pg_get_replication_slots

On Mon, Nov 21, 2022 at 12:45 PM sirisha chamarthi
<sirichamarthi22@gmail.com> wrote:

Hi Hackers,

The comments atop seem to indicate that it is only showing active replication slots. The comment is ambiguous as it also shows all the slots including lost and inactive slots. Attached a small patch to fix it.

I agree that it is a bit confusing. How about "SQL SRF showing all
replication slots that currently exist on the database cluster"?

--
With Regards,
Amit Kapila.

#3sirisha chamarthi
sirichamarthi22@gmail.com
In reply to: Amit Kapila (#2)
1 attachment(s)
Re: Fix comments atop pg_get_replication_slots

Amit, thanks for looking into this!

On Sun, Nov 20, 2022 at 11:38 PM Amit Kapila <amit.kapila16@gmail.com>
wrote:

On Mon, Nov 21, 2022 at 12:45 PM sirisha chamarthi
<sirichamarthi22@gmail.com> wrote:

Hi Hackers,

The comments atop seem to indicate that it is only showing active

replication slots. The comment is ambiguous as it also shows all the slots
including lost and inactive slots. Attached a small patch to fix it.

I agree that it is a bit confusing. How about "SQL SRF showing all
replication slots that currently exist on the database cluster"?

Looks good to me. Attached a patch for the same.

Show quoted text

--
With Regards,
Amit Kapila.

Attachments:

0002-Fix-atop-pg_get_replication_slots-function-to-reflec.patchapplication/octet-stream; name=0002-Fix-atop-pg_get_replication_slots-function-to-reflec.patchDownload
From bd5fcf350cd44ad7df0e4287aab43f0fa467c547 Mon Sep 17 00:00:00 2001
From: root <root@pgvm.rlsumirojk0etd4qpjbaa2afce.tx.internal.cloudapp.net>
Date: Mon, 21 Nov 2022 07:46:43 +0000
Subject: [PATCH] Fix atop pg_get_replication_slots function to reflect what
 code does

---
 src/backend/replication/slotfuncs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c
index 16a3527903..5fab59c2d6 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -226,7 +226,8 @@ pg_drop_replication_slot(PG_FUNCTION_ARGS)
 }
 
 /*
- * pg_get_replication_slots - SQL SRF showing active replication slots.
+ * pg_get_replication_slots - SQL SRF showing all replication slots 
+ * that currently exist on the database cluster.
  */
 Datum
 pg_get_replication_slots(PG_FUNCTION_ARGS)
-- 
2.25.1

#4Amit Kapila
amit.kapila16@gmail.com
In reply to: sirisha chamarthi (#3)
Re: Fix comments atop pg_get_replication_slots

On Mon, Nov 21, 2022 at 1:22 PM sirisha chamarthi
<sirichamarthi22@gmail.com> wrote:

Looks good to me. Attached a patch for the same.

Pushed.

--
With Regards,
Amit Kapila.