On Thu, Oct 24, 2024 at 08:32:54AM +1100, Peter Smith wrote:
> Hi. Here are a couple of minor comments.
>
> 1.
> + The time slot synchronization (see <xref
> + linkend="logicaldecoding-replication-slots-synchronization"/>)
> + was most recently stopped.
>
> /The time slot/The time when slot/
>
> ~~~
>
> 2.
> - /* The time since the slot has become inactive */
> + /* The time slot sychronized was stopped. */
>
>
> Maybe just make this comment the same as the sentence used in the docs:
> - e.g. add "when"; fix, typo "sychronized", etc.
>
>
> /The time slot sychronized was stopped./The time when slot
> synchronization was most recently stopped./
Yes, all good suggestions, updated patch attached.
--
Bruce Momjian <[email protected]> https://momjian.us
EDB https://enterprisedb.com
When a patient asks the doctor, "Am I going to die?", he means
"Am I going to die soon?"
diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml
index 61d28e701f2..d853f7fe49b 100644
--- a/doc/src/sgml/system-views.sgml
+++ b/doc/src/sgml/system-views.sgml
@@ -2435,7 +2435,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
<structfield>active</structfield> <type>bool</type>
</para>
<para>
- True if this slot is currently actively being used
+ True if this slot is currently being streamed
</para></entry>
</row>
@@ -2444,9 +2444,8 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
<structfield>active_pid</structfield> <type>int4</type>
</para>
<para>
- The process ID of the session using this slot if the slot
- is currently actively being used. <literal>NULL</literal> if
- inactive.
+ The process ID of the session streaming data for this slot.
+ <literal>NULL</literal> if inactive.
</para></entry>
</row>
@@ -2566,15 +2565,13 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
<structfield>inactive_since</structfield> <type>timestamptz</type>
</para>
<para>
- The time since the slot has become inactive.
- <literal>NULL</literal> if the slot is currently being used.
- Note that for slots on the standby that are being synced from a
- primary server (whose <structfield>synced</structfield> field is
- <literal>true</literal>), the
- <structfield>inactive_since</structfield> indicates the last
- synchronization (see
- <xref linkend="logicaldecoding-replication-slots-synchronization"/>)
- time.
+ The time when slot synchronization (see <xref
+ linkend="logicaldecoding-replication-slots-synchronization"/>)
+ was most recently stopped. <literal>NULL</literal> if the slot
+ has always been synchronized. This is useful for slots on the
+ standby that are being synced from a primary server (whose
+ <structfield>synced</structfield> field is <literal>true</literal>)
+ so they know when the slot stopped being synchronized.
</para></entry>
</row>
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index d62186a5107..f4f80b23129 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -1515,7 +1515,7 @@ update_synced_slots_inactive_since(void)
* correctly interpret the inactive_since if the standby gets promoted
* without a restart. We don't want the slots to appear inactive for a
* long time after promotion if they haven't been synchronized recently.
- * Whoever acquires the slot i.e.makes the slot active will reset it.
+ * Whoever acquires the slot, i.e., makes the slot active, will reset it.
*/
if (!StandbyMode)
return;
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index 45582cf9d89..90ea2979b87 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -205,7 +205,7 @@ typedef struct ReplicationSlot
*/
XLogRecPtr last_saved_confirmed_flush;
- /* The time since the slot has become inactive */
+ /* The time when slot synchronization was most recently stopped. */
TimestampTz inactive_since;
} ReplicationSlot;