Re: ERROR: invalid spinlock number: 0
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Andres Freund <andres@anarazel.de>, Thomas Munro <thomas.munro@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2021-02-17T04:52:09Z
Lists: pgsql-hackers
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. >> 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. -- Michael
Commits
-
Fix "invalid spinlock number: 0" error in pg_stat_wal_receiver.
- d4b667e9353a 13.3 landed
- 614b7f18b3bd 14.0 landed
-
Display the time when the process started waiting for the lock, in pg_locks, take 2
- 46d6e5f56790 14.0 cited
-
Display the time when the process started waiting for the lock, in pg_locks.
- 3b733fcd0419 14.0 cited
-
Make pg_stat_wal_receiver consistent with the WAL receiver's shmem info
- 2c8dd05d6cbc 13.0 cited