Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd05a387

Browse files
author
Amit Kapila
committed
Doc: Clarify theinactive_since field description.
Updated to specify that it represents the exact time a slot becameinactive, rather than the period of inactivity.Reported-by: Peter SmithAuthor: Bruce Momjian, Nisha MoondReviewed-by: Amit Kapila, Peter SmithBackpatch-through: 17Discussion:https://postgr.es/m/CAHut+PuvsyA5v8y7rYoY9mkDQzUhwaESM05yCByTMaDoRh30tA@mail.gmail.com
1 parentdb80507 commitd05a387

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

‎doc/src/sgml/system-views.sgml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,7 +2435,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
24352435
<structfield>active</structfield> <type>bool</type>
24362436
</para>
24372437
<para>
2438-
True if this slot is currentlyactivelybeingused
2438+
True if this slot is currently beingstreamed
24392439
</para></entry>
24402440
</row>
24412441

@@ -2444,9 +2444,8 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
24442444
<structfield>active_pid</structfield> <type>int4</type>
24452445
</para>
24462446
<para>
2447-
The process ID of the session using this slot if the slot
2448-
is currently actively being used. <literal>NULL</literal> if
2449-
inactive.
2447+
The process ID of the session streaming data for this slot.
2448+
<literal>NULL</literal> if inactive.
24502449
</para></entry>
24512450
</row>
24522451

@@ -2566,15 +2565,18 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
25662565
<structfield>inactive_since</structfield> <type>timestamptz</type>
25672566
</para>
25682567
<para>
2569-
The timesince the slothas becomeinactive.
2570-
<literal>NULL</literal> if theslot is currently beingused.
2568+
The timewhen the slotbecameinactive. <literal>NULL</literal> if the
2569+
slot is currently beingstreamed.
25712570
Note that for slots on the standby that are being synced from a
25722571
primary server (whose <structfield>synced</structfield> field is
2573-
<literal>true</literal>), the
2574-
<structfield>inactive_since</structfield> indicates the last
2575-
synchronization (see
2576-
<xref linkend="logicaldecoding-replication-slots-synchronization"/>)
2577-
time.
2572+
<literal>true</literal>), the <structfield>inactive_since</structfield>
2573+
indicates the time when slot synchronization (see <xref
2574+
linkend="logicaldecoding-replication-slots-synchronization"/>)
2575+
was most recently stopped. <literal>NULL</literal> if the slot
2576+
has always been synchronized. On standby, this is useful for slots
2577+
that are being synced from a primary server (whose
2578+
<structfield>synced</structfield> field is <literal>true</literal>)
2579+
so they know when the slot stopped being synchronized.
25782580
</para></entry>
25792581
</row>
25802582

‎src/backend/replication/logical/slotsync.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ update_synced_slots_inactive_since(void)
15151515
* correctly interpret the inactive_since if the standby gets promoted
15161516
* without a restart. We don't want the slots to appear inactive for a
15171517
* long time after promotion if they haven't been synchronized recently.
1518-
* Whoever acquires the slot i.e.makes the slot active will reset it.
1518+
* Whoever acquires the slot, i.e.,makes the slot active, will reset it.
15191519
*/
15201520
if (!StandbyMode)
15211521
return;

‎src/include/replication/slot.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ typedef struct ReplicationSlot
205205
*/
206206
XLogRecPtrlast_saved_confirmed_flush;
207207

208-
/* The time since the slot has become inactive */
208+
/*
209+
* The time when the slot became inactive. For synced slots on a standby
210+
* server, it represents the time when slot synchronization was most
211+
* recently stopped.
212+
*/
209213
TimestampTzinactive_since;
210214
}ReplicationSlot;
211215

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp