Re: pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut
Date: 2008-07-04 18:56:01
Message-ID: 486E7241.6010905@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> Heikki Linnakangas wrote:
>>> What happens if someone launches version 8.3.3 postgres.exe and version
>>> 8.3.4 postgres.exe at the same time, on the same data directory? Will
>>> the interlock that prevents two postmasters from starting at the same
>>> time work?
>
>> Hmm. Didn't think of that :(
>
>> Yeah, it seems that that part of it would fail. In a lot of cases you'd
>> still get kicked off by socket conflicts and such, but the shared memory
>> part would not notice someone is already there, no.
>
>> Not sure if it's reason enough to revert - since it fixes other cases. I
>> guess in theory we could check both the old and the new name, but that's
>> going to be a considerably more complex patch.
>
> According to what you just told me, the original coding is storing the
> name in a "local namespace", which presumably means it won't conflict
> anyway. Ergo, the existing coding is simply broken and there's nothing
> we can do about it.

Local namespace = Session local, not process local. So it would properly
protect against two processes started in the same session. One session
is, for example, an interactive login. But not if they were started by
different users, since they'd be in different sessions.

//Magnus

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2008-07-04 19:12:01 Re: pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut
Previous Message Tom Lane 2008-07-04 16:15:03 Re: pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-07-04 19:12:01 Re: pgsql: Fix a couple of bugs in win32 shmem name generation: * Don't cut
Previous Message Dave Page 2008-07-04 18:38:13 Re: Explain XML patch v2