Re: ERROR: invalid spinlock number: 0
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@postgresql.org
Date: 2021-02-11T14:30:13Z
Lists: pgsql-hackers
Attachments
- bugfix_pg_stat_wal_receiver.patch (text/plain) patch
On 2021/02/11 21:55, Michael Paquier wrote: > Hi Fujii-san, > > On Tue, Feb 09, 2021 at 11:17:04PM +0900, Fujii Masao wrote: >> ISTM that the commit 2c8dd05d6c caused this issue. The commit changed >> pg_stat_get_wal_receiver() so that it reads "writtenUpto" by using >> pg_atomic_read_u64(). But since "writtenUpto" is initialized only when >> walreceiver starts up, reading "writtenUpto" before the startup of >> walreceiver can cause the error. > > Indeed, that's a problem. We should at least move that out of the > spin lock area. Yes, so what about the attached patch? 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. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
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