</term>
<listitem>
<para>
- Causes each replication command to be logged in the server log.
- See <xref linkend="protocol-replication"/> for more information about
- replication command. The default value is <literal>off</literal>.
- Only superusers and users with the appropriate <literal>SET</literal>
- privilege can change this setting.
+ Causes each replication command and <literal>walsender</literal>
+ process's replication slot acquisition/release to be logged in the
+ server log. See <xref linkend="protocol-replication"/> for more
+ information about replication command. The default value is
+ <literal>off</literal>. Only superusers and users with the appropriate
+ <literal>SET</literal> privilege can change this setting.
</para>
</listitem>
</varlistentry>
*/
if (SlotIsLogical(s))
pgstat_acquire_replslot(s);
+
+ if (am_walsender)
+ {
+ ereport(log_replication_commands ? LOG : DEBUG1,
+ SlotIsLogical(s)
+ ? errmsg("acquired logical replication slot \"%s\"",
+ NameStr(s->data.name))
+ : errmsg("acquired physical replication slot \"%s\"",
+ NameStr(s->data.name)));
+ }
}
/*
ReplicationSlotRelease(void)
{
ReplicationSlot *slot = MyReplicationSlot;
+ char *slotname = NULL; /* keep compiler quiet */
+ bool is_logical = false; /* keep compiler quiet */
Assert(slot != NULL && slot->active_pid != 0);
+ if (am_walsender)
+ {
+ slotname = pstrdup(NameStr(slot->data.name));
+ is_logical = SlotIsLogical(slot);
+ }
+
if (slot->data.persistency == RS_EPHEMERAL)
{
/*
MyProc->statusFlags &= ~PROC_IN_LOGICAL_DECODING;
ProcGlobal->statusFlags[MyProc->pgxactoff] = MyProc->statusFlags;
LWLockRelease(ProcArrayLock);
+
+ if (am_walsender)
+ {
+ ereport(log_replication_commands ? LOG : DEBUG1,
+ is_logical
+ ? errmsg("released logical replication slot \"%s\"",
+ slotname)
+ : errmsg("released physical replication slot \"%s\"",
+ slotname));
+
+ pfree(slotname);
+ }
}
/*