static void
ReplicationSlotShmemExit(int code, Datum arg)
{
+ /* temp debugging aid to analyze 019_replslot_limit failures */
+ elog(DEBUG3, "replication slot exit hook, %s active slot",
+ MyReplicationSlot != NULL ? "with" : "without");
+
/* Make sure active replication slots are released */
if (MyReplicationSlot != NULL)
ReplicationSlotRelease();
Assert(MyReplicationSlot == NULL);
restart:
+ /* temp debugging aid to analyze 019_replslot_limit failures */
+ elog(DEBUG3, "temporary replication slot cleanup: begin");
+
LWLockAcquire(ReplicationSlotControlLock, LW_SHARED);
for (i = 0; i < max_replication_slots; i++)
{
}
LWLockRelease(ReplicationSlotControlLock);
+
+ elog(DEBUG3, "temporary replication slot cleanup: done");
}
/*
(void) kill(active_pid, SIGTERM);
last_signaled_pid = active_pid;
}
+ else
+ {
+ /* temp debugging aid to analyze 019_replslot_limit failures */
+ elog(DEBUG3, "not signalling process %d during invalidation of slot \"%s\"",
+ active_pid, NameStr(slotname));
+ }
/* Wait until the slot is released. */
ConditionVariableSleep(&s->active_cv,
XLogSegNoOffsetToRecPtr(oldestSegno, 0, wal_segment_size, oldestLSN);
restart:
+ /* temp debugging aid to analyze 019_replslot_limit failures */
+ elog(DEBUG3, "begin invalidating obsolete replication slots older than %X/%X",
+ LSN_FORMAT_ARGS(oldestLSN));
+
LWLockAcquire(ReplicationSlotControlLock, LW_SHARED);
for (int i = 0; i < max_replication_slots; i++)
{
ReplicationSlotsComputeRequiredLSN();
}
+ elog(DEBUG3, "done invalidating obsolete replication slots");
+
return invalidated;
}
max_wal_size = 2MB
log_checkpoints = yes
max_slot_wal_keep_size = 1MB
+
+ # temp debugging aid to analyze 019_replslot_limit failures
+ log_min_messages=debug3
));
$node_primary3->start;
$node_primary3->safe_psql('postgres',
"SELECT pg_create_physical_replication_slot('rep3')");
# Take backup
$backup_name = 'my_backup';
-$node_primary3->backup($backup_name);
+$node_primary3->backup($backup_name, backup_options => ['--verbose']);
# Create standby
my $node_standby3 = PostgreSQL::Test::Cluster->new('standby_3');
$node_standby3->init_from_backup($node_primary3, $backup_name,