pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: ERROR: invalid spinlock number: 0
Date: Mon, 15 Feb 2021 20:49:08 +0900
Message-ID: <0c58fb4f-3492-c69e-c9fb-56dc252d22fd@oss.nttdata.com> (raw)
In-Reply-To: <YCpQwdyXErcTRhVX@paquier.xyz>
References: <7ef8708c-5b6b-edd3-2cf2-7783f1c7c175@oss.nttdata.com>
	<YCUpTL8bZHa+9K+0@paquier.xyz>
	<79698f73-7dd7-d9e3-5322-4032b4428653@oss.nttdata.com>
	<YCowabyl1dwan+JP@paquier.xyz>
	<CA+hUKG+tZHpADD_BsPp=c3EiYeenTTx5AxsZVGkv1mA0J3O21w@mail.gmail.com>
	<YCpQwdyXErcTRhVX@paquier.xyz>



On 2021/02/15 19:45, 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.

But on second thought, if we make WalRceiverMain() call pg_atomic_init_u64(),
the variable is initialized (i,e., SpinLockInit() is called in --disable-atomics)
every time walreceiver is started. That may be problematic? If so, the variable
needs to be initialized in WalRcvShmemInit(), instead.

BTW, the recent commit 46d6e5f567 has the similar issue. The variable
that commit added is initialized in InitProcess(), but maybe should be done
in InitProcGlobal() or elsewhere.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION





view thread (13+ messages)  latest in thread

Message-ID: <0c58fb4f-3492-c69e-c9fb-56dc252d22fd@oss.nttdata.com>
Permalink:  ../0c58fb4f-3492-c69e-c9fb-56dc252d22fd@oss.nttdata.com/
Also on:    postgresql.org/message-id/0c58fb4f-3492-c69e-c9fb-56dc252d22fd@oss.nttdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: masao.fujii@oss.nttdata.com, michael@paquier.xyz, thomas.munro@gmail.com
  Subject: Re: ERROR: invalid spinlock number: 0
  In-Reply-To: <0c58fb4f-3492-c69e-c9fb-56dc252d22fd@oss.nttdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox