Re: ERROR: invalid spinlock number: 0 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: ERROR: invalid spinlock number: 0
Date
Msg-id 20210215212805.dfahbpqqpnl6lgwm@alap3.anarazel.de
Whole thread Raw
In response to Re: ERROR: invalid spinlock number: 0  (Michael Paquier <michael@paquier.xyz>)
Responses Re: ERROR: invalid spinlock number: 0
List pgsql-hackers
Hi,

On 2021-02-15 19:45:21 +0900, Michael Paquier wrote:
> On Mon, Feb 15, 2021 at 10:47:05PM +1300, Thomas Munro wrote:
> > Why not initialise it in WalRcvShmemInit()?
> 
> I was thinking about doing that as well, but we have no real need to
> initialize this stuff in most cases, say standalone deployments.  In
> particular for the fallback implementation of atomics, we would
> prepare a spinlock for nothing.

So what? It's just about free to initialize a spinlock, whether it's
using the fallback implementation or not. Initializing upon walsender
startup adds a lot of complications, because e.g. somebody could already
hold the spinlock because the previous walsender just disconnected, and
they were looking at the stats.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Next
From: Zhihong Yu
Date:
Subject: Re: CREATE INDEX CONCURRENTLY on partitioned index