Re: pgsql: Implement pg_wal_replay_wait() stored procedure - Mailing list pgsql-committers

From David Rowley
Subject Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Date
Msg-id CAApHDvpE3p3iiLy-H3jzBHmGn1V+KeeH=myO7+359qLjRF=Nzg@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Implement pg_wal_replay_wait() stored procedure  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-committers
On Wed, 3 Apr 2024 at 09:42, Alexander Korotkov <aekorotkov@gmail.com> wrote:
> I'm trying to figure out if this failure could be related to this commit...
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=culicidae&dt=2024-04-02%2020%3A24%3A55

Yeah, I think it is.

The problem is that in WaitLSNSetLatches() waitLSN is NULL, so
SpinLockAcquire(&waitLSN->mutex); segfaults.  This shared memory
segment is initialized in WaitLSNShmemInit() called via
CreateSharedMemoryAndSemaphores().  If you look at main() in main.c
EXEC_BACKEND builds call SubPostmasterMain(), which has no call to
CreateSharedMemoryAndSemaphores(), so waitLSN isn't initialized.

David



pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Move WaitLSNShmemInit() to CreateOrAttachShmemStructs()