Avoid unnecessary ReplicationSlotControl lwlock acquistion - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Avoid unnecessary ReplicationSlotControl lwlock acquistion
Date
Msg-id CA+fd4k4v6t-8VYsz-U3XSCOjPDhDg67eNk33+ZAf53n9bmNo=w@mail.gmail.com
Whole thread Raw
Responses Re: Avoid unnecessary ReplicationSlotControl lwlock acquistion  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi all,

While testing with DTrace, I realized we acquire
ReplicationSlotControl lwlock at some places even when
max_replication_slots is set to 0. For instance, we call
ReplicationSlotCleanup() within PostgresMian() when an error happens
and acquire ReplicationSlotControl lwlock.

The attached patch fixes some functions so that we quickly return if
max_replication_slots is set to 0.

Regards,

-- 
Masahiko Sawada            http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Problems with the FSM, heap fillfactor, and temporal locality
Next
From: Fujii Masao
Date:
Subject: Re: Creating a function for exposing memory usage of backend process