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: pgsql-hackers@postgresql.org
Date: 2021-02-15T08:27:21Z
Lists: pgsql-hackers
On Thu, Feb 11, 2021 at 11:30:13PM +0900, Fujii Masao wrote: > Yes, so what about the attached patch? I see. So the first error triggering the spinlock error would cause a transaction failure because the fallback implementation of atomics uses a spinlock for this variable, and it may not initialized in this code path. > We didn't notice this issue long time because no regression test checks > pg_stat_wal_receiver. So I included such test in the patch. Moving that behind ready_to_display is fine by me seeing where the initialization is done. The test case is a good addition. + * 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. It seems to me that the first two sentences of this comment should be combined together. -- 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