Re: Lockless exit path for ReplicationOriginExitCleanup

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Lockless exit path for ReplicationOriginExitCleanup
Date: 2023-11-22 08:57:58
Message-ID: CAA4eK1KTn_uML5dFmr==uwX6ZboiD6TWoEabMZ_inqQtNnYC4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 22, 2023 at 2:12 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> While looking at the use of session_replication_state, I noticed that
> ReplicationOriginLock is acquired in ReplicationOriginExitCleanup()
> even if session_replication_state is reset to NULL by
> replorigin_session_reset(). Why can't there be a lockless exit path
> something like [1] similar to
> replorigin_session_reset() which checks session_replication_state ==
> NULL without a lock?
>

I don't see any problem with such a check but not sure of the benefit
of doing so either.

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2023-11-22 09:26:23 Commitfest 2023-11 update 2
Previous Message Amit Kapila 2023-11-22 08:48:58 Re: Stop the search once replication origin is found