Re: Avoid unnecessary ReplicationSlotControl lwlock acquistion

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org,Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>,PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Avoid unnecessary ReplicationSlotControl lwlock acquistion
Date: 2020-08-25 02:42:25
Message-ID: B31F589E-4A72-417D-B050-A2030BD88D0D@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On August 24, 2020 7:38:39 PM PDT, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com> wrote:
>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.

Why is it worth doing so?

Regards,

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-08-25 03:00:47 Re: Avoid unnecessary ReplicationSlotControl lwlock acquistion
Previous Message Kyotaro Horiguchi 2020-08-25 02:41:55 Re: "cert" + clientcert=verify-ca in pg_hba.conf?