Re: Unexpected "shared memory block is still in use"

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2019-05-09T13:47:34Z
Lists: pgsql-hackers
Noah Misch <noah@leadboat.com> writes:
> On Wed, May 08, 2019 at 02:32:46PM -0400, Tom Lane wrote:
>> Just now, while running a parallel check-world on HEAD according to the
>> same script I've been using for quite some time, one of the TAP tests
>> died during initdb:
>> performing post-bootstrap initialization ... 2019-05-08 13:59:19.963 EDT [18351] FATAL:  pre-existing shared memory block (key 5440004, ID 1734475802) is still in use

> The odds are very high that you would not have gotten that error before that
> commit.  But if the cause matches your guess, it's not something wrong with
> the commit ...

Fair point.

> What OS, OS version, and filesystem?

Up-to-date RHEL6 (kernel 2.6.32-754.12.1.el6.x86_64), ext4 over LVM
on spinning rust with an LSI MegaRAID controller in front of it.

Since complaining, I've done half a dozen more parallel check-worlds
without issue, so the error was and still is rare.  This matches the
fact that we've not seen it in the buildfarm :-(.

			regards, tom lane



Commits

  1. Use data directory inode number, not port, to select SysV resource keys.

  2. Cope with EINVAL and EIDRM shmat() failures in PGSharedMemoryAttach.

  3. Consistently test for in-use shared memory.