From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: ERROR: invalid spinlock number: 0
Date: Thu, 18 Feb 2021 23:32:16 +0900
Message-ID: <d1325f62-16f3-9cee-9ca1-8e2626e17b29@oss.nttdata.com> (raw)
In-Reply-To: <YCyg+XrLMcYWpNOT@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>
<20210215212805.dfahbpqqpnl6lgwm@alap3.anarazel.de>
<918a47fc-e1fa-0c99-15e3-59b520455fe0@oss.nttdata.com>
<YCtrN5BgwK9JuQyd@paquier.xyz>
<efca765d-a523-dd5d-549d-04f8d76837ac@oss.nttdata.com>
<YCyg+XrLMcYWpNOT@paquier.xyz>
On 2021/02/17 13:52, Michael Paquier wrote:
> On Tue, Feb 16, 2021 at 11:47:52PM +0900, Fujii Masao wrote:
>> On 2021/02/16 15:50, Michael Paquier wrote:
>>> + /*
>>> + * Read "writtenUpto" without holding a spinlock. So it may not be
>>> + * consistent with other WAL receiver's shared variables protected by a
>>> + * spinlock. This is OK because that variable is used only for
>>> + * informational purpose and should not be used for data integrity checks.
>>> + */
>>> What about the following?
>>> "Read "writtenUpto" without holding a spinlock. Note that it may not
>>> be consistent with the other shared variables of the WAL receiver
>>> protected by a spinlock, but this should not be used for data
>>> integrity checks."
>>
>> Sounds good. Attached is the updated version of the patch.
>
> Thanks, looks good to me.
Pushed. Thanks!
>
>>> I agree that what has been done with MyProc->waitStart in 46d6e5f is
>>> not safe, and that initialization should happen once at postmaster
>>> startup, with a write(0) when starting the backend. There are two of
>>> them in proc.c, one in twophase.c. Do you mind if I add an open item
>>> for this one?
>>
>> Yeah, please feel free to do that! BTW, I already posted the patch
>> addressing that issue, at [1].
>
> Okay, item added with a link to the original thread.
Thanks!
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
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, andres@anarazel.de, thomas.munro@gmail.com
Subject: Re: ERROR: invalid spinlock number: 0
In-Reply-To: <d1325f62-16f3-9cee-9ca1-8e2626e17b29@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