Re: Logical replication: stuck spinlock at ReplicationSlotRelease

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Logical replication: stuck spinlock at ReplicationSlotRelease
Date: 2017-08-16 18:40:41
Message-ID: 82ec00b4-2200-9588-d103-0e41bd1f6582@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/23/17 20:58, Peter Eisentraut wrote:
> On 6/23/17 16:15, Andres Freund wrote:
>> On 2017-06-23 13:26:58 -0400, Alvaro Herrera wrote:
>>> Hmm, so for instance in LogicalIncreaseRestartDecodingForSlot() we have
>>> some elog(DEBUG1) calls with the slot spinlock held. That's probably
>>> uncool.
>>
>> It definitely is not cool, rather daft even (it's probably me who wrote
>> that). No idea why I've done it like that, makes no sense.
>
> Do you want to take a look at move those elog calls around a bit? That
> should do it.

This hasn't been fixed yet. How should we do it? Just move the
spinlock release before the elog() calls, thus risking reading some data
unprotected, or copy the necessary things into local variables?

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-08-16 18:52:29 Re: Broken link to DocBook XSL Stylesheets
Previous Message Tom Lane 2017-08-16 18:16:43 Re: Garbled comment in postgresGetForeignJoinPaths