Re: ERROR: invalid spinlock number: 0

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERROR: invalid spinlock number: 0
Date: 2021-02-18 14:32:16
Message-ID: d1325f62-16f3-9cee-9ca1-8e2626e17b29@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2021-02-18 15:01:39 Re: Problem with accessing TOAST data in stored procedures
Previous Message Ashutosh Bapat 2021-02-18 13:21:37 Re: Printing LSN made easy