Thread: Bug? could not remove shared memory segment

Bug? could not remove shared memory segment

From
Fujii Masao
Date:
Hi,

When I shut down the standby server and then the master server in that order,
I found that the master server emit the following message.

LOG:  XX000: could not remove shared memory segment
"/PostgreSQL.1804289383": Invalid argument
LOCATION:  dsm_impl_posix, dsm_impl.c:269

Is this intentional message or a bug?

$ uname -a
Darwin test.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23
16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

I used the latest version of the source code in the git master.

Regards,

-- 
Fujii Masao



Re: Bug? could not remove shared memory segment

From
Robert Haas
Date:
On Tue, Jan 21, 2014 at 1:05 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> When I shut down the standby server and then the master server in that order,
> I found that the master server emit the following message.
>
> LOG:  XX000: could not remove shared memory segment
> "/PostgreSQL.1804289383": Invalid argument
> LOCATION:  dsm_impl_posix, dsm_impl.c:269
>
> Is this intentional message or a bug?
>
> $ uname -a
> Darwin test.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23
> 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64
>
> I used the latest version of the source code in the git master.

Urgh.

I think what happened is that, when you cloned the master to produce
the standby, you also copied the pg_dynshmem directory, which cause
the standby to latch onto the master's control segment and blow it
away on startup.  When the master tried to shut down, it got unhappy.

I think this is further evidence that we need to get rid of the state
file; while I haven't agreed with Heikki's comments on this topic in
their entirety, there is clearly a problem here that needs to get
fixed somehow.  Latest discussion of this topic is here:

http://www.postgresql.org/message-id/CA+TgmoZAkz3yrZkm8D=N27dSc00PdQsshzLjBkQ29_twQgEBiA@mail.gmail.com

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company